On Thu, Apr 28, 2005 at 10:59:52PM +0200, Uwe Stöhr wrote:
> Martin Vermeer wrote:
> 
> >> There's still some fun available on bugzilla.
> 
> > Gimme a number, any number...
> 
> Ok, if you shout so loud ;-), I have one:
> 
> http://bugzilla.lyx.org/show_bug.cgi?id=1435
> 
> It's my favourite bug.

Hmmm, it's not a bug as much as a misfeature. This should be discussed.

The relevant code is here (math_nestinset.C):

---
        case LFUN_MATH_MODE:
#if 1
                // ignore math-mode on when already in math mode
                if (currentMode() == InsetBase::MATH_MODE && cmd.argument == 
"on")
                        break;
                cur.macroModeClose();
                selClearOrDel(cur);
                //cur.plainInsert(MathAtom(new MathMBoxInset(cur.bv())));
                cur.plainInsert(MathAtom(new MathBoxInset("mbox")));
                cur.posLeft();
                cur.pushLeft(*cur.nextInset());
#else
                if (currentMode() == InsetBase::TEXT_MODE) {
                        cur.niceInsert(MathAtom(new MathHullInset("simple")));
                        cur.message(_("create new math text environment 
($...$)"));
                } else {
                        handleFont(cur, cmd.argument, "textrm");
                        cur.message(_("entered math text mode (textrm)"));
                }
#endif
                break;
---

both the old (#else...#endif) and the currently active.

LFUN_MATH_MODE is overloaded to produce an mbox inset when pressing C-m
inside math mode. (This sends an LFUN_MATH_MODE *without* the "on"
argument. [BTW has classic.ui been updated?]) In text mode it inserts a 
simple math inset ($...$).

Now rather than fixing the bug, we should have a philosophical
discussion ;-)

1) Do we want C-m to be overloaded this way?
2) Do we want it to be easy to produce an mbox inset (or a textrm)
inside math, when we know that this will trip us up (and inexperienced
users even more so): it is all too easy in LyX to put math objects like 
subscripts into such an mbox, which will produce a LaTeX error.
3) On the other hand, we should be able to easily insert text strings into 
math objects as they are often needed. These should be able to contain
non-usascii chars like öäå, which rules out \mathrm.

Any takers?
 
- Martin

Attachment: pgpcTNhW6HJP0.pgp
Description: PGP signature

Reply via email to