Hi!I have spent the day to reimplement the macro system. The result cleans up a lot of hacks. The main feature is that macros are now buffer local and they are aware of the position in the buffer, i.e. they are only visible (and therefore resolve/expand) after they have been defined. It also includes the changes from my proposal some days ago. According to http://wiki.lyx.org/Devel/Macros the following use cases are possible then:
* Redefine a macro to use the same macro name with different definitions in different areas of the document. * Have \newcommand in the preamble (i.e. by importing tex code), and then define the command as a native lyx math macro. All the uses of the old command should then turn into instances of the lyx math macro. * Using macros with the same name, but different definitions in different open documents.
* Using macros from the master document, even overwrite them. Also the following bugs would be addressed by it:http://bugzilla.lyx.org/show_bug.cgi?id=1454 math-macro / newcommand with same name appearing in multiple documents become mixed up
http://bugzilla.lyx.org/show_bug.cgi?id=2176 Math macros not recognized unless LyX-file containing the macro definition is loaded first.
Schimmi
dynamicmacros.patch
Description: Binary data
PGP.sig
Description: Signierter Teil der Nachricht
