From: Stefan Monnier <monnier@iro.umontreal.ca>
To: 20532-done@debbugs.gnu.org
Subject: bug#20532: 25.0.50; void-variable cursor-sensor-inhibit
Date: Wed, 27 May 2015 12:18:20 -0400 [thread overview]
Message-ID: <jwv8uca9eu7.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <87siakz82j.fsf@gnu.org> ("Johan Bockgård"'s message of "Mon, 25 May 2015 23:00:20 +0200")
>> Can you think of any reason why you might have started your search in
>> one buffer and ended it in another?
> This will happen by design if you use isearch to search across multiple
> files (i.e. multi-isearch), such as a sequence of ChangeLog.N files.
> (There may be other variables than cursor-sensor-inhibit that are also
> mishandled in this situation.)
I installed the patch below which should fix this.
Stefan
diff --git a/lisp/isearch.el b/lisp/isearch.el
index dc10502..5599ea5 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -932,12 +932,6 @@ convert the search string to a regexp used by regexp search functions."
(add-hook 'post-command-hook 'isearch-post-command-hook)
(add-hook 'mouse-leave-buffer-hook 'isearch-done)
(add-hook 'kbd-macro-termination-hook 'isearch-done)
- (make-local-variable 'cursor-sensor-inhibit)
- (unless (boundp 'cursor-sensor-inhibit)
- (setq cursor-sensor-inhibit nil))
- ;; Suspend things like cursor-intangible during Isearch so we can search even
- ;; within intangible text.
- (push 'isearch cursor-sensor-inhibit)
;; isearch-mode can be made modal (in the sense of not returning to
;; the calling function until searching is completed) by entering
@@ -949,10 +943,23 @@ convert the search string to a regexp used by regexp search functions."
;; Some high level utilities. Others below.
+(defvar isearch--current-buffer)
(defun isearch-update ()
"This is called after every isearch command to update the display.
The last thing it does is to run `isearch-update-post-hook'."
+ (unless (eq (current-buffer) isearch--current-buffer)
+ (when isearch--current-buffer
+ (with-current-buffer isearch--current-buffer
+ (setq cursor-sensor-inhibit (delq 'isearch cursor-sensor-inhibit))))
+ (setq isearch--current-buffer (current-buffer))
+ (make-local-variable 'cursor-sensor-inhibit)
+ (unless (boundp 'cursor-sensor-inhibit)
+ (setq cursor-sensor-inhibit nil))
+ ;; Suspend things like cursor-intangible during Isearch so we can search
+ ;; even within intangible text.
+ (push 'isearch cursor-sensor-inhibit))
+
(if (and (null unread-command-events)
(null executing-kbd-macro))
(progn
@@ -1026,7 +1033,9 @@ NOPUSH is t and EDIT is t."
(remove-hook 'mouse-leave-buffer-hook 'isearch-done)
(remove-hook 'kbd-macro-termination-hook 'isearch-done)
(setq isearch-lazy-highlight-start nil)
- (setq cursor-sensor-inhibit (delq 'isearch cursor-sensor-inhibit))
+ (with-current-buffer isearch--current-buffer
+ (setq isearch--current-buffer nil)
+ (setq cursor-sensor-inhibit (delq 'isearch cursor-sensor-inhibit)))
;; Called by all commands that terminate isearch-mode.
;; If NOPUSH is non-nil, we don't push the string on the search ring.
next prev parent reply other threads:[~2015-05-27 16:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-08 16:46 bug#20532: 25.0.50; void-variable cursor-sensor-inhibit Kaushal
2015-05-08 18:02 ` Stefan Monnier
2015-05-08 18:10 ` Kaushal
2015-05-08 22:37 ` Stefan Monnier
2015-05-25 21:00 ` Johan Bockgård
2015-05-25 22:54 ` Stefan Monnier
2015-05-27 16:18 ` Stefan Monnier [this message]
2015-05-06 16:44 ` bug#20516: 25.0.50; cursor-sensor is not loaded in isearch Vitalie Spinu
2015-05-06 16:54 ` Eli Zaretskii
2015-05-06 18:01 ` Vitalie Spinu
[not found] ` <handler.20516.D20532.143274351715092.notifdone@debbugs.gnu.org>
2015-05-27 16:58 ` bug#20516: closed (Re: bug#20532: 25.0.50; void-variable cursor-sensor-inhibit) Vitalie Spinu
2015-05-27 17:46 ` Vitalie Spinu
2015-05-27 20:52 ` bug#20532: 25.0.50; void-variable cursor-sensor-inhibit Christoph Ruegge
2015-05-28 1:49 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwv8uca9eu7.fsf-monnier+emacsbugs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=20532-done@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.