The branch, cleanup/updateMacros3, has been created.
        at  09a2250ab1bb92e51a8c4293e3ffb6e47528ba3e (commit)

- Log -----------------------------------------------------------------

commit 09a2250ab1bb92e51a8c4293e3ffb6e47528ba3e
Author: Richard Kimberly Heck <[email protected]>
Date:   Mon Nov 9 17:29:27 2020 -0500

    Renaming

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 4aad698..cc42d58 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -3690,7 +3690,7 @@ MacroData const * Buffer::getMacro(docstring const & name,
        }
 
        if (global) {
-               data = MacroTable::get().getMacro(name);
+               data = GlobalMacros::get().getMacro(name);
                if (data != nullptr)
                        return data;
        }
diff --git a/src/mathed/InsetMathMacro.cpp b/src/mathed/InsetMathMacro.cpp
index 600562f..c051c8e 100644
--- a/src/mathed/InsetMathMacro.cpp
+++ b/src/mathed/InsetMathMacro.cpp
@@ -938,7 +938,7 @@ MacroData const * InsetMathMacro::macroBackup() const
 {
        if (macro())
                return &d->macroBackup_;
-       if (MacroData const * data = MacroTable::get().getMacro(name()))
+       if (MacroData const * data = GlobalMacros::get().getMacro(name()))
                return data;
        return nullptr;
 }
@@ -957,7 +957,7 @@ void InsetMathMacro::validate(LaTeXFeatures & features) 
const
                features.require(d->required_);
        else if (!d->macro_) {
                // Update requires for known global macros.
-               MacroData const * data = MacroTable::get().getMacro(name());
+               MacroData const * data = GlobalMacros::get().getMacro(name());
                if (data && !data->required().empty())
                        features.require(data->required());
        }
diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index 19aa745..ee4cf77 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -2106,7 +2106,7 @@ MathCompletionList::MathCompletionList(Cursor const & cur)
 
        // fill in global macros
        macros.clear();
