[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/isearch-mb a663c22 16/20: Better place to check if Isea
From: |
Stefan Monnier |
Subject: |
[elpa] externals/isearch-mb a663c22 16/20: Better place to check if Isearch is still active |
Date: |
Sun, 16 May 2021 17:21:15 -0400 (EDT) |
branch: externals/isearch-mb
commit a663c22274ca2f53d7d98478c34fa9b4895d9e7e
Author: Augusto Stoffel <arstoffel@gmail.com>
Commit: Augusto Stoffel <arstoffel@gmail.com>
Better place to check if Isearch is still active
---
isearch-mb.el | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/isearch-mb.el b/isearch-mb.el
index 5d0c380..1dcb3d4 100644
--- a/isearch-mb.el
+++ b/isearch-mb.el
@@ -38,9 +38,6 @@
(require 'cl-lib)
(require 'subr-x))
-(defvar isearch-mb--prompt-overlay nil
- "Overlay for minibuffer prompt updates.")
-
(defvar isearch-mb--with-buffer
'(isearch-post-command-hook
isearch-beginning-of-buffer
@@ -94,6 +91,9 @@
map)
"Minibuffer keymap used by Isearch-Mb.")
+(defvar isearch-mb--prompt-overlay nil
+ "Overlay for minibuffer prompt updates.")
+
(defun isearch-mb--after-change (_beg _end _len)
"Hook to run from the minibuffer to update the Isearch state."
(let ((string (minibuffer-contents))
@@ -117,9 +117,11 @@
(defun isearch-mb--post-command-hook ()
"Hook to make the minibuffer reflect the Isearch state."
+ (unless isearch--current-buffer
+ (throw 'isearch-mb--continue '(ignore)))
(let ((inhibit-modification-hooks t))
- ;; We never update isearch-message. If it's not empty, then
- ;; Isearch on its own volition, and we update it.
+ ;; We never update `isearch-message'. If it's not empty, then
+ ;; Isearch changed the search string on its own volition.
(unless (string-empty-p isearch-message)
(setq isearch-message "")
(delete-minibuffer-contents)
@@ -157,13 +159,11 @@ Intended as an advice for Isearch commands."
(let ((enable-recursive-minibuffers t)
(inhibit-redisplay t))
(with-minibuffer-selected-window
- (apply args)
- (unless isearch-mode
- (throw 'isearch-mb--continue '(ignore)))))
+ (apply args)))
(apply args)))
(defun isearch-mb--after-exit (&rest args)
- "Evaluate ARGS, after quitting Isearch-Mb.
+ "Evaluate ARGS after quitting Isearch-Mb.
Intended as an advice for commands that quit Isearch and use the
minibuffer."
(throw 'isearch-mb--continue args))
@@ -222,7 +222,7 @@ minibuffer."
(unless (minibufferp)
;; When `with-isearch-suspended' is involved, this hook may run
;; more than once, hence the test for `isearch-mode'.
- (run-with-idle-timer 0 nil (lambda() (when isearch-mode
(isearch-mb--session))))))
+ (run-with-idle-timer 0 nil (lambda () (when isearch-mode
(isearch-mb--session))))))
;;;###autoload
(define-minor-mode isearch-mb-mode
- [elpa] branch externals/isearch-mb created (now c270809), Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb 1c16403 15/20: Keep advices only for the duration of a search session, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb ce41e00 12/20: Add a Readme, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb c6fc566 18/20: Use remapping in minibuffer keymap, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb 5d5b0e9 17/20: Replace advices by let-bindings where possible, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb a663c22 16/20: Better place to check if Isearch is still active,
Stefan Monnier <=
- [elpa] externals/isearch-mb dc603a9 03/20: Lazily highlight the whole buffer, to avoid missing overlays, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb 40add97 01/20: Initial commit, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb 8566108 02/20: Many changes, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb 223b1b9 04/20: Introduce a buffer-local minor mode, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb 5805f13 07/20: Add keybinding for newline, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb d075efe 06/20: Rename minor modes, move a test to the timer function, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb 9f11fda 05/20: Several improvements, reorganization, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb a8d2a15 10/20: Provide future history, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb fccf1b7 08/20: Fix post-command hook for the failed search case, Stefan Monnier, 2021/05/16
- [elpa] externals/isearch-mb 01fdc36 19/20: Update Readme, Stefan Monnier, 2021/05/16