]> git.eshelyaron.com Git - emacs.git/commitdiff
Make minibuffer lazy highlight setup buffer-local where appropriate
authorAugusto Stoffel <arstoffel@gmail.com>
Sat, 14 May 2022 15:21:27 +0000 (17:21 +0200)
committerJuri Linkov <juri@linkov.net>
Sun, 15 May 2022 18:44:53 +0000 (21:44 +0300)
* lisp/isearch.el (minibuffer-lazy-highlight-setup): Modify hooks
buffer-locally, so that recursive minibuffers are not affected by the
special behavior of lazy-highlight.  Also make
'isearch-filter-predicate' buffer-local, so that isearch in the
minibuffer is not affected by the region filter (bug#55110).

lisp/isearch.el

index 96168f94bd5b7076e2dd75401e204d8991781537..3e1dab4d15d59379bacae895b177b39eb61afe76 100644 (file)
@@ -4441,12 +4441,13 @@ LAX-WHITESPACE: The value of `isearch-lax-whitespace' and
                                 (format minibuffer-lazy-count-format
                                         isearch-lazy-count-total)))))
       (lambda ()
-        (add-hook 'minibuffer-exit-hook unwind)
-        (add-hook 'after-change-functions after-change)
+        (add-hook 'minibuffer-exit-hook unwind nil t)
+        (add-hook 'after-change-functions after-change nil t)
         (when minibuffer-lazy-count-format
           (setq overlay (make-overlay (point-min) (point-min) (current-buffer) t))
           (add-hook 'lazy-count-update-hook display-count))
         (when filter
+          (make-local-variable 'isearch-filter-predicate)
           (add-function :after-while isearch-filter-predicate filter))
         (funcall after-change nil nil nil)))))