+ os << bformat(_("Macro: %1$s"), name());
+}
+
+
+bool MathMacro::completionSupported(Cursor const & cur) const
+{
+ if (displayMode() != DISPLAY_UNFOLDED)
+ return InsetMathNest::completionSupported(cur);
+
+ return lyxrc.completion_popup_math
+ && displayMode() == DISPLAY_UNFOLDED
+ && cur.bv().cursor().pos() == int(name().size());
+}
+
+
+bool MathMacro::inlineCompletionSupported(Cursor const & cur) const
+{
+ if (displayMode() != DISPLAY_UNFOLDED)
+ return InsetMathNest::inlineCompletionSupported(cur);
+
+ return lyxrc.completion_inline_math
+ && displayMode() == DISPLAY_UNFOLDED
+ && cur.bv().cursor().pos() == int(name().size());
+}
+
+
+bool MathMacro::automaticInlineCompletion() const
+{
+ if (displayMode() != DISPLAY_UNFOLDED)
+ return InsetMathNest::automaticInlineCompletion();
+
+ return lyxrc.completion_inline_math;
+}
+
+
+bool MathMacro::automaticPopupCompletion() const
+{
+ if (displayMode() != DISPLAY_UNFOLDED)
+ return InsetMathNest::automaticPopupCompletion();
+
+ return lyxrc.completion_popup_math;
+}
+
+
+CompletionList const *
+MathMacro::createCompletionList(Cursor const & cur) const
+{
+ if (displayMode() != DISPLAY_UNFOLDED)
+ return InsetMathNest::createCompletionList(cur);
+
+ return new MathCompletionList(cur.bv().cursor());
+}
+
+
+docstring MathMacro::completionPrefix(Cursor const & cur) const
+{
+ if (displayMode() != DISPLAY_UNFOLDED)
+ return InsetMathNest::completionPrefix(cur);