emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master c5e66af: * lisp/isearch.el (isearch-lazy-highlight


From: Juri Linkov
Subject: [Emacs-diffs] master c5e66af: * lisp/isearch.el (isearch-lazy-highlight): New choice ‘all-windows’.
Date: Tue, 21 Feb 2017 19:10:45 -0500 (EST)

branch: master
commit c5e66afa88d6ff8ad5c42318d85188ed477e7db2
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>

    * lisp/isearch.el (isearch-lazy-highlight): New choice ‘all-windows’.
    
    (isearch-lazy-highlight-update): Check it to decide whether to apply
    overlays only on the selected window.
    
    * lisp/follow.el (follow-mode): Set isearch-lazy-highlight to ‘all-windows’.
    (Bug#17453, bug#21092)
---
 lisp/follow.el  |  3 +++
 lisp/isearch.el | 14 ++++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/lisp/follow.el b/lisp/follow.el
index 3ad4f10..db3b282 100644
--- a/lisp/follow.el
+++ b/lisp/follow.el
@@ -427,6 +427,9 @@ Keys specific to Follow mode:
         (add-hook 'replace-update-post-hook 'follow-post-command-hook nil t)
         (add-hook 'ispell-update-post-hook 'follow-post-command-hook nil t)
 
+        (when isearch-lazy-highlight
+          (setq-local isearch-lazy-highlight 'all-windows))
+
         (setq window-group-start-function 'follow-window-start)
         (setq window-group-end-function 'follow-window-end)
         (setq set-window-group-start-function 'follow-set-window-start)
diff --git a/lisp/isearch.el b/lisp/isearch.el
index d0fb15e..699d6ea 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -285,8 +285,13 @@ are `word-search-regexp' \(`\\[isearch-toggle-word]'), 
`isearch-symbol-regexp'
   "Controls the lazy-highlighting during incremental search.
 When non-nil, all text in the buffer matching the current search
 string is highlighted lazily (see `lazy-highlight-initial-delay'
-and `lazy-highlight-interval')."
-  :type 'boolean
+and `lazy-highlight-interval').
+
+When multiple windows display the current buffer, the
+highlighting is displayed only on the selected window, unless
+this variable is set to the symbol `all-windows'."
+  :type '(choice boolean
+                 (const :tag "On, and applied to all windows" all-windows))
   :group 'lazy-highlight
   :group 'isearch)
 
@@ -3298,8 +3303,9 @@ Attempt to do the search exactly the way the pending 
Isearch would."
                          ;; 1000 is higher than ediff's 100+,
                          ;; but lower than isearch main overlay's 1001
                          (overlay-put ov 'priority 1000)
-                         (overlay-put ov 'face 'lazy-highlight)))
-                         ;(overlay-put ov 'window (selected-window))))
+                         (overlay-put ov 'face 'lazy-highlight)
+                         (unless (eq isearch-lazy-highlight 'all-windows)
+                            (overlay-put ov 'window (selected-window)))))
                      ;; Remember the current position of point for
                      ;; the next call of `isearch-lazy-highlight-update'
                      ;; when `lazy-highlight-max-at-a-time' is too small.



reply via email to

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