From: Juri Linkov Date: Wed, 15 Jan 2020 00:02:53 +0000 (+0200) Subject: * lisp/isearch.el: Fix corner cases of isearch-lazy-count. X-Git-Tag: emacs-27.0.90~167 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fdee034ac83ae2c6b31ab7ebae248524cba17422;p=emacs.git * 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. --- 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'." isearch-pre-scroll-point nil isearch-pre-move-point nil + isearch-lazy-count-current nil + isearch-lazy-count-total nil + ;; Save the original value of `minibuffer-message-timeout', and ;; set it to nil so that isearch's messages don't get timed out. isearch-original-minibuffer-message-timeout minibuffer-message-timeout @@ -3776,7 +3779,7 @@ by other Emacs features." isearch-lazy-highlight-window-end)))))) ;; something important did indeed change (lazy-highlight-cleanup t (not (equal isearch-string ""))) ;stop old timer - (when isearch-lazy-count + (when (and isearch-lazy-count isearch-mode (null isearch-message-function)) (when (or (equal isearch-string "") ;; Check if this place was reached by a condition above ;; other than changed window boundaries (that shouldn't @@ -3794,7 +3797,7 @@ by other Emacs features." (clrhash isearch-lazy-count-hash) (setq isearch-lazy-count-current nil isearch-lazy-count-total nil) - (funcall (or isearch-message-function #'isearch-message)))) + (isearch-message))) (setq isearch-lazy-highlight-window-start-changed nil) (setq isearch-lazy-highlight-window-end-changed nil) (setq isearch-lazy-highlight-error isearch-error)