Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-10 Thread Jean-Marc Lasgouttes
> "José" == José Matos <[EMAIL PROTECTED]> writes: José> On Monday 09 July 2007 18:12:48 Bo Peng wrote: >> Jose, if you can not decide, just toss a coin. IMO, both approaches >> are good enough. :-) José> OK then, let us go Jean-Marc's way, and proceed for other more José> pressing issues.

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-10 Thread Jean-Marc Lasgouttes
> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: >> OK then, let us go Jean-Marc's way, and proceed for other more >> pressing issues. Abdelrazak> I could have bet you would say this. Yes, I secretly promised him an all-you-can-eat smorgasbord of beer and cucumber for the next

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-10 Thread Abdelrazak Younes
José Matos wrote: On Monday 09 July 2007 18:12:48 Bo Peng wrote: Jose, if you can not decide, just toss a coin. IMO, both approaches are good enough. :-) OK then, let us go Jean-Marc's way, and proceed for other more pressing issues. I could have bet you would say this. Abdel.

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-10 Thread José Matos
On Monday 09 July 2007 18:12:48 Bo Peng wrote: > Jose, if you can not decide, just toss a coin. IMO, both approaches > are good enough. :-) OK then, let us go Jean-Marc's way, and proceed for other more pressing issues. > Bo In this issue I feel like Golan Trevize: http://en.wikipedia.org/wik

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-09 Thread Abdelrazak Younes
Jean-Marc Lasgouttes wrote: "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: Abdelrazak> I don't think so: we can augment Bo's patch in Text3.cpp Abdelrazak> like this: Abdelrazak> + // if this LFUN will clear selection, saveSelection for Abdelrazak> persistent + // selection + if

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-09 Thread Bo Peng
this handle the case of buffer-next/previous (ctrl-page up/down), which Bo missed. Besides the fact that adding the SaveSelection flag is easy, I guess you can see why this is error prone... I admit that I did not go through the LFUN carefully. I planned to do so after my approach is agreed upo

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-09 Thread Jean-Marc Lasgouttes
> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: Abdelrazak> FWIW I agree with Bo. The reason why I like it more is Abdelrazak> that Bo's approach will allow us to remove some more code Abdelrazak> (selHandle, etc). >> >> I am not 100% sure with that. Abdelrazak> I was talking

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-09 Thread Jean-Marc Lasgouttes
> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: Abdelrazak> I don't think so: we can augment Bo's patch in Text3.cpp Abdelrazak> like this: Abdelrazak> + // if this LFUN will clear selection, saveSelection for Abdelrazak> persistent + // selection + if Abdelrazak> (lyxaction.f

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-09 Thread Jean-Marc Lasgouttes
> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: Abdelrazak> The patch is shorter yes but I don't think the final code Abdelrazak> will be shorter. No, but it is less complex IMO. >> Here is what I came up with. Note that now saveSelection does its >> job only if cursor is act

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-09 Thread Abdelrazak Younes
Jean-Marc Lasgouttes wrote: "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: Abdelrazak> FWIW I agree with Bo. The reason why I like it more is Abdelrazak> that Bo's approach will allow us to remove some more code Abdelrazak> (selHandle, etc). I am not 100% sure with that. I was

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-09 Thread Abdelrazak Younes
Jean-Marc Lasgouttes wrote: "Bo" == Bo Peng <[EMAIL PROTECTED]> writes: Concerning your approach, many things are still missing (IMO of course). For example, self-insert will replace the selection if there is one, so you should save the selection. Bo> This is expected, and can be solved easi

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-09 Thread Jean-Marc Lasgouttes
> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: Abdelrazak> FWIW I agree with Bo. The reason why I like it more is Abdelrazak> that Bo's approach will allow us to remove some more code Abdelrazak> (selHandle, etc). I am not 100% sure with that. In particular, one thing I would

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-09 Thread Jean-Marc Lasgouttes
> "Bo" == Bo Peng <[EMAIL PROTECTED]> writes: >> Concerning your approach, many things are still missing (IMO of >> course). For example, self-insert will replace the selection if >> there is one, so you should save the selection. Bo> This is expected, and can be solved easily by adding SaveS

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-09 Thread Abdelrazak Younes
Bo Peng wrote: Concerning your approach, many things are still missing (IMO of course). For example, self-insert will replace the selection if there is one, so you should save the selection. This is expected, and can be solved easily by adding SaveSelection flag to this LFUN. The advantage of m

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-09 Thread Abdelrazak Younes
Bo Peng wrote: I think I prefer the LFUN based solution as it is more systematic. But at the same time why keep Cursor::selHandle() if we do that? I tried a little bit but while my patch is pretty straightforward and safe, moving or deleting selHandle seems to be too dangerous to be done right

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-09 Thread Bo Peng
Concerning your approach, many things are still missing (IMO of course). For example, self-insert will replace the selection if there is one, so you should save the selection. This is expected, and can be solved easily by adding SaveSelection flag to this LFUN. The advantage of my patch is that

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-09 Thread Jean-Marc Lasgouttes
> "Bo" == Bo Peng <[EMAIL PROTECTED]> writes: >> I think I prefer the LFUN based solution as it is more systematic. >> But at the same time why keep Cursor::selHandle() if we do that? Bo> I tried a little bit but while my patch is pretty straightforward Bo> and safe, moving or deleting selHan

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-09 Thread Bo Peng
I think I prefer the LFUN based solution as it is more systematic. But at the same time why keep Cursor::selHandle() if we do that? I tried a little bit but while my patch is pretty straightforward and safe, moving or deleting selHandle seems to be too dangerous to be done right now. Of course,

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-06 Thread Abdelrazak Younes
Bo Peng wrote: Abdel: Attached are two patches. They all enable persistent selection and fixes 3877. 3877-Bo adds flag SaveSelection to all LFUN, and 3877-JM calls SaveSelection at selHandle, cutSelection, MOUSE_PRESS, and a few DELETE lfuncs. Both patches should have caught 99%, if not 100%, ca

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-06 Thread Jean-Marc Lasgouttes
On Fri, 6 Jul 2007 15:41:45 -0500, "Bo Peng" <[EMAIL PROTECTED]> wrote: > Abdel: > > Attached are two patches. They all enable persistent selection and > fixes 3877. 3877-Bo adds flag SaveSelection to all LFUN, and 3877-JM > calls SaveSelection at selHandle, cutSelection, MOUSE_PRESS, and a few >

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-06 Thread Bo Peng
Abdel: Attached are two patches. They all enable persistent selection and fixes 3877. 3877-Bo adds flag SaveSelection to all LFUN, and 3877-JM calls SaveSelection at selHandle, cutSelection, MOUSE_PRESS, and a few DELETE lfuncs. Both patches should have caught 99%, if not 100%, cases when selecti

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-06 Thread Bo Peng
OK, here is my own version of Bo's patch. I removed the ClearSelection flag, and did the call to haveSelection in LyXFunc::dispatch (it seems to me that this does not cost much, right). This allows to remove a lot of code. I applied 90% of your patch, which clears all saveSelection calls. On the

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-06 Thread Bo Peng
Does it make sense? Yes. I have not looked closely at selHandle but if it can catch many cases, it is good. I also agree that it should be moved to bufferview. The only problem is that I am not sure if I can finish JMarc's idea and finish the patch before 1.5.0 You know, my ClearSelection (

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-06 Thread Jean-Marc Lasgouttes
> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: >> To continue the selHandle idea, with the following patch (I did not >> move yet to bufferview), we would avoid most of the explicit calls >> to haveSelection in Bo's patch. Abdelrazak> All I can say is that it needs careful te

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-06 Thread Abdelrazak Younes
Jean-Marc Lasgouttes wrote: "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: then I guess selHandle could be moved to BufferView (or bufferview_funcs). Abdelrazak> Could work. One way of interpreting me discussion about selHandle is that we may be able to remove it and replace

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-06 Thread Jean-Marc Lasgouttes
> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: >> then I guess selHandle could be moved to BufferView (or >> bufferview_funcs). Abdelrazak> Could work. One way of interpreting me discussion about selHandle is that we may be able to remove it and replace by ClearSelection/Sta

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-06 Thread Abdelrazak Younes
Jean-Marc Lasgouttes wrote: "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: Abdelrazak> Jean-Marc Lasgouttes wrote: selHandle is not the same as clearing selection on a cursor. It is a tool used in Text3.cpp for lfuns that may begin a selection or terminate one (does that ring a

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-06 Thread Jean-Marc Lasgouttes
> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: Abdelrazak> Jean-Marc Lasgouttes wrote: >> selHandle is not the same as clearing selection on a cursor. It is >> a tool used in Text3.cpp for lfuns that may begin a selection or >> terminate one (does that ring a bell?). Abdelraz

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-06 Thread Abdelrazak Younes
Jean-Marc Lasgouttes wrote: "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: A question though: how does this relates to selHandle? Abdelrazak> selHandle() is a member of Cursor and we need something Abdelrazak> BufferView dependent. If what you mean is that there is a risk of

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-06 Thread Jean-Marc Lasgouttes
> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: >> A question though: how does this relates to selHandle? Abdelrazak> selHandle() is a member of Cursor and we need something Abdelrazak> BufferView dependent. If what you mean is that there is a risk of calling selHandle on a c

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-06 Thread Abdelrazak Younes
Jean-Marc Lasgouttes wrote: selHandle is not the same as clearing selection on a cursor. It is a tool used in Text3.cpp for lfuns that may begin a selection or terminate one (does that ring a bell?). Yes but I am afraid of consecutive call from different Cursors in different LFUNs. The Cursor

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-06 Thread Jean-Marc Lasgouttes
> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: >> This is not a bad idea indeed. Abdelrazak> Translation for non-native French speakers: this is a Abdelrazak> _good_ idea ;-) Yes, but I think that it double with selHandle. >> A question though: how does this relates to selH

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-06 Thread Abdelrazak Younes
Jean-Marc Lasgouttes wrote: "Bo" == Bo Peng <[EMAIL PROTECTED]> writes: Bo> The attached patch is a much improved version of my previous Bo> patch. The biggest change is that I add a ClearSelection flag to Bo> each LFUN and call saveSelection accordingly. This version also Bo> has Abdel's fix f

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-06 Thread Jean-Marc Lasgouttes
> "Bo" == Bo Peng <[EMAIL PROTECTED]> writes: Bo> The attached patch is a much improved version of my previous Bo> patch. The biggest change is that I add a ClearSelection flag to Bo> each LFUN and call saveSelection accordingly. This version also Bo> has Abdel's fix for mathed, table, window

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-05 Thread Bo Peng
I like it Bo, Good idea! OK from me. Anyone else? JMarc? Bo

Re: [Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-05 Thread Abdelrazak Younes
Bo Peng wrote: The attached patch is a much improved version of my previous patch. The biggest change is that I add a ClearSelection flag to each LFUN and call saveSelection accordingly. This version also has Abdel's fix for mathed, table, window switch etc. The patch itself is now easy: 1. rem

[Updated PATCH] 3877:Highlighting text slows down LyX extremely

2007-07-05 Thread Bo Peng
The attached patch is a much improved version of my previous patch. The biggest change is that I add a ClearSelection flag to each LFUN and call saveSelection accordingly. This version also has Abdel's fix for mathed, table, window switch etc. The patch itself is now easy: 1. remove all previous