Subject: bug#53126: 29.0.50; [PATCH] Lazy highlight/count when reading query-replace string, etc.

From: Augusto Stoffel <[email-masked]>
Date: Wed, 23 Mar 2022 19:54:14 +0100

On Wed, 23 Mar 2022 at 20:20, Juri Linkov <[email-masked]> wrote:

> Unfortunately, there is a regression: isearch-yank-char-in-minibuffer
> bound to C-f and [right] in the minibuffer of isearch-edit-string
> doesn't work anymore.

The following patch solves to problem for me.

The point doesn't move visually, so selecting the isearch window puts it
in the right place.  But what exactly happens to the point in the
searched buffer?  I find this rather confusing!

>From b9ed18bdfa72667b7d1e25982b7fd85dcb2c4166 Mon Sep 17 00:00:00 2001
From: Augusto Stoffel <[email-masked]>
Date: Wed, 23 Mar 2022 19:43:13 +0100
Subject: [PATCH] Fix regression in isearch-yank-char-in-minibuffer

* lisp/isearch.el (isearch-yank-char-in-minibuffer): Select the
original window in order to restore point.  This is needed when
minibuffer lazy highlight is in effect.
---
 lisp/isearch.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/isearch.el b/lisp/isearch.el
index 1a83586ef8..9b311cb49e 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2670,7 +2670,7 @@ isearch-yank-char-in-minibuffer
   (interactive "p")
   (if (eobp)
       (insert
-       (with-current-buffer (cadr (buffer-list))
+       (with-minibuffer-selected-window
          (buffer-substring-no-properties
           (point) (progn (forward-char arg) (point)))))
     (forward-char arg)))
-- 
2.35.1