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

From: Juri Linkov <[email-masked]>
Date: Wed, 23 Mar 2022 22:06:38 +0200

>> +       (with-minibuffer-selected-window
>
> Thanks, I confirm your patch fixes the problem.
> But before pushing it, I'd like to understand
> how your previous patches changed the order
> of the buffer list?  Before your changes,
> (cadr (buffer-list)) returned the original buffer,
> but now it returns the minibuffer.

Probably the buffer order is changed by
with-minibuffer-selected-window in
minibuffer-lazy-highlight--after-change.
This is fine, so I pushed your patch.