diff options
| author | Juri Linkov | 2020-01-15 02:02:53 +0200 |
|---|---|---|
| committer | Juri Linkov | 2020-01-15 02:02:53 +0200 |
| commit | fdee034ac83ae2c6b31ab7ebae248524cba17422 (patch) | |
| tree | e3795e9f06e743a8d071d65703ac10d28f39371f | |
| parent | 7b14329d86aec2ad3d33de557ecb2ea103f6b0ea (diff) | |
| download | emacs-fdee034ac83ae2c6b31ab7ebae248524cba17422.tar.gz emacs-fdee034ac83ae2c6b31ab7ebae248524cba17422.zip | |
* lisp/isearch.el: Fix corner cases of isearch-lazy-count.
* lisp/isearch.el (isearch-mode): Reset isearch-lazy-count-current
and isearch-lazy-count-total to nil, so when isearch-mode is started,
there should be no counts from previous Isearch.
(isearch-lazy-highlight-new-loop): Call isearch-message after resetting
lazy-count variables only when isearch-mode is started. This avoids
the problem of inappropriate calls of isearch-message-function
when query-replace in the minibuffer performs lazy-highlighting that
used to call minibuffer-history-isearch-message unnecessarily.
| -rw-r--r-- | lisp/isearch.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/isearch.el b/lisp/isearch.el index c9873937252..ddf9190dc6d 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -1225,6 +1225,9 @@ used to set the value of `isearch-regexp-function'." | |||
| 1225 | isearch-pre-scroll-point nil | 1225 | isearch-pre-scroll-point nil |
| 1226 | isearch-pre-move-point nil | 1226 | isearch-pre-move-point nil |
| 1227 | 1227 | ||
| 1228 | isearch-lazy-count-current nil | ||
| 1229 | isearch-lazy-count-total nil | ||
| 1230 | |||
| 1228 | ;; Save the original value of `minibuffer-message-timeout', and | 1231 | ;; Save the original value of `minibuffer-message-timeout', and |
| 1229 | ;; set it to nil so that isearch's messages don't get timed out. | 1232 | ;; set it to nil so that isearch's messages don't get timed out. |
| 1230 | isearch-original-minibuffer-message-timeout minibuffer-message-timeout | 1233 | isearch-original-minibuffer-message-timeout minibuffer-message-timeout |
| @@ -3776,7 +3779,7 @@ by other Emacs features." | |||
| 3776 | isearch-lazy-highlight-window-end)))))) | 3779 | isearch-lazy-highlight-window-end)))))) |
| 3777 | ;; something important did indeed change | 3780 | ;; something important did indeed change |
| 3778 | (lazy-highlight-cleanup t (not (equal isearch-string ""))) ;stop old timer | 3781 | (lazy-highlight-cleanup t (not (equal isearch-string ""))) ;stop old timer |
| 3779 | (when isearch-lazy-count | 3782 | (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) |
| 3780 | (when (or (equal isearch-string "") | 3783 | (when (or (equal isearch-string "") |
| 3781 | ;; Check if this place was reached by a condition above | 3784 | ;; Check if this place was reached by a condition above |
| 3782 | ;; other than changed window boundaries (that shouldn't | 3785 | ;; other than changed window boundaries (that shouldn't |
| @@ -3794,7 +3797,7 @@ by other Emacs features." | |||
| 3794 | (clrhash isearch-lazy-count-hash) | 3797 | (clrhash isearch-lazy-count-hash) |
| 3795 | (setq isearch-lazy-count-current nil | 3798 | (setq isearch-lazy-count-current nil |
| 3796 | isearch-lazy-count-total nil) | 3799 | isearch-lazy-count-total nil) |
| 3797 | (funcall (or isearch-message-function #'isearch-message)))) | 3800 | (isearch-message))) |
| 3798 | (setq isearch-lazy-highlight-window-start-changed nil) | 3801 | (setq isearch-lazy-highlight-window-start-changed nil) |
| 3799 | (setq isearch-lazy-highlight-window-end-changed nil) | 3802 | (setq isearch-lazy-highlight-window-end-changed nil) |
| 3800 | (setq isearch-lazy-highlight-error isearch-error) | 3803 | (setq isearch-lazy-highlight-error isearch-error) |