emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: isearch highlighting


From: Stefan Monnier
Subject: Re: isearch highlighting
Date: Thu, 09 Dec 2004 22:21:16 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

> I think it is safe to put the body of `isearch-lazy-highlight-update'
> in the `with-local-quit' block, because quit in this function can't
> lead to a corrupted state.

Agreed.  I'd even put it in `while-no-input'.  You might want to add the
patch below, tho, just so the code can't be interrupted after placing the
new overlay but before it's recorded on the list.  There might be other
similar issues, I haven't checked.

> It seems this change is unrelated to the
> proposed solution of a new form of really hard C-g (which is useful to
> interrupt the code which can put the process in a corrupted state).

Of course.  The idea of a "really hard C-g" is to work around problems,
but it should not be an excuse to not fix those problems.

> because most regexp in Emacs packages are well tested and contains no
> nested repetitions.

Is that an attempt at humor?


        Stefan


--- orig/lisp/isearch.el
+++ mod/lisp/isearch.el
@@ -2480,10 +2480,10 @@
 
                     ;; non-zero-length match
                     (let ((ov (make-overlay mb me)))
+                      (push ov isearch-lazy-highlight-overlays)
                       (overlay-put ov 'face isearch-lazy-highlight-face)
                       (overlay-put ov 'priority 0) ;lower than main overlay
-                      (overlay-put ov 'window (selected-window))
-                      (push ov isearch-lazy-highlight-overlays)))
+                      (overlay-put ov 'window (selected-window))))
                   (if isearch-forward
                       (setq isearch-lazy-highlight-end (point))
                     (setq isearch-lazy-highlight-start (point)))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]