"Leuven, E." <[EMAIL PROTECTED]> writes: > Abdelrazak Younes wrote: >> We have this discussion every once in a while... I strongly believe >> on the contrary that the multiple level of dispatch() is very, *very* >> wrong. LyXFunc::dispatch() calling Cursor::dispatch() calling >> Text::dispatch() calling Cursor::dispatch() calling >> LyXFunc::dispatch() calling Cursor::dispatch() calling >> Text::dispatch() to end up in the same Text at the end... talk about >> efficiency...
I do not think that efficiency is a real issue in this. But how do we make sure that haveSelection is handled properly? How do we maje sure that the document is marked dirty as needed? How do we make sure that dispatch does nothing (instead of crashing maybe) when it is in a situation where the lfun should do nothing. We do not have any reason to believe that this really slows down LyX, do we? > and there is also the issue of transparency (if i may chime in...) You may, of course. Hello Edwin :) I really think that things are easier of one just invokes lyx:dispatch and is assured that it does the right thing. We had (have?) many bugs due to someone calling Text::dispatch with the wrong Text object (but only in some weird cases that may be difficult to understand, to make things funnier). Actually, I prefer to call the relevant function directly in this case, unless one has a strong reason to use an LFUN. If the message you want to convey is "I do as if the LFUN foo has been invoked", then really invoke it. JMarc