Am Samstag, 25. Februar 2006 18:19 schrieb Martin Vermeer:
> First of all, the bug is unrelated to text->math conversion. You should
> look at ControlMath.C. There, the command texts associated with each
> symbol in the math symbol panels, executed when clicking on them, are
> defined.
> 
> 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.

> I have a vivid recollection that there was code handling this kind of
> command string. Splitting up the string and submitting the two
> separately to dispatchFunc. Moreover, I have a strong recollection that
> I wrote both this code and introduced the command syntax it handles... 
> 
> Angus is marked as being to 'blame' for this part of the code, but that
> proves little for deletion of code. Somebody decided to do a little
> clean-up job on code he didn't understand... nice.
> 
> The eerily familiar looking, reconstructed code that fixes the bug is
> attached.

I did search a bit, and AFAICS code that splits up stuff coming from the 
frontend and creates two dispatch requests has never been in LyX.
Your fix is IMO wrong, since \mathbb R is valid TeX code and therefore 
must be handled by LFUN_INSERT_MATH as is. No splitting should be 
required.
The right fix is IMO to pass the whole MathArray to handleNest and not 
only ar[0] in NathNestInset::doDispatch(), but I don't know how that 
would look exactly or if it is possible at all.


Georg
Index: src/mathed/math_nestinset.C
===================================================================
--- src/mathed/math_nestinset.C	(Revision 13276)
+++ src/mathed/math_nestinset.C	(Arbeitskopie)
@@ -890,10 +890,12 @@ void MathNestInset::doDispatch(LCursor &
 			cell = 1;
 		// math macros are nest insets and may have 0 cells.
 		// handleNest would crash in this case.
+#if 0
 		if (ar.size() == 1 && (ar[0].nucleus()->asNestInset()) &&
 		    ar[0].nucleus()->nargs() > MathInset::idx_type(cell)) {
 			cur.handleNest(ar[0], cell);
 		} else
+#endif
 			cur.niceInsert(cmd.argument);
 		break;
 		}

Reply via email to