On Sun, Feb 26, 2006 at 03:24:52PM +0100, Georg Baum wrote:
> Am Samstag, 25. Februar 2006 18:19 schrieb Martin Vermeer:

...

> > For blackboard bold R (real numbers) we have "\\mathbb R".
> 
> which is BTW valid TeX syntax.
> 
> > When you inspect the code handling this, more precisely
> > ControlMath::dispatchInsert, you see that there is no handling taking
> > place. And in math_nestinset's INSERT_MATH code, the R is silently
> > dropped.
> 
> Yes. This dropping occurs since this patch from you: 
> http://www.lyx.org/cgi-bin/viewcvs.cgi/lyx-devel/src/mathed/math_nestinset.C.diff?r1=1.148&r2=1.149
>  
> The attached file y.diff reverts the relevant part of the patch, so that 
> mathbb works again.

Yes... but now insertion of a decoration "around" selected math text
fails. The problem which this patch originally tried to fix.

I did some more research, and it appears that the underlying problem is
the following. Look at cursor.C:


void LCursor::niceInsert(MathAtom const & t)
    719 {
    720         macroModeClose();
    721         string const safe = lyx::cap::grabAndEraseSelection(*this);

        ...

    730                 paste(safe);
    731         }
    732 }

and

    393 void LCursor::paste(string const & data)
    394 {

    396         if (!data.empty())
    397                 dispatch(FuncRequest(LFUN_PASTE, data));
    398 }


The assumption here appears to be that the argument to give to the
LFUN_PASTE call is the _text_ to be pasted into the doc. Checking the
places where LFUN_PASTE is executed (i.e., text2.C and
math_nestinset.C), however, shows that the text to be pasted comes from
_buffer number_ n, an integer contained in the cmd.argument transferred.

So I believe there is a "thinko" here, which explains why the
selection disappears into the black hole and is never inserted -- at
least for math.

Do you agree?

- Martin

Attachment: pgpEen9CLmfRC.pgp
Description: PGP signature

Reply via email to