Re: [PATCH] use LyXText::dispatch() directly

2006-09-21 Thread Andre Poenitz
On Wed, Sep 20, 2006 at 10:42:37AM +0200, Abdelrazak Younes wrote: > >If you're there you can as well call the method a 'slot' and connect it > >to an, erm, 'signal'. > > I would be OK with that but only if we sanitize a bit how the lfun are > used. Emitting a dozen boost signal on a simple keyst

Re: [PATCH] use LyXText::dispatch() directly

2006-09-20 Thread Abdelrazak Younes
Andre Poenitz wrote: On Tue, Sep 19, 2006 at 10:30:11AM +0200, Abdelrazak Younes wrote: Unfortunately, there's no obvious better solution than these big, ugly switch statements. At least, not in C++. There is one elegant solution IMHO, array of function pointers. This would mean that each LFUN

Re: [PATCH] use LyXText::dispatch() directly

2006-09-19 Thread Andre Poenitz
On Tue, Sep 19, 2006 at 01:25:24AM +0100, Angus Leeming wrote: > Unfortunately, there's no obvious better solution than these big, ugly > switch statements. At least, not in C++. Well, dispatching an LFUN is basically triggering an action and there's no reason why action handling needs to be done

Re: [PATCH] use LyXText::dispatch() directly

2006-09-19 Thread Andre Poenitz
On Tue, Sep 19, 2006 at 10:30:11AM +0200, Abdelrazak Younes wrote: > >Unfortunately, there's no obvious better solution than these big, ugly > >switch statements. At least, not in C++. > > There is one elegant solution IMHO, array of function pointers. This > would mean that each LFUN (or a grou

Re: [PATCH] use LyXText::dispatch() directly

2006-09-19 Thread Abdelrazak Younes
Angus Leeming wrote: Abdelrazak Younes wrote: Andre Poenitz wrote: On Sun, Sep 17, 2006 at 10:03:33PM +0200, Abdelrazak Younes wrote: Code that is not understandable is bad and should be simplified. In addition, these changes would enable me to get rid of the LyXView dependency in BufferView.

Re: [PATCH] use LyXText::dispatch() directly

2006-09-18 Thread Angus Leeming
Abdelrazak Younes wrote: Andre Poenitz wrote: On Sun, Sep 17, 2006 at 10:03:33PM +0200, Abdelrazak Younes wrote: Code that is not understandable is bad and should be simplified. In addition, these changes would enable me to get rid of the LyXView dependency in BufferView. Check 'svn blame'.

Re: [PATCH] use LyXText::dispatch() directly

2006-09-18 Thread Abdelrazak Younes
Andre Poenitz wrote: On Mon, Sep 18, 2006 at 10:07:01AM +0200, Jean-Marc Lasgouttes wrote: "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: The dispatch function called is not the same dispatch function anymore. There might be a reason why we have decided to go through the top most

Re: [PATCH] use LyXText::dispatch() directly

2006-09-18 Thread Abdelrazak Younes
Andre Poenitz wrote: On Sun, Sep 17, 2006 at 10:03:33PM +0200, Abdelrazak Younes wrote: Code that is not understandable is bad and should be simplified. In addition, these changes would enable me to get rid of the LyXView dependency in BufferView. Check 'svn blame'. If it says 'poenitz' or su

Re: [PATCH] use LyXText::dispatch() directly

2006-09-18 Thread Andre Poenitz
On Sun, Sep 17, 2006 at 10:03:33PM +0200, Abdelrazak Younes wrote: > Code that is not understandable is bad and should be simplified. In > addition, these changes would enable me to get rid of the LyXView > dependency in BufferView. Check 'svn blame'. If it says 'poenitz' or such just apply your

Re: [PATCH] use LyXText::dispatch() directly

2006-09-18 Thread Andre Poenitz
On Mon, Sep 18, 2006 at 12:45:25PM +0200, Abdelrazak Younes wrote: > Jean-Marc Lasgouttes wrote: > >>"Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: > > > >Abdelrazak> Don't you think that this is a waste of CPU cycles? The > >Abdelrazak> update machinery is done anyway because th

