]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/isearch.el (isearch-lazy-highlight-update): Remember timer object
authorJuri Linkov <juri@linkov.net>
Wed, 18 Sep 2019 22:12:36 +0000 (01:12 +0300)
committerJuri Linkov <juri@linkov.net>
Wed, 18 Sep 2019 22:12:36 +0000 (01:12 +0300)
in isearch-lazy-highlight-timer to cancel it in lazy-highlight-cleanup.

(isearch-done): No need to set isearch-lazy-highlight-start to nil -
it used to reset lazy-highlight loop like isearch-lazy-highlight-window-start,
but now other packages set isearch-lazy-highlight-last-string to nil to reset
lazy-highlight loop.

lisp/isearch.el

index 9401e8c06d30b8d4094e2262fa679137f0bcfd90..ec51c2cf4ccd5086d1a28504e6d1736572e4e9cb 100644 (file)
@@ -1370,7 +1370,6 @@ NOPUSH is t and EDIT is t."
   (remove-hook 'post-command-hook 'isearch-post-command-hook)
   (remove-hook 'mouse-leave-buffer-hook 'isearch-mouse-leave-buffer)
   (remove-hook 'kbd-macro-termination-hook 'isearch-done)
-  (setq isearch-lazy-highlight-start nil)
   (when (buffer-live-p isearch--current-buffer)
     (with-current-buffer isearch--current-buffer
       (setq isearch--current-buffer nil)
@@ -3970,8 +3969,9 @@ Attempt to do the search exactly the way the pending Isearch would."
                  (if isearch-lazy-highlight-forward
                      (setq isearch-lazy-highlight-end (point-min))
                    (setq isearch-lazy-highlight-start (point-max)))
-                 (run-at-time lazy-highlight-interval nil
-                              'isearch-lazy-highlight-buffer-update))
+                 (setq isearch-lazy-highlight-timer
+                       (run-at-time lazy-highlight-interval nil
+                                    'isearch-lazy-highlight-buffer-update)))
              (setq isearch-lazy-highlight-timer
                    (run-at-time lazy-highlight-interval nil
                                 'isearch-lazy-highlight-update)))))))))