all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Gregory Heytings <gregory@heytings.org>
To: Juri Linkov <juri@linkov.net>
Cc: max.brieiev@gmail.com, 47894@debbugs.gnu.org
Subject: bug#47894: 28.0.50; isearch does not work if enable-recursive-minibuffers is on and some input method is set.
Date: Tue, 20 Apr 2021 21:51:38 +0000	[thread overview]
Message-ID: <a6e276cb03e4d44a97be@heytings.org> (raw)
In-Reply-To: <a6e276cb0342722b8674@heytings.org>

[-- Attachment #1: Type: text/plain, Size: 782 bytes --]


>
> Thanks for the reminder; I had seen Zhiwei Chen's message, but not this 
> bug. I'll have a look.
>

This bug is rather strange.  When an input method is used, 
isearch-post-command-hook is executed twice, once in the current isearch 
buffer and once in the minibuffer.

When enable-recursive-minibuffers is unset, the execution of isearch-exit 
fails with "Command attempted to use minibuffer while in minibuffer", so 
the error is not visible (except in *Messages*).

When enable-recursive-minibuffers is set, the execution of isearch-exit 
does not fail, which triggers the current bug.

The immediate fix is attached, but I wonder if the cause is not elswhere, 
that is, if it is indeed intended that isearch-post-command-hook is 
executed in the minibuffer in such a case.

[-- Attachment #2: Type: text/x-diff, Size: 1492 bytes --]

From 32456fad0d683db7a154220b1b4a57946c84b410 Mon Sep 17 00:00:00 2001
From: Gregory Heytings <gregory@heytings.org>
Date: Tue, 20 Apr 2021 21:42:32 +0000
Subject: [PATCH] Terminate isearch when point has moved to another buffer

* lisp/isearch.el (isearch-post-command-hook): Terminate isearch
when the command just executed has moved point to another buffer.
https://lists.gnu.org/archive/html/emacs-devel/2021-04/msg00309.html

This improves commit ff796823e5 for the case when an input method is
used and enable-recursive-minibuffers is set (Bug#47894).
---
 lisp/isearch.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/isearch.el b/lisp/isearch.el
index 69fdc9df6d..8123da90c9 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -3057,9 +3057,10 @@ isearch-post-command-hook
          (isearch-search-and-update)))
      (setq isearch-pre-move-point nil))
   ;; Terminate the search if point has moved to another buffer.
-  (unless (eq isearch--current-buffer (current-buffer))
-    (when (buffer-live-p isearch--current-buffer)
-      (with-current-buffer isearch--current-buffer (isearch-exit))))
+  (unless (minibufferp (current-buffer))
+    (unless (eq isearch--current-buffer (current-buffer))
+      (when (buffer-live-p isearch--current-buffer)
+        (with-current-buffer isearch--current-buffer (isearch-exit)))))
   (force-mode-line-update))
 
 (defun isearch-quote-char (&optional count)
-- 
2.30.2


  reply	other threads:[~2021-04-20 21:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19 16:06 bug#47894: 28.0.50; y.oy max.brieiev
2021-04-19 16:31 ` bug#47894: 28.0.50; isearch does not work if enable-recursive-minibuffers is on and some input method is set max.brieiev
2021-04-19 20:49   ` Juri Linkov
2021-04-20 20:00 ` Juri Linkov
2021-04-20 20:15   ` Gregory Heytings
2021-04-20 21:51     ` Gregory Heytings [this message]
2021-04-20 22:35     ` Gregory Heytings
2021-04-21  6:21       ` Gregory Heytings
2021-04-21  7:03       ` martin rudalics
2021-04-21  7:16         ` Gregory Heytings
2021-04-21  7:42           ` martin rudalics
2021-04-21  7:49             ` Gregory Heytings
2021-04-21 17:02               ` Juri Linkov
2021-04-21 17:18                 ` Gregory Heytings
2021-04-21 17:37                   ` Juri Linkov
2021-04-21 17:59                 ` Juri Linkov
2021-04-21 19:23                   ` Juri Linkov

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=a6e276cb03e4d44a97be@heytings.org \
    --to=gregory@heytings.org \
    --cc=47894@debbugs.gnu.org \
    --cc=juri@linkov.net \
    --cc=max.brieiev@gmail.com \
    /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.