emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/isearch-mb ba14991cb8: Set lazy-highlight-buffer global


From: ELPA Syncer
Subject: [elpa] externals/isearch-mb ba14991cb8: Set lazy-highlight-buffer globally
Date: Sat, 10 Sep 2022 08:57:56 -0400 (EDT)

branch: externals/isearch-mb
commit ba14991cb81c4fad8e5db54d5233322905a1e3f3
Author: Augusto Stoffel <arstoffel@gmail.com>
Commit: Augusto Stoffel <arstoffel@gmail.com>

    Set lazy-highlight-buffer globally
    
    In the previous approach, the variable was set too late, so the first
    round of lazy highlighting could be incorrect in certain commands such
    as isearch-symbol-at-point.
---
 isearch-mb.el | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/isearch-mb.el b/isearch-mb.el
index eae2e3d723..566b8f8ea9 100644
--- a/isearch-mb.el
+++ b/isearch-mb.el
@@ -225,11 +225,6 @@ minibuffer."
                    ;; count, so we need this as a workaround.
                    ((symbol-function #'isearch-message) 
#'isearch-mb--update-prompt)
                    (minibuffer-default-add-function #'isearch-mb--add-defaults)
-                   ;; We need to set `inhibit-redisplay' at certain points to
-                   ;; avoid flicker.  As a side effect, window-start/end in
-                   ;; `isearch-lazy-highlight-update' will have incorrect 
values,
-                   ;; so we need to lazy-highlight the whole buffer.
-                   (lazy-highlight-buffer (not (null isearch-lazy-highlight)))
                    (wstart nil))
            (minibuffer-with-setup-hook
                (lambda ()
@@ -275,9 +270,19 @@ minibuffer."
 During an isearch-mb session, the following keys are available:
 \\{isearch-mb-minibuffer-map}"
   :global t
-  (if isearch-mb-mode
-      (add-hook 'isearch-mode-hook #'isearch-mb--setup)
-    (remove-hook 'isearch-mode-hook #'isearch-mb--setup)))
+  (cond
+   (isearch-mb-mode
+    (put 'lazy-highlight-buffer 'isearch-mb--saved (default-value 
'lazy-highlight-buffer))
+    ;; We need to lazy-highlight the whole buffer for two reasons.
+    ;; First, scrolling during a search is allowed.  Second, we enable
+    ;; `inhibit-redisplay' at certain points to avoid flicker, so the
+    ;; window-{start,end} values in `isearch-lazy-highlight-update'
+    ;; are unreliable
+    (setq-default lazy-highlight-buffer t)
+    (add-hook 'isearch-mode-hook #'isearch-mb--setup))
+   (t
+    (setq-default lazy-highlight-buffer (get 'lazy-highlight-buffer 
'isearch-mb--saved))
+    (remove-hook 'isearch-mode-hook #'isearch-mb--setup))))
 
 (provide 'isearch-mb)
 ;;; isearch-mb.el ends here



reply via email to

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