Hi all,

I just updated my previous patch that allows to abort a long Advanced F&R operation to the trunk of 1 or 2 days ago:

  http://www.lyx.org/trac/attachment/ticket/7217/lyx-findadv-abort.patch

This works by "polling" the GUI events and, if the ESC key was pressed, abort it (with some msg going to the status bar). To this purpose, there's a small addition to Application.h and GuiApplication.cpp, as I need to "poll" the GUI for key presses from the model while it is searching. The user cannot interact with LyX anyway during this time, nor he/she can edit anything.

As there was some discussion about this, let me gather feedback from the list: a) it was proposed (vfr) to move to a threaded implementation of the Advanced F&R, so that it can progress in the background; b) it was proposed to have the Advanced F&R go on in the background anyway, in such a way that we can search for more and more hits, and highlight all of the visible ones someway on the GUI (a'la Firefox search bar, AFAICR); c) long ago it was proposed to rewrite entirely this feature without basing it on latex/text exporting, as it is now.

For a), I'm scared about the impact and possible concurrency issues & the like (especially if we allow users to keep editing while performing the long search in the background), so my estimate is that such a change would not be easy. For b), it is somewhat in "collision" with the patch I'm proposing, however I think b) also requires some non-trivial GUI-related effort and some reworking of the Advanced F&R dispatching logic. For c), it's a complete rewrite, so I'm not considering it for now :-).

Due to these considerations, I still think the proposed patch is the easiest thing, that it adds something useful, makes LyX (and this particular new feature) more usable, given the *current* way it works, and the user less bored (in case he/she tries a regexp search without ignore format over a very long document) and it's already there :-). So, I would strongly suggest it for branch 2.0.x, as well as for 2.1.0.

Later, if we want to try something more elaborated for 2.1.0, that is not precluded.

Comments welcome, thanks.

    T.

Reply via email to