-       MacroTable::get().getMacroNames(macros, false);
+       GlobalMacros::get().getMacroNames(macros, false);
        //lyxerr << "Globals completion macros: ";
        for (it = macros.begin(); it != macros.end(); ++it) {
                //lyxerr << "\\" + *it << " ";
diff --git a/src/mathed/MacroTable.cpp b/src/mathed/MacroTable.cpp
index 2bc427b..e6daac6 100644
--- a/src/mathed/MacroTable.cpp
+++ b/src/mathed/MacroTable.cpp
@@ -215,22 +215,22 @@ int MacroData::write(odocstream & os, bool 
overwriteRedefinition) const
 //
 /////////////////////////////////////////////////////////////////////
 
-MacroTable & MacroTable::get()
+GlobalMacros & GlobalMacros::get()
 {
-       static MacroTable theGlobalMacros;
+       static GlobalMacros theGlobalMacros;
        return theGlobalMacros;
 }
 
 
-MacroData const * MacroTable::getMacro(docstring const & name) const
+MacroData const * GlobalMacros::getMacro(docstring const & name) const
 {
        const_iterator it = find(name);
        return it == end() ? 0 : &it->second;
 }
 
 
-MacroTable::iterator
-MacroTable::insert(docstring const & name, MacroData const & data)
+GlobalMacros::iterator
+GlobalMacros::insert(docstring const & name, MacroData const & data)
 {
        //lyxerr << "MacroTable::insert: " << to_utf8(name) << endl;
        iterator it = find(name);
@@ -243,8 +243,8 @@ MacroTable::insert(docstring const & name, MacroData const 
& data)
 }
 
 
-MacroTable::iterator
-MacroTable::insert(Buffer * buf, docstring const & definition)
+GlobalMacros::iterator
+GlobalMacros::insert(Buffer * buf, docstring const & definition)
 {
        //lyxerr << "MacroTable::insert, def: " << to_utf8(def) << endl;
        InsetMathMacroTemplate mac(buf);
@@ -254,7 +254,7 @@ MacroTable::insert(Buffer * buf, docstring const & 
definition)
 }
 
 
-void MacroTable::getMacroNames(std::set<docstring> & names, bool gethidden) 
const
+void GlobalMacros::getMacroNames(std::set<docstring> & names, bool gethidden) 
const
 {
        for (const_iterator it = begin(); it != end(); ++it)
                if (gethidden || !it->second.hidden())
@@ -262,7 +262,7 @@ void MacroTable::getMacroNames(std::set<docstring> & names, 
bool gethidden) cons
 }
 
 
-void MacroTable::dump()
+void GlobalMacros::dump()
 {
        lyxerr << "\n------------------------------------------" << endl;
        for (const_iterator it = begin(); it != end(); ++it)
diff --git a/src/mathed/MacroTable.h b/src/mathed/MacroTable.h
index a6996da..0d5e4a2 100644
--- a/src/mathed/MacroTable.h
+++ b/src/mathed/MacroTable.h
@@ -168,15 +168,15 @@ class MacroSet : public std::set<MacroData const *> {};
  * hack to display certain contents nicely.
  *
  **/
-class MacroTable : public std::map<docstring, MacroData>
+class GlobalMacros : public std::map<docstring, MacroData>
 {
 public:
        /// We are a singleton
-       MacroTable() = default;
-       MacroTable(MacroTable const &) = delete;
-       void operator=(MacroTable const &) = delete;
+       GlobalMacros() = default;
+       GlobalMacros(GlobalMacros const &) = delete;
+       void operator=(GlobalMacros const &) = delete;
        /// the global list: our unique instance
-       static MacroTable & get();
+       static GlobalMacros & get();
        /// Parse full "\\def..." or "\\newcommand..." or ...
        iterator insert(Buffer * buf, docstring const & definition);
        /// Insert pre-digested macro definition
diff --git a/src/mathed/MathFactory.cpp b/src/mathed/MathFactory.cpp
index f956973..49baa5d 100644
--- a/src/mathed/MathFactory.cpp
+++ b/src/mathed/MathFactory.cpp
@@ -202,7 +202,7 @@ void initSymbols()
                                        required = "";
                        } else
                                htmlname = xmlname = "";
-                       MacroTable::iterator it = MacroTable::get().insert(
+                       GlobalMacros::iterator it = GlobalMacros::get().insert(
                                        0, from_utf8(macro));
                        if (!extra.empty() || !htmlname.empty() || 
!xmlname.empty() || !required.empty()) {
                                MathWordList::iterator wit = 
theMathWordList.find(it->first);

commit e1a55f8b03fb6b8c7b6d8071a16f270668cf0591
Author: Richard Kimberly Heck <[email protected]>
Date:   Mon Nov 9 17:27:57 2020 -0500

    Some comments, and some conditional code to dump the macro table.
    
    (cherry picked from commit 30415c80f7934580ce2e1fdf0b5f84b5faeba9da)

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 78f61c6..4aad698 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -204,17 +204,21 @@ public:
                ScopeMacro() {}
                ScopeMacro(DocIterator const & s, MacroData const & m)
                        : scope(s), macro(m) {}
+               // The SCOPE is really just the last position at which the macro
+               // is in force. This will be the end of the file (if there are 
no
+               // children) unless it is in (say) a note, or an inactive 
branch,
+               // in which case it will be the end of that construct.
                DocIterator scope;
                MacroData macro;
        };
        typedef map<DocIterator, ScopeMacro> PositionScopeMacroMap;
-       typedef map<docstring, PositionScopeMacroMap> NamePositionScopeMacroMap;
+       typedef map<docstring, PositionScopeMacroMap> MacroMap;
        /// map from the macro name to the position map,
        /// which maps the macro definition position to the scope and the 
MacroData.
-       NamePositionScopeMacroMap macros;
+       MacroMap macros;
 
        /// Each child Buffer is listed in this map, together with where
-       /// it is included in this Buffer.
+       /// it is first included in this Buffer.
        typedef map<Buffer const * const, DocIterator> BufferPositionMap;
        BufferPositionMap children_positions;
        /// We also have a map from the positions where Buffers are included
@@ -3599,9 +3603,9 @@ MacroData const * Buffer::Impl::getBufferMacro(docstring 
const & name,
        MacroData const * bestData = nullptr;
 
        // find macro definitions for name
-       NamePositionScopeMacroMap::const_iterator nameIt = macros.find(name);
+       MacroMap::const_iterator nameIt = macros.find(name);
        if (nameIt != macros.end()) {
-               // find last definition in front of pos or at pos itself
+               // find last definition in front of pos
                PositionScopeMacroMap::const_iterator it
                        = greatest_below(nameIt->second, pos);
                if (it != nameIt->second.end()) {
@@ -3823,9 +3827,22 @@ void Buffer::updateMacros() const
 {
        if (d->macro_lock)
                return;
-
+#if 0
+       LYXERR0("Starting macro dump");
+       for (auto const & m : d->macros) {
+               LYXERR0(m.first);
+               for (auto const & m1 : m.second) {
+                       LYXERR0(m1.first);
+                       LYXERR0("Scope: " << m1.second.scope);
+                       LYXERR0("Def: " << m1.second.macro.definition());
+                       LYXERR0("");
+               }
+       }
+       LYXERR0("Ending macro dump");
+       LYXERR0("");
        LYXERR(Debug::MACROS, "updateMacro of " << d->filename.onlyFileName());
-
+#endif
+       
        // start with empty table
        d->macros.clear();
        d->children_positions.clear();

commit b94f564a168d43bb2ac74b095f5a02ec6cd40bb0
Author: Richard Kimberly Heck <[email protected]>
Date:   Mon Nov 9 16:59:04 2020 -0500

    More comments and minor code cleanup

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index fe0d6bc..78f61c6 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -220,7 +220,10 @@ public:
        /// We also have a map from the positions where Buffers are included
        /// to those Buffers and their scope (whose point RKH does not yet 
        /// understand).
-       // FIXME Surely one of these is enough?
+       // FIXME Surely one of these is enough? The difference is that
+       // children_positions has one entry for each child Buffer, whereas
+       // position_to_children has one entry for each InsetInclude (and the
+       // same Buffer could be included twice).
        struct ScopeBuffer {
                ScopeBuffer() = default;
                ScopeBuffer(DocIterator const & s, Buffer const * b)
@@ -614,6 +617,10 @@ void Buffer::cloneWithChildren(BufferMap & bufmap, 
CloneList_ptr clones) const
                return;
 
        Buffer * buffer_clone = new Buffer(fileName().absFileName(), false, 
this);
+       if (!buffer_clone) {
+               LYXERR0("Buffer creation failed!");
+               LBUFERR(false);
+       }
 
        // The clone needs its own DocumentClass, since running updateBuffer() 
will
        // modify it, and we would otherwise be sharing it with the original 
Buffer.
@@ -629,27 +636,32 @@ void Buffer::cloneWithChildren(BufferMap & bufmap, 
CloneList_ptr clones) const
        buffer_clone->d->macro_lock = true;
        buffer_clone->d->children_positions.clear();
 
-       // FIXME (Abdel 09/01/2010): this is too complicated. The whole 
children_positions and
-       // math macro caches need to be rethought and simplified.
-       // I am not sure wether we should handle Buffer cloning here or in 
BufferList.
-       // Right now BufferList knows nothing about buffer clones.
+       // clone the children and update the information in the InsetIncludes
        for (auto const & p : d->position_to_children) {
-               DocIterator dit = p.first.clone(buffer_clone);
+               // location of child in old Buffer
+               DocIterator const & olddit = p.first;
+               // a DocIterator that points to the same location in this new 
Buffer
+               DocIterator dit = olddit.clone(buffer_clone);
                dit.setBuffer(buffer_clone);
+               // the child in the old Buffer
                Buffer * child = const_cast<Buffer *>(p.second.buffer);
-
+               // clone the child
                child->cloneWithChildren(bufmap, clones);
+               // we now need to find the child we just created (or the 
previously
+               // created one, if it was already cloned).
                BufferMap::iterator const bit = bufmap.find(child);
                LASSERT(bit != bufmap.end(), continue);
                Buffer * child_clone = bit->second;
 
+               // the Buffer for this include inset is now the cloned child
                Inset * inset = dit.nextInset();
                LASSERT(inset && inset->lyxCode() == INCLUDE_CODE, continue);
                InsetInclude * inset_inc = static_cast<InsetInclude *>(inset);
                inset_inc->setChildBuffer(child_clone);
+               // set us as its parent
                child_clone->d->setParent(buffer_clone);
                // FIXME Do we need to do this now, or can we wait until we run 
updateMacros()?
-               buffer_clone->setChild(dit, child_clone);
+               d->children_positions[child_clone] = dit;
        }
        buffer_clone->d->macro_lock = false;
 }
@@ -795,12 +807,6 @@ Undo & Buffer::undo()
 }
 
 
-void Buffer::setChild(DocIterator const & dit, Buffer * child)
-{
-       d->children_positions[child] = dit;
-}
-
-
 string Buffer::latexName(bool const no_path) const
 {
        FileName latex_name =
diff --git a/src/Buffer.h b/src/Buffer.h
index a917c6e..2dbc16c 100644
--- a/src/Buffer.h
+++ b/src/Buffer.h
@@ -223,7 +223,7 @@ public:
        double fontScalingFactor() const;
 
 private:
-       ///
+       /// map from Buffers to their clones
        typedef std::map<Buffer const *, Buffer *> BufferMap;
        ///
        void cloneWithChildren(BufferMap &, CloneList_ptr) const;
@@ -648,8 +648,6 @@ public:
        /// This function is called when the buffer is changed.
        void changed(bool update_metrics) const;
        ///
-       void setChild(DocIterator const & dit, Buffer * child);
-       ///
        void updateTocItem(std::string const &, DocIterator const &) const;
        /// This function is called when the buffer structure is changed.
        void structureChanged() const;

commit e3d6a66a254644a99f42655ac5f4ce21c9e5f426
Author: Richard Kimberly Heck <[email protected]>
Date:   Mon Nov 9 16:37:18 2020 -0500

    Surely we do not need to clear objects that are about to be destroyed
    
    (cherry picked from commit efe55ba6a700ed9eec836d9bc23fd5756cfdcd47)

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index c0115aa..fe0d6bc 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -557,10 +557,6 @@ Buffer::~Buffer()
                        } else
                                cloned_buffers.erase(it);
                }
-               // FIXME Do we really need to do this right before we delete d?
-               // clear references to children in macro tables
-               d->children_positions.clear();
-               d->position_to_children.clear();
        } else {
                // loop over children
                for (auto const & p : d->children_positions) {
@@ -583,11 +579,6 @@ Buffer::~Buffer()
                        Alert::warning(_("Attempting to close changed 
document!"), msg);
                }
 
-               // FIXME Do we really need to do this right before we delete d?
-               // clear references to children in macro tables
-               d->children_positions.clear();
-               d->position_to_children.clear();
-
                if (!d->temppath.destroyDirectory()) {
                        LYXERR0(bformat(_("Could not remove the temporary 
directory %1$s"),
                                from_utf8(d->temppath.absFileName())));

commit d8328c33a80d4e945518a3ac5566e730b6828428
Author: Richard Kimberly Heck <[email protected]>
Date:   Mon Nov 9 16:36:20 2020 -0500

    More comments and minor cleanup

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index c7038d0..c0115aa 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -213,18 +213,21 @@ public:
        /// which maps the macro definition position to the scope and the 
MacroData.
        NamePositionScopeMacroMap macros;
 
-       /// positions of child buffers in the buffer
+       /// Each child Buffer is listed in this map, together with where
+       /// it is included in this Buffer.
+       typedef map<Buffer const * const, DocIterator> BufferPositionMap;
+       BufferPositionMap children_positions;
+       /// We also have a map from the positions where Buffers are included
+       /// to those Buffers and their scope (whose point RKH does not yet 
+       /// understand).
+       // FIXME Surely one of these is enough?
        struct ScopeBuffer {
-               ScopeBuffer() : buffer(nullptr) {}
+               ScopeBuffer() = default;
                ScopeBuffer(DocIterator const & s, Buffer const * b)
                        : scope(s), buffer(b) {}
                DocIterator scope;
                Buffer const * buffer;
        };
-       /// position of children buffers in this buffer
-       typedef map<Buffer const * const, DocIterator> BufferPositionMap;
-       BufferPositionMap children_positions;
-       /// map from children inclusion positions to their scope and their 
buffer
        typedef map<DocIterator, ScopeBuffer> PositionScopeBufferMap;
        PositionScopeBufferMap position_to_children;
 
@@ -5463,9 +5466,9 @@ bool Buffer::saveAs(FileName const & fn)
 
 void Buffer::checkChildBuffers()
 {
-       for (auto const & bit : d->children_positions) {
-               DocIterator dit = bit.second;
-               Buffer * cbuf = const_cast<Buffer *>(bit.first);
+       for (auto const & kid : d->children_positions) {
+               DocIterator const & dit = kid.second;
+               Buffer * cbuf = const_cast<Buffer *>(kid.first);
                if (!cbuf || !theBufferList().isLoaded(cbuf))
                        continue;
                Inset * inset = dit.nextInset();
@@ -5477,7 +5480,9 @@ void Buffer::checkChildBuffers()
                                onlyPath(absFileName())).absFileName();
                if (oldloc == newloc)
                        continue;
-               // the location of the child file is incorrect.
+               // the location of the child file is incorrect. e.g., it
+               // had a relative path which does not now point to the correct
+               // file (after saveAs, usually).
                cbuf->setParent(nullptr);
                inset_inc->setChildBuffer(nullptr);
        }

commit 48604781104529a5ff9bd0e15697614788ac8fe5
Author: Richard Kimberly Heck <[email protected]>
Date:   Mon Nov 9 15:56:01 2020 -0500

    Some comments and some minor re-organization

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index e8e8ef3..c7038d0 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -214,7 +214,6 @@ public:
        NamePositionScopeMacroMap macros;
 
        /// positions of child buffers in the buffer
-       typedef map<Buffer const * const, DocIterator> BufferPositionMap;
        struct ScopeBuffer {
                ScopeBuffer() : buffer(nullptr) {}
                ScopeBuffer(DocIterator const & s, Buffer const * b)
@@ -222,10 +221,11 @@ public:
                DocIterator scope;
                Buffer const * buffer;
        };
-       typedef map<DocIterator, ScopeBuffer> PositionScopeBufferMap;
        /// position of children buffers in this buffer
+       typedef map<Buffer const * const, DocIterator> BufferPositionMap;
        BufferPositionMap children_positions;
        /// map from children inclusion positions to their scope and their 
buffer
+       typedef map<DocIterator, ScopeBuffer> PositionScopeBufferMap;
        PositionScopeBufferMap position_to_children;
 
        /// Contains the old buffer filePath() while saving-as, or the
diff --git a/src/mathed/MacroTable.h b/src/mathed/MacroTable.h
index ab3c6b4..a6996da 100644
--- a/src/mathed/MacroTable.h
+++ b/src/mathed/MacroTable.h
@@ -112,6 +112,10 @@ private:
        void updateData() const;
        ///
        Buffer const * buffer_;
+       // FIXME This is probably a large part of why updateMacros is 
+       // so expensive. We are, it would seem, recreating these objects
+       // from scratch each time through. That seems unnecessary, if what
+       // usually needs updating is just the pos_ member.
        /// The position of the definition in the buffer.
        /// There is no guarantee it stays valid if the buffer
        /// changes. But it (normally) exists only until the
@@ -121,13 +125,20 @@ private:
        /// returns its defaults values and the user sees unfolded
        /// macros.
        mutable DocIterator pos_;
-       ///
+       /// flag that tells us whether our cached info is valid. used
+       /// with lazy version.
        mutable bool queried_ = false;
-       ///
+       // At the moment, it seems to me as if most of the other members
+       // could be replaced by a pointer to the associated macro (and so
+       // that one eliminated. I.e.:
+       //    InsetMathMacroTemplate const * const ourmacro_;
+       //    docstring definition() { return ourmacro_->definition(); }
+       // etc.
+       /// the macro definition
        mutable docstring definition_;
        ///
        mutable size_t numargs_ = 0;
-       ///
+       /// what we use (a kind of LyX macro) for display in the work area
        mutable docstring display_;
        ///
        latexkeys const * sym_ = nullptr;

commit 8ce1855312dbb521f36fb8ec19a31e3094b11a55
Author: Richard Kimberly Heck <[email protected]>
Date:   Mon Nov 9 15:39:20 2020 -0500

    Properly implement the singleton pattern

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 185bbdc..e8e8ef3 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -3686,7 +3686,7 @@ MacroData const * Buffer::getMacro(docstring const & name,
        }
 
        if (global) {
-               data = MacroTable::globalMacros().get(name);
+               data = MacroTable::get().getMacro(name);
                if (data != nullptr)
                        return data;
        }
diff --git a/src/mathed/InsetMathMacro.cpp b/src/mathed/InsetMathMacro.cpp
index 57294c0..600562f 100644
--- a/src/mathed/InsetMathMacro.cpp
+++ b/src/mathed/InsetMathMacro.cpp
@@ -938,7 +938,7 @@ MacroData const * InsetMathMacro::macroBackup() const
 {
        if (macro())
                return &d->macroBackup_;
-       if (MacroData const * data = MacroTable::globalMacros().get(name()))
+       if (MacroData const * data = MacroTable::get().getMacro(name()))
                return data;
        return nullptr;
 }
@@ -957,7 +957,7 @@ void InsetMathMacro::validate(LaTeXFeatures & features) 
const
                features.require(d->required_);
        else if (!d->macro_) {
                // Update requires for known global macros.
-               MacroData const * data = MacroTable::globalMacros().get(name());
+               MacroData const * data = MacroTable::get().getMacro(name());
                if (data && !data->required().empty())
                        features.require(data->required());
        }
diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index ada0400..19aa745 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -2106,7 +2106,7 @@ MathCompletionList::MathCompletionList(Cursor const & cur)
 
        // fill in global macros
        macros.clear();
-       MacroTable::globalMacros().getMacroNames(macros, false);
+       MacroTable::get().getMacroNames(macros, false);
        //lyxerr << "Globals completion macros: ";
        for (it = macros.begin(); it != macros.end(); ++it) {
                //lyxerr << "\\" + *it << " ";
diff --git a/src/mathed/MacroTable.cpp b/src/mathed/MacroTable.cpp
index 218c849..2bc427b 100644
--- a/src/mathed/MacroTable.cpp
+++ b/src/mathed/MacroTable.cpp
@@ -215,14 +215,14 @@ int MacroData::write(odocstream & os, bool 
overwriteRedefinition) const
 //
 /////////////////////////////////////////////////////////////////////
 
-MacroTable & MacroTable::globalMacros()
+MacroTable & MacroTable::get()
 {
        static MacroTable theGlobalMacros;
        return theGlobalMacros;
 }
 
 
-MacroData const * MacroTable::get(docstring const & name) const
+MacroData const * MacroTable::getMacro(docstring const & name) const
 {
        const_iterator it = find(name);
        return it == end() ? 0 : &it->second;
diff --git a/src/mathed/MacroTable.h b/src/mathed/MacroTable.h
index 77b306f..ab3c6b4 100644
--- a/src/mathed/MacroTable.h
+++ b/src/mathed/MacroTable.h
@@ -160,19 +160,22 @@ class MacroSet : public std::set<MacroData const *> {};
 class MacroTable : public std::map<docstring, MacroData>
 {
 public:
+       /// We are a singleton
+       MacroTable() = default;
+       MacroTable(MacroTable const &) = delete;
+       void operator=(MacroTable const &) = delete;
+       /// the global list: our unique instance
+       static MacroTable & get();
        /// Parse full "\\def..." or "\\newcommand..." or ...
        iterator insert(Buffer * buf, docstring const & definition);
        /// Insert pre-digested macro definition
        iterator insert(docstring const & name, MacroData const & data);
        ///
-       MacroData const * get(docstring const & name) const;
+       MacroData const * getMacro(docstring const & name) const;
        ///
        void dump();
        ///
        void getMacroNames(std::set<docstring> & names, bool gethidden) const;
-
-       /// the global list
-       static MacroTable & globalMacros();
 };
 
 
diff --git a/src/mathed/MathFactory.cpp b/src/mathed/MathFactory.cpp
index 54fe012..f956973 100644
--- a/src/mathed/MathFactory.cpp
+++ b/src/mathed/MathFactory.cpp
@@ -202,7 +202,7 @@ void initSymbols()
                                        required = "";
                        } else
                                htmlname = xmlname = "";
-                       MacroTable::iterator it = 
MacroTable::globalMacros().insert(
+                       MacroTable::iterator it = MacroTable::get().insert(
                                        0, from_utf8(macro));
                        if (!extra.empty() || !htmlname.empty() || 
!xmlname.empty() || !required.empty()) {
                                MathWordList::iterator wit = 
theMathWordList.find(it->first);

commit 5b1ca583249ea2d5e02570592bcde59bcc667de6
Author: Richard Kimberly Heck <[email protected]>
Date:   Fri Nov 6 11:41:20 2020 -0500

    The isMacroScope method is just !producesOutput (or should be).
    
    So remove that, and restructure the code a bit.

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 23f6315..185bbdc 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -3731,18 +3731,21 @@ void Buffer::Impl::updateMacros(DocIterator & it, 
DocIterator & scope)
                        it.pos() = insit.pos;
 
                        // is it a nested text inset?
-                       if (insit.inset->asInsetText()) {
-                               // Inset needs its own scope?
+                       case TEXT_CODE: {
                                InsetText const * itext = 
insit.inset->asInsetText();
-                               bool newScope = itext->isMacroScope();
-
-                               // scope which ends just behind the inset
-                               DocIterator insetScope = it;
-                               ++insetScope.pos();
-
                                // collect macros in inset
                                it.push_back(CursorSlice(*insit.inset));
-                               updateMacros(it, newScope ? insetScope : scope);
+                               if (itext->producesOutput()) {
+                                       // the simple case
+                                       updateMacros(it, scope);
+                               } else {
+                                       // We don't want macros declared in 
notes, comments, etc, 
+                                       // to affect anything outside them.
+                                       // New scope which ends just behind the 
inset
+                                       DocIterator new_scope = it;
+                                       ++new_scope.pos();
+                                       updateMacros(it, new_scope);
+                               }
                                it.pop_back();
                                continue;
                        }
diff --git a/src/insets/InsetBranch.cpp b/src/insets/InsetBranch.cpp
index a70ff27..17e8007 100644
--- a/src/insets/InsetBranch.cpp
+++ b/src/insets/InsetBranch.cpp
@@ -381,13 +381,6 @@ string InsetBranch::contextMenuName() const
 }
 
 
-bool InsetBranch::isMacroScope() const
-{
-       // Its own scope if not selected by buffer
-       return !producesOutput();
-}
-
-
 string InsetBranch::params2string(InsetBranchParams const & params)
 {
        ostringstream data;
diff --git a/src/insets/InsetBranch.h b/src/insets/InsetBranch.h
index 6106ce5..2746485 100644
--- a/src/insets/InsetBranch.h
+++ b/src/insets/InsetBranch.h
@@ -104,8 +104,6 @@ private:
        ///
        bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const 
override;
        ///
-       bool isMacroScope() const override;
-       ///
        docstring toolTip(BufferView const & bv, int x, int y) const override;
        ///
        bool usePlainLayout() const override { return false; }
diff --git a/src/insets/InsetNote.cpp b/src/insets/InsetNote.cpp
index fa84c61..5717feb 100644
--- a/src/insets/InsetNote.cpp
+++ b/src/insets/InsetNote.cpp
@@ -198,16 +198,6 @@ bool InsetNote::getStatus(Cursor & cur, FuncRequest const 
& cmd,
 }
 
 
-bool InsetNote::isMacroScope() const
-{
-       // LyX note has no latex output
-       if (params_.type == InsetNoteParams::Note)
-               return true;
-
-       return InsetCollapsible::isMacroScope();
-}
-
-
 void InsetNote::latex(otexstream & os, OutputParams const & runparams_in) const
 {
        if (params_.type == InsetNoteParams::Note)
diff --git a/src/insets/InsetNote.h b/src/insets/InsetNote.h
index aeab8f0..b698505 100644
--- a/src/insets/InsetNote.h
+++ b/src/insets/InsetNote.h
@@ -79,8 +79,6 @@ private:
        /// show the note dialog
        bool showInsetDialog(BufferView * bv) const override;
        ///
-       bool isMacroScope() const override;
-       ///
        void latex(otexstream &, OutputParams const &) const override;
        ///
        int plaintext(odocstringstream & ods, OutputParams const & op,
diff --git a/src/insets/InsetText.h b/src/insets/InsetText.h
index d571806..cefd44c 100644
--- a/src/insets/InsetText.h
+++ b/src/insets/InsetText.h
@@ -156,8 +156,6 @@ public:
        ///
        bool allowSpellCheck() const override { return getLayout().spellcheck() 
&& !getLayout().isPassThru(); }
        ///
-       virtual bool isMacroScope() const { return false; }
-       ///
        bool allowMultiPar() const override { return getLayout().isMultiPar(); }
        ///
        bool isInTitle() const override { return intitle_context_; }

commit fdd0a6f84923f1d4a1f82457a3e256a2ee706f6b
Author: Richard Kimberly Heck <[email protected]>
Date:   Wed Nov 11 11:24:59 2020 -0500

    Revert "Improve structure of updateMacros"
    
    The problem here is that the check against TEXT_CODE only
    catches InsetText, and not its subclasses. Same for the check
    against MATH_HULL_CODE. So there is reason not to check codes
    here.
    
    This reverts commit 5a54ccfa87057fd3220d7193b40ac2dd37a9e6e1.

diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index acda58f..23f6315 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -3730,11 +3730,10 @@ void Buffer::Impl::updateMacros(DocIterator & it, 
DocIterator & scope)
                for (auto const & insit : par.insetList()) {
                        it.pos() = insit.pos;
 
-                       switch (insit.inset->lyxCode()) {
                        // is it a nested text inset?
-                       case TEXT_CODE: {
-                               InsetText const * itext = 
insit.inset->asInsetText();
+                       if (insit.inset->asInsetText()) {
                                // Inset needs its own scope?
+                               InsetText const * itext = 
insit.inset->asInsetText();
                                bool newScope = itext->isMacroScope();
 
                                // scope which ends just behind the inset
@@ -3745,9 +3744,10 @@ void Buffer::Impl::updateMacros(DocIterator & it, 
DocIterator & scope)
                                it.push_back(CursorSlice(*insit.inset));
                                updateMacros(it, newScope ? insetScope : scope);
                                it.pop_back();
-                               break;
+                               continue;
                        }
-                       case TABULAR_CODE: {
+
+                       if (insit.inset->asInsetTabular()) {
                                CursorSlice slice(*insit.inset);
                                size_t const numcells = slice.nargs();
                                for (; slice.idx() < numcells; 
slice.forwardIdx()) {
@@ -3755,10 +3755,11 @@ void Buffer::Impl::updateMacros(DocIterator & it, 
DocIterator & scope)
                                        updateMacros(it, scope);
                                        it.pop_back();
                                }
-                               break;
+                               continue;
                        }
+
                        // is it an external file?
-                       case INCLUDE_CODE: {
+                       if (insit.inset->lyxCode() == INCLUDE_CODE) {
                                // get buffer of external file
                                InsetInclude const & incinset =
                                        static_cast<InsetInclude const 
&>(*insit.inset);
@@ -3766,7 +3767,7 @@ void Buffer::Impl::updateMacros(DocIterator & it, 
DocIterator & scope)
                                Buffer * child = incinset.loadIfNeeded();
                                macro_lock = false;
                                if (!child)
-                                       break;
+                                       continue;
 
                                // register its position, but only when it is
                                // included first in the buffer
@@ -3774,40 +3775,38 @@ void Buffer::Impl::updateMacros(DocIterator & it, 
DocIterator & scope)
 
                                // register child with its scope
                                position_to_children[it] = 
Impl::ScopeBuffer(scope, child);
-                               break;
-                       }
-                       case MATH_HULL_CODE: {
-                               if (!doing_export)
-                                       break;
-                               InsetMathHull * hull = 
insit.inset->asInsetMath()->asHullInset();
-                               hull->recordLocation(it);
-                               break;
-                       }
-                       case MATHMACRO_CODE: {
-                               // get macro data
-                               InsetMathMacroTemplate & macroTemplate =
-                                       
*insit.inset->asInsetMath()->asMacroTemplate();
-                               MacroContext mc(owner_, it);
-                               macroTemplate.updateToContext(mc);
-       
-                               // valid?
-                               bool valid = macroTemplate.validMacro();
-                               // FIXME: Should be fixNameAndCheckIfValid() in 
fact,
-                               // then the BufferView's cursor will be invalid 
in
-                               // some cases which leads to crashes.
-                               if (!valid)
-                                       break;
-       
-                               // register macro
-                               // FIXME (Abdel), I don't understand why we 
pass 'it' here
-                               // instead of 'macroTemplate' defined above... 
is this correct?
-                               macros[macroTemplate.name()][it] =
-                                       Impl::ScopeMacro(scope, 
MacroData(owner_, it));
-                               break;
+                               continue;
                        }
-                       default:
-                               break;
+
+                       InsetMath * im = insit.inset->asInsetMath();
+                       if (doing_export && im)  {
+                               InsetMathHull * hull = im->asHullInset();
+                               if (hull)
+                                       hull->recordLocation(it);
                        }
+
+                       if (insit.inset->lyxCode() != MATHMACRO_CODE)
+                               continue;
+
+                       // get macro data
+                       InsetMathMacroTemplate & macroTemplate =
+                               *insit.inset->asInsetMath()->asMacroTemplate();
+                       MacroContext mc(owner_, it);
+                       macroTemplate.updateToContext(mc);
+
+                       // valid?
+                       bool valid = macroTemplate.validMacro();
+                       // FIXME: Should be fixNameAndCheckIfValid() in fact,
+                       // then the BufferView's cursor will be invalid in
+                       // some cases which leads to crashes.
+                       if (!valid)
+                               continue;
+
+                       // register macro
+                       // FIXME (Abdel), I don't understand why we pass 'it' 
here
+                       // instead of 'macroTemplate' defined above... is this 
correct?
+                       macros[macroTemplate.name()][it] =
+                               Impl::ScopeMacro(scope, 
MacroData(const_cast<Buffer *>(owner_), it));
                }
 
                // next paragraph
diff --git a/src/mathed/MathData.cpp b/src/mathed/MathData.cpp
index ce1f4b5..39d5f80 100644
--- a/src/mathed/MathData.cpp
+++ b/src/mathed/MathData.cpp
@@ -403,8 +403,8 @@ void MathData::updateMacros(Cursor * cur, MacroContext 
const & mc,
 {
        // If we are editing a macro, we cannot update it immediately,
        // otherwise wrong undo steps will be recorded (bug 6208).
-       InsetMath const * inmath = cur ? cur->inset().asInsetMath() : nullptr;
-       InsetMathMacro const * inmacro = inmath ? inmath->asMacro() : nullptr;
+       InsetMath const * inmath = cur ? cur->inset().asInsetMath() : 0;
+       InsetMathMacro const * inmacro = inmath ? inmath->asMacro() : 0;
        docstring const edited_name = inmacro ? inmacro->name() : docstring();
 
        // go over the array and look for macros

commit 63300c3ba89ba1f196b8d436f09a2279d6780de0
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Tue Nov 10 15:39:47 2020 +0100

    Fixup aeb51be9: set current font correctly when editing inset
    
    When using InsetText::edit(), invoke Cursor::setCurrentFont (note that
    editXY does it already). It is a good idea in general, especially
    after commit 411333fa95, which sets languagecorrectly in ERT.
    
    This allows to comment out (again!) the trick added to fix ticket #9042.

diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index f72b9a6..ec223fa 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -280,6 +280,7 @@ void InsetText::edit(Cursor & cur, bool front, 
EntryDirection entry_from)
        }
 
        cur.top().setPitPos(pit, pos);
+       cur.setCurrentFont();
        cur.finishUndo();
 }
 
@@ -294,6 +295,7 @@ void InsetText::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        LYXERR(Debug::ACTION, "InsetText::doDispatch(): cmd: " << cmd);
 
+#if 0
        // See bug #9042, for instance.
        if (isPassThru()) {
                // Force any new text to latex_language FIXME: This
@@ -305,6 +307,7 @@ void InsetText::doDispatch(Cursor & cur, FuncRequest & cmd)
                cur.current_font.setLanguage(latex_language);
                cur.real_current_font.setLanguage(latex_language);
        }
+#endif
 
        switch (cmd.action()) {
        case LFUN_PASTE:

commit 411333fa956c8980fee672364eabacf9f3b57d9d
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Tue Nov 10 13:47:53 2020 +0100

    Make sure that Cursor::setCurrentFont sets LaTeX language in ERT&friends
    
    Fix issue when language is set to document language instead of
    latex_language in ERT and pass thru layouts.
    
    To trigger the issue
    1/ select all in a ERT inset
    2/ type "abc"
    3/ look at code in code preview pane
    
    ==> result: the "a" is in document language, the "bc" in LaTeX language
    (as should be)

diff --git a/src/Cursor.cpp b/src/Cursor.cpp
index 97fbeb6..39083e5 100644
--- a/src/Cursor.cpp
+++ b/src/Cursor.cpp
@@ -2457,6 +2457,12 @@ void Cursor::setCurrentFont()
                real_current_font.setLanguage(lang);
                real_current_font.fontInfo().setNumber(FONT_OFF);
        }
+
+       // No language in pass thru situations
+       if (cs.paragraph().isPassThru()) {
+               current_font.setLanguage(latex_language);
+               real_current_font.setLanguage(latex_language);
+       }
 }
 
 

commit 23d0e44bd6ca13bfae9520120cf5b8ae3cd2b7ba
Author: Pavel Sanda <[email protected]>
Date:   Mon Nov 9 15:06:42 2020 +0100

    Fix Riki's contact

diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx
index 40ecdc5..bdb1368 100644
--- a/lib/doc/Customization.lyx
+++ b/lib/doc/Customization.lyx
@@ -159,7 +159,6 @@ by the \SpecialChar LyX
 status collapsed
 
 \begin_layout Plain Layout
-\noindent
 If you have comments or error corrections, please send them to the 
\SpecialChar LyX
  Documentatio
 n mailing list, 
@@ -181,7 +180,17 @@ literal "false"
 \end_inset
 
  in the subject header, and please cc the current maintainer of this file,
- Richard Heck <[email protected]>.
+ Richard 
+\change_inserted 5863208 1604930692
+Kimberly 
+\change_unchanged
+Heck <
+\change_inserted 5863208 1604930729
[email protected]
+\change_deleted 5863208 1604930668
[email protected]
+\change_unchanged
+>.
 \end_layout
 
 \end_inset

commit 032418ddfda0965f93fb332bc414d66ec3617302
Author: Pavel Sanda <[email protected]>
Date:   Mon Nov 9 14:42:25 2020 +0100

    Customization.lyx: Import and review changes from Phil Netro.
    
    Chap. 1 & 2.

diff --git a/lib/doc/Customization.lyx b/lib/doc/Customization.lyx
index 8f2e6dc..40ecdc5 100644
--- a/lib/doc/Customization.lyx
+++ b/lib/doc/Customization.lyx
@@ -140,6 +140,7 @@ logicalmkup
 \author -712698321 "Jürgen Spitzmüller"
 \author -495245474 "Jean-Marc Lasgouttes"
 \author 5863208 "ab"
+\author 232239728 "Owner"
 \author 731793113 "Richard Kimberly Heck" [email protected]
 \author 1075283030 "Thibaut"
 \end_header
@@ -193,7 +194,7 @@ literal "false"
 \begin_inset Newline newline
 \end_inset
 
-Version 2.3.x 
+Version 2.4.x
 \end_layout
 
 \begin_layout Standard
@@ -336,8 +337,11 @@ LyXDir
 
 \end_inset
 
- and its sub-directories contain a number of files and that can be used
- to customize \SpecialChar LyX
+ and its sub-directories contain a number of files 
+\change_deleted 232239728 1604787780
+and
+\change_unchanged
+ that can be used to customize \SpecialChar LyX
 's behavior.
  You can change many of these files from within \SpecialChar LyX
  itself through the 
@@ -377,7 +381,7 @@ Automatically generated files
 \end_layout
 
 \begin_layout Standard
-The files, which are to be found in 
+The files found in 
 \begin_inset Flex Noun
 status collapsed
 
@@ -387,9 +391,14 @@ UserDir
 
 \end_inset
 
-, are generated when you configure \SpecialChar LyX
+ are generated when you configure \SpecialChar LyX
 .
- They contain various default values that are guessed by inspection.
+ They contain various default values that are 
+\change_inserted 5863208 1604919565
+automatically detected during reconfiguration.
+\change_deleted 232239728 1604788241
+guessed by inspection
+\change_unchanged
  In general, it is not a good idea to modify them, since they might be 
overwritt
 en at any time.
 \end_layout
@@ -405,7 +414,32 @@ lyxrc.defaults
 
 \end_inset
 
- contains defaults for various commands.
+ 
+\change_deleted 5863208 1604919950
+
+\begin_inset Note Note
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 232239728 1604853928
+I capitalized the first word in all of these lists.
+ To me it looks better but it really is a stylistic thing, your call.
+ However if you are not going to capitalize them, the english in some needs
+ to be modified to make it read correctly as a sentence.
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+
+\change_deleted 232239728 1604853510
+c
+\change_inserted 232239728 1604853510
+C
+\change_unchanged
+ontains defaults for various commands.
 \end_layout
 
 \begin_layout Labeling
@@ -419,7 +453,13 @@ packages.lst
 
 \end_inset
 
- contains the list of packages that have been recognized by \SpecialChar LyX
+ 
+\change_deleted 232239728 1604853512
+c
+\change_inserted 232239728 1604853512
+C
+\change_unchanged
+ontains the list of packages that have been recognized by \SpecialChar LyX
 .
  It is currently unused by the \SpecialChar LyX
  program itself, but the information extracted,
@@ -453,7 +493,13 @@ textclass.lst
 
 \end_inset
 
- the list of text classes that have been found in your 
+ 
+\change_deleted 232239728 1604853515
+t
+\change_inserted 232239728 1604853515
+T
+\change_unchanged
+he list of text classes that have been found in your 
 \begin_inset Flex Code
 status collapsed
 
@@ -478,7 +524,13 @@ lyxmodules.lst
 
 \end_inset
 
- the list of layout modules found in your 
+ 
+\change_deleted 232239728 1604853518
+t
+\change_inserted 232239728 1604853518
+T
+\change_unchanged
+he list of layout modules found in your 
 \begin_inset Flex Code
 status collapsed
 
@@ -494,7 +546,7 @@ layout/
 \begin_layout Labeling
 \labelwidthstring 00.00.0000
 \begin_inset Flex Code
-status collapsed
+status open
 
 \begin_layout Plain Layout
 *files.lst
@@ -502,14 +554,20 @@ status collapsed
 
 \end_inset
 
- lists of various sorts of \SpecialChar LaTeX
+ 
+\change_deleted 232239728 1604853523
+l
+\change_inserted 232239728 1604853523
+L
+\change_unchanged
+ists of various sorts of \SpecialChar LaTeX
 -related files found on your system
 \end_layout
 
 \begin_layout Labeling
 \labelwidthstring 00.00.0000
 \begin_inset Flex Code
-status collapsed
+status open
 
 \begin_layout Plain Layout
 doc/\SpecialChar LaTeX
@@ -539,7 +597,19 @@ Directories
 \end_layout
 
 \begin_layout Standard
-These directories are duplicated between 
+The
+\change_deleted 5863208 1604928729
+se
+\change_unchanged
+ 
+\change_inserted 5863208 1604928636
+following 
+\change_unchanged
+directories 
+\change_inserted 5863208 1604928661
+in 
+\change_unchanged
+
 \begin_inset Flex Code
 status collapsed
 
@@ -549,7 +619,29 @@ LyXDir
 
 \end_inset
 
- and 
+
+\change_inserted 5863208 1604928662
+ can be
+\change_deleted 5863208 1604928642
+are
+\change_unchanged
+ duplicated 
+\change_deleted 5863208 1604928669
+between 
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+LyXDir
+\end_layout
+
+\end_inset
+
+ and
+\change_inserted 5863208 1604928680
+in
+\change_unchanged
+ 
 \begin_inset Flex Code
 status collapsed
 
@@ -560,7 +652,11 @@ UserDir
 \end_inset
 
 .
- If a particular files exists in both places, the one in 
+ If a particular file
+\change_deleted 232239728 1604794430
+s
+\change_unchanged
+ exists in both places, the one in 
 \begin_inset Flex Code
 status collapsed
 
@@ -584,7 +680,13 @@ bind/
 
 \end_inset
 
- this directory contains files with the extension 
+ 
+\change_deleted 232239728 1604794460
+t
+\change_inserted 232239728 1604794460
+T
+\change_unchanged
+his directory contains files with the extension 
 \begin_inset Flex Code
 status collapsed
 
@@ -620,7 +722,13 @@ citeengines/
 
 \end_inset
 
- contains files with the extension 
+ 
+\change_deleted 232239728 1604794478
+c
+\change_inserted 232239728 1604794478
+C
+\change_unchanged
+ontains files with the extension 
 \begin_inset Flex Code
 status collapsed
 
@@ -655,7 +763,13 @@ clipart/
 
 \end_inset
 
- contains graphics files that can be included in documents.
+ 
+\change_deleted 232239728 1604794483
+c
+\change_inserted 232239728 1604794486
+C
+\change_unchanged
+ontains graphics files that can be included in documents.
  
 \end_layout
 
@@ -670,14 +784,26 @@ doc/
 
 \end_inset
 
- contains \SpecialChar LyX
+ 
+\change_deleted 232239728 1604794492
+c
+\change_inserted 232239728 1604794492
+C
+\change_unchanged
+ontains \SpecialChar LyX
  documentation files (including the one you are currently reading).
  The file 
 \begin_inset Flex Code
 status collapsed
 
 \begin_layout Plain Layout
+
+\change_deleted 232239728 1604794660
 \SpecialChar LaTeX
+
+\change_inserted 232239728 1604794661
+LaTex
+\change_unchanged
 Config.lyx
 \end_layout
 
@@ -724,7 +850,13 @@ examples/
 
 \end_inset
 
- contains example files that explain how to use some features.
+ 
+\change_deleted 232239728 1604794497
+c
+\change_inserted 232239728 1604794497
+C
+\change_unchanged
+ontains example files that explain how to use some features.
  In the file browser, press the 
 \begin_inset Flex Noun
 status collapsed
@@ -749,7 +881,13 @@ images/
 
 \end_inset
 
- contains image files that are used by the 
+ 
+\change_deleted 232239728 1604794500
+c
+\change_inserted 232239728 1604794500
+C
+\change_unchanged
+ontains image files that are used by the 
 \begin_inset Flex Noun
 status collapsed
 
@@ -776,7 +914,13 @@ kbd/
 
 \end_inset
 
- contains keyboard keymapping files.
+ 
+\change_deleted 232239728 1604794505
+c
+\change_inserted 232239728 1604794505
+C
+\change_unchanged
+ontains keyboard keymapping files.
  See 
 \begin_inset CommandInset ref
 LatexCommand ref
@@ -798,7 +942,13 @@ layouts/
 
 \end_inset
 
- contains the text class and module files described in 
+ 
+\change_deleted 232239728 1604794508
+c
+\change_inserted 232239728 1604794508
+C
+\change_unchanged
+ontains the text class and module files described in 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "cha:Installing-New-Document"
@@ -819,7 +969,13 @@ lyx2lyx
 
 \end_inset
 
- contains the 
+ 
+\change_deleted 232239728 1604794513
+c
+\change_inserted 232239728 1604794513
+C
+\change_unchanged
+ontains the 
 \begin_inset Flex Code
 status collapsed
 
@@ -831,8 +987,11 @@ lyx2lyx
 
  Python scripts used to convert between \SpecialChar LyX
  versions.
- These can be run from the command line if, say, you want to batch-convert
- files.
+ These can be run from the command line if
+\change_deleted 232239728 1604794749
+, say,
+\change_unchanged
+ you want to batch-convert files.
 \end_layout
 
 \begin_layout Labeling
@@ -846,7 +1005,13 @@ scripts/
 
 \end_inset
 
- contains some files that demonstrate the capabilities of the 
+ 
+\change_deleted 232239728 1604794516
+c
+\change_inserted 232239728 1604794516
+C
+\change_unchanged
+ontains some files that demonstrate the capabilities of the 
 \begin_inset Flex Noun
 status collapsed
 
@@ -876,7 +1041,13 @@ templates/
 
 \end_inset
 
- contains the standard \SpecialChar LyX
+ 
+\change_deleted 232239728 1604794520
+c
+\change_inserted 232239728 1604794520
+C
+\change_unchanged
+ontains the standard \SpecialChar LyX
  template files described in 
 \begin_inset CommandInset ref
 LatexCommand ref
@@ -898,7 +1069,13 @@ ui/
 
 \end_inset
 
- contains files with the extension 
+ 
+\change_deleted 232239728 1604794524
+c
+\change_inserted 232239728 1604794524
+C
+\change_unchanged
+ontains files with the extension 
 \begin_inset Flex Code
 status collapsed
 
@@ -925,7 +1102,13 @@ xtemplates/
 
 \end_inset
 
- contains files with the extension 
+ 
+\change_deleted 232239728 1604794528
+c
+\change_inserted 232239728 1604794528
+C
+\change_unchanged
+ontains files with the extension 
 \begin_inset Flex Code
 status collapsed
 
@@ -968,7 +1151,13 @@ CREDITS
 
 \end_inset
 
- this file contains the list of \SpecialChar LyX
+ 
+\change_deleted 232239728 1604797616
+t
+\change_inserted 232239728 1604797616
+T
+\change_unchanged
+his file contains the list of \SpecialChar LyX
  developers.
  The contents are displayed with the menu entry 
 \begin_inset Flex Noun
@@ -999,7 +1188,13 @@ chkconfig.ltx
 
 \end_inset
 
- this is a \SpecialChar LaTeX
+ 
+\change_deleted 232239728 1604797620
+t
+\change_inserted 232239728 1604797620
+T
+\change_unchanged
+his is a \SpecialChar LaTeX
  script used during the configuration process.
  Do not run directly.
 \end_layout
@@ -1015,7 +1210,13 @@ configure.py
 
 \end_inset
 
- this is a Python script that is used to re-configure \SpecialChar LyX
+ 
+\change_deleted 232239728 1604797624
+t
+\change_inserted 232239728 1604797624
+T
+\change_unchanged
+his is a Python script that is used to re-configure \SpecialChar LyX
 .
  It creates configuration files in the directory it was run from.
 \end_layout
@@ -1035,7 +1236,13 @@ encodings
 
 \end_inset
 
- this contains tables describing how different character encodings can be
+ 
+\change_deleted 232239728 1604797580
+t
+\change_inserted 232239728 1604797580
+T
+\change_unchanged
+his contains tables describing how different character encodings can be
  mapped to Unicode
 \end_layout
 
@@ -1050,7 +1257,13 @@ languages
 
 \end_inset
 
- this file contains a list of all the languages currently supported by 
\SpecialChar LyX
+ 
+\change_deleted 232239728 1604797584
+t
+\change_inserted 232239728 1604797584
+T
+\change_unchanged
+his file contains a list of all the languages currently supported by 
\SpecialChar LyX
 .
 \end_layout
 
@@ -1065,7 +1278,13 @@ latexfonts
 
 \end_inset
 
- contains information about the supported fonts.
+ 
+\change_deleted 232239728 1604797587
+c
+\change_inserted 232239728 1604797587
+C
+\change_unchanged
+ontains information about the supported fonts.
 \end_layout
 
 \begin_layout Labeling
@@ -1079,8 +1298,14 @@ layouttranslations
 
 \end_inset
 
- this file contains translations for internationalized paragraph styles
- (see 
+ 
+\change_deleted 232239728 1604797591
+t
+\change_inserted 232239728 1604797591
+T
+\change_unchanged
+his file contains translations for internationalized paragraph styles (see
+ 
 \begin_inset CommandInset ref
 LatexCommand ref
 reference "subsec:I18n"
@@ -1101,8 +1326,14 @@ unicodesymbols
 
 \end_inset
 
- this file contains information about Unicode-encoded glyphs and the way
- they are supported by \SpecialChar LyX
+ 
+\change_deleted 232239728 1604797594
+t
+\change_inserted 232239728 1604797594
+T
+\change_unchanged
+his file contains information about Unicode-encoded glyphs and the way they
+ are supported by \SpecialChar LyX
  via \SpecialChar LaTeX
 .
 \end_layout
@@ -1277,10 +1508,19 @@ Settings
 \end_layout
 
 \begin_layout Itemize
-If you get some updated documentation from \SpecialChar LyX
- ftp site and cannot install
- it because you do not have sysadmin rights on your system, you can just
- copy the files in 
+If you get some updated documentation from
+\change_inserted 232239728 1604798171
+ a
+\change_unchanged
+ \SpecialChar LyX
+ ftp site and cannot install it because you do not have sysadmin rights
+ on your system, you can just copy the files 
+\change_deleted 232239728 1604798193
+in
+\change_inserted 232239728 1604798193
+to
+\change_unchanged
+ 
 \begin_inset Flex Code
 status collapsed
 
@@ -1311,8 +1551,11 @@ Running \SpecialChar LyX
 \begin_layout Standard
 The configuration freedom of the local configuration directory may not suffice
  if you want to have more than one configuration at your disposal.
- For example, you may want to be use different key bindings or printer settings
- at different times.
+ For example, you may want to 
+\change_deleted 232239728 1604798238
+be 
+\change_unchanged
+use different key bindings or printer settings at different times.
  You can achieve this by having several such directories.
  You then specify which directory to use at run-time.
 \end_layout
@@ -1348,8 +1591,11 @@ status collapsed
 
  switch.) If the specified directory does not exist, \SpecialChar LyX
  offers to create it
- for you, just like it does for the default directory on the first time
- you run the program.
+ for you, just like it does for the default directory 
+\change_deleted 232239728 1604798318
+on
+\change_unchanged
+ the first time you run the program.
  You can modify the configuration options in this additional user directory
  exactly as you would for the default directory.
  These directories are completely independent (but read on).
@@ -1358,7 +1604,7 @@ status collapsed
 status collapsed
 
 \begin_layout Plain Layout
-LYX_USERDIR_VER
+LYX_USERDIR_24x
 \end_layout
 
 \end_inset
@@ -1408,7 +1654,13 @@ Reconfigure
 
 \end_inset
 
-) which is configuration-specific.
+) which is configuration
+\change_deleted 232239728 1604798083
+-
+\change_inserted 232239728 1604798100
+ 
+\change_unchanged
+specific.
 \end_layout
 
 \begin_layout Chapter

commit 437fef65aa1862deb1f6337062cd44a1263d9073
Author: Yuriy Skalko <[email protected]>
Date:   Sun Nov 8 23:26:36 2020 +0200

    Simplify operator== for ParConstIterator
    
    Comment out it while it is unused.

diff --git a/src/ParIterator.cpp b/src/ParIterator.cpp
index 09cee80..7289889 100644
--- a/src/ParIterator.cpp
+++ b/src/ParIterator.cpp
@@ -134,14 +134,13 @@ ParagraphList const & ParConstIterator::plist() const
        return text()->paragraphs();
 }
 
+#if 0
 bool operator==(ParConstIterator const & iter1, ParConstIterator const & iter2)
 {
-       DocIterator const * dit1 = &iter1;
-       DocIterator const * dit2 = &iter2;
-       return *dit1 == *dit2;
+       return static_cast<DocIterator const &>(iter1) == 
static_cast<DocIterator const &>(iter2);
 }
 
-#if 0
+
 bool operator!=(ParConstIterator const & iter1, ParConstIterator const & iter2)
 {
        return !(iter1 == iter2);
diff --git a/src/ParIterator.h b/src/ParIterator.h
index e67732f..f1e2752 100644
--- a/src/ParIterator.h
+++ b/src/ParIterator.h
@@ -115,7 +115,7 @@ public:
        ParagraphList const & plist() const;
 };
 
-bool operator==(ParConstIterator const & it1, ParConstIterator const & it2);
+//bool operator==(ParConstIterator const & it1, ParConstIterator const & it2);
 
 //bool operator!=(ParConstIterator const & it1, ParConstIterator const & it2);
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Repository for new features
-- 
lyx-cvs mailing list
[email protected]
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to