Stefan Schimanski schrieb:

The word list is in 1.5 available as well. You have to apply the patch though from some days ago to make it accessible. In 1.5 the math command list is private to the MathFactory file.

The part with the macros does not work. But you can easily remove that case in the if clause.

Like the attached patch that works fine here?

regards Uwe
Index: InsetMathNest.cpp
===================================================================
--- InsetMathNest.cpp	(revision 23288)
+++ InsetMathNest.cpp	(working copy)
@@ -1253,7 +1253,11 @@
 			return true;
 		}
 
-		if (isAlphaASCII(c)) {
+		// do not finish macro for known * commands
+		WordList const & mwl = mathedWordList();
+		bool star_macro = c == '*'
+			&& (mwl.find(name.substr(1) + "*") != mwl.end());
+		if (isAlphaASCII(c) || star_macro) {
 			cur.activeMacro()->setName(name + docstring(1, c));
 			return true;
 		}
Index: MathFactory.cpp
===================================================================
--- MathFactory.cpp	(revision 23288)
+++ MathFactory.cpp	(working copy)
@@ -79,9 +79,6 @@
 
 namespace {
 
-// file scope
-typedef std::map<docstring, latexkeys> WordList;
-
 WordList theWordList;
 
 
@@ -233,7 +230,13 @@
 
 } // namespace anon
 
+ 
+WordList const & mathedWordList()
+{
+	return theWordList;
+}
 
+
 void initMath()
 {
 	static bool initialized = false;
Index: MathFactory.h
===================================================================
--- MathFactory.h	(revision 23288)
+++ MathFactory.h	(working copy)
@@ -12,9 +12,15 @@
 #ifndef MATH_FACTORY_H
 #define MATH_FACTORY_H
 
+#include <map>
+
+#include "MathParser.h"
+
 #include "support/docstring.h"
 #include <string>
 
+using std::map;
+
 namespace lyx {
 
 class MathAtom;
@@ -30,6 +36,8 @@
  */
 bool createInsetMath_fromDialogStr(docstring const &, MathData &);
 
+typedef map<docstring, latexkeys> WordList;
+WordList const & mathedWordList();
 
 } // namespace lyx
 

Reply via email to