Re: [PATCH] use LyXText::dispatch() directly

2006-09-18 Thread Andre Poenitz
On Sun, Sep 17, 2006 at 10:26:01PM +0200, Lars Gullik Bjønnes wrote: > Abdelrazak Younes <[EMAIL PROTECTED]> writes: > > | > The dispatch function called is not the same dispatch function > | > anymore. There might be a reason why we have decided to go through the > | > top most dispatch and let t

Re: [PATCH] use LyXText::dispatch() directly

2006-09-18 Thread Andre Poenitz
On Mon, Sep 18, 2006 at 10:07:01AM +0200, Jean-Marc Lasgouttes wrote: > > "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: > > >> The dispatch function called is not the same dispatch function > >> anymore. There might be a reason why we have decided to go through > >> the top mos

Re: [PATCH] use LyXText::dispatch() directly

2006-09-18 Thread Andre Poenitz
On Mon, Sep 18, 2006 at 01:18:24AM +0200, Lars Gullik Bjønnes wrote: > Yeah, but it also means that some LFUNS, if called from lyxtext must > still use bv.owner()->dispatch(...), else you will not be able to > reach all available LFUNS. Indeed. But the ones used there should. In theory at least.

Re: [PATCH] use LyXText::dispatch() directly

2006-09-18 Thread Abdelrazak Younes
Jean-Marc Lasgouttes wrote: "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: Abdelrazak> Don't you think that this is a waste of CPU cycles? The Abdelrazak> update machinery is done anyway because this Abdelrazak> LyXText::setLayout() method is called only twice in two Abdelrazak>

Re: [PATCH] use LyXText::dispatch() directly

2006-09-18 Thread Jean-Marc Lasgouttes
> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: Abdelrazak> Don't you think that this is a waste of CPU cycles? The Abdelrazak> update machinery is done anyway because this Abdelrazak> LyXText::setLayout() method is called only twice in two Abdelrazak> LFUNs in text3.C: LFUN_FL

Re: [PATCH] use LyXText::dispatch() directly

2006-09-18 Thread Abdelrazak Younes
Jean-Marc Lasgouttes wrote: "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: Abdelrazak> I know there could be potential problem but I have had a Abdelrazak> closed look at these lfuns one by one. We are talking here Abdelrazak> about simple editing lfun not something complicated.

Re: [PATCH] use LyXText::dispatch() directly

2006-09-18 Thread Abdelrazak Younes
Angus Leeming wrote: Abdelrazak Younes wrote: Could be a good idea. But and this is a big BUT, I'd argue that if an lfun needs to call another lfun, then that's a design problem. So if you prefer, I can rework my patch so that there is no dispatch call any more. That's certainly not true. Ma

Re: [PATCH] use LyXText::dispatch() directly

2006-09-18 Thread Jean-Marc Lasgouttes
> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: Abdelrazak> I know there could be potential problem but I have had a Abdelrazak> closed look at these lfuns one by one. We are talking here Abdelrazak> about simple editing lfun not something complicated. Yes, but in the future w

Re: [PATCH] use LyXText::dispatch() directly

2006-09-18 Thread Angus Leeming
Abdelrazak Younes wrote: Could be a good idea. But and this is a big BUT, I'd argue that if an lfun needs to call another lfun, then that's a design problem. So if you prefer, I can rework my patch so that there is no dispatch call any more. That's certainly not true. Many of the inset LFUNs a

Re: [PATCH] use LyXText::dispatch() directly

2006-09-18 Thread Abdelrazak Younes
Jean-Marc Lasgouttes wrote: "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: The dispatch function called is not the same dispatch function anymore. There might be a reason why we have decided to go through the top most dispatch and let that handle the traversement of the dispatch

Re: [PATCH] use LyXText::dispatch() directly

2006-09-18 Thread Abdelrazak Younes
Angus Leeming wrote: Abdelrazak Younes wrote: More seriously, why is it a problem? The dispatch hierarchy will inevitably end-up there so why not take the shortcut? IMHO the code looks a lot more cleaner this way. It may look cleaner to you, but now you're creating two ways to get to the sam

Re: [PATCH] use LyXText::dispatch() directly

2006-09-18 Thread Jean-Marc Lasgouttes
> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: >> The dispatch function called is not the same dispatch function >> anymore. There might be a reason why we have decided to go through >> the top most dispatch and let that handle the traversement of the >> dispatch hierarchy. A

Re: [PATCH] use LyXText::dispatch() directly

2006-09-17 Thread Lars Gullik Bjønnes
Abdelrazak Younes <[EMAIL PROTECTED]> writes: | Lars Gullik Bjønnes wrote: | > Abdelrazak Younes <[EMAIL PROTECTED]> writes: | > | > The dispatch function called is not the same dispatch function | > | > anymore. There might be a reason why we have decided to go through the | > | > top most dispat

Re: [PATCH] use LyXText::dispatch() directly

2006-09-17 Thread Angus Leeming
Abdelrazak Younes wrote: More seriously, why is it a problem? The dispatch hierarchy will inevitably end-up there so why not take the shortcut? IMHO the code looks a lot more cleaner this way. It may look cleaner to you, but now you're creating two ways to get to the same point. That's someth

Re: [PATCH] use LyXText::dispatch() directly

2006-09-17 Thread Abdelrazak Younes
Lars Gullik Bjønnes wrote: Abdelrazak Younes <[EMAIL PROTECTED]> writes: | > The dispatch function called is not the same dispatch function | > anymore. There might be a reason why we have decided to go through the | > top most dispatch and let that handle the traversement of the dispatch | > hi

Re: [PATCH] use LyXText::dispatch() directly

2006-09-17 Thread Lars Gullik Bjønnes
Abdelrazak Younes <[EMAIL PROTECTED]> writes: | > The dispatch function called is not the same dispatch function | > anymore. There might be a reason why we have decided to go through the | > top most dispatch and let that handle the traversement of the dispatch | > hierarchy. | | And what is tha

Re: [PATCH] use LyXText::dispatch() directly

2006-09-17 Thread Abdelrazak Younes
Lars Gullik Bjønnes wrote: Abdelrazak Younes <[EMAIL PROTECTED]> writes: | Hello, | | This patch makes LyXText code use directly LyXText::dispatch() instead | of the cur.bv().owner()->dispatch() redirection. | | Objection? | | Abdel. | Index: text2.C | ==

Re: [PATCH] use LyXText::dispatch() directly

2006-09-17 Thread Lars Gullik Bjønnes
Abdelrazak Younes <[EMAIL PROTECTED]> writes: | Hello, | | This patch makes LyXText code use directly LyXText::dispatch() instead | of the cur.bv().owner()->dispatch() redirection. | | Objection? | | Abdel. | Index: text2.C | === |

Re: [PATCH] use LyXText::dispatch() directly

2006-09-17 Thread Abdelrazak Younes
Lars Gullik Bjønnes wrote: Abdelrazak Younes <[EMAIL PROTECTED]> writes: | Hello, | | This patch makes LyXText code use directly LyXText::dispatch() instead | of the cur.bv().owner()->dispatch() redirection. | | Objection? Is it guaranteed that 'this' is equal to 'bv.owner()'? How is that g

Re: [PATCH] use LyXText::dispatch() directly

2006-09-17 Thread Lars Gullik Bjønnes
Abdelrazak Younes <[EMAIL PROTECTED]> writes: | Hello, | | This patch makes LyXText code use directly LyXText::dispatch() instead | of the cur.bv().owner()->dispatch() redirection. | | Objection? Is it guaranteed that 'this' is equal to 'bv.owner()'? How is that guarantee forced? --

[PATCH] use LyXText::dispatch() directly

2006-09-17 Thread Abdelrazak Younes
Hello, This patch makes LyXText code use directly LyXText::dispatch() instead of the cur.bv().owner()->dispatch() redirection. Objection? Abdel. Index: text2.C === --- text2.C (revision 15030) +++ text2.C (working copy) @