+MathClass MathMacro::mathClass() const
+{
+ // This can be just a heuristic, since it is only considered for display
+ // when the macro is not linearised. Therefore it affects:
+ // * The spacing of the inset while being edited,
+ // * Intelligent splitting
+ // * Cursor word movement (Ctrl-Arrow).
+ if (MacroData const * m = macroBackup()) {
+ // If it is a global macro and is defined explicitly
+ if (m->symbol()) {
+ MathClass mc = string_to_class(m->symbol()->extra);
+ if (mc != MC_UNKNOWN)
+ return mc;
+ }
+ }
+ // Otherwise guess from the expanded macro
+ return d->expanded_.mathClass();
+}
+
+