Subject: bug#52356: 27.2; Isearch prompt changes unexpectedly with char folding enabled

From: Andrea Greselin <[email-masked]>
Date: Fri, 10 Dec 2021 11:41:44 +0100

Hello Juri,

your patch works for me. If you’re going to submit it for merging
you might consider replacing the old line with

    (or (eq this-command 'isearch-del-char)

just to avoid using ‘memq’ for comparing against a single item.

Thanks,
Andrea

On Tue, 7 Dec 2021 at 21:08, Juri Linkov <[email-masked]> wrote:

> >> when I use Isearch with char folding enabled, the prompt changes very
> >> briefly at every character I type in. The actual prompt depends on the
> >> values of ‘lazy-count-*-format’ and ‘search-default-mode’ (if they all
> >> have their default value the prompt is ‘Pending char-fold I-search:…’;
> >> with the settings described below it’s just ‘I-search: …’, and it
> >> changes briefly to ‘Pending I-search: …’).
> >
> > Thanks for the bug report.  Some time ago I proposed the following patch:
> >
> > -                (if isearch-adjusted "pending " "")
>
> But many functions in isearch.el set isearch-adjusted for a reason.
> So maybe better to fix only the reported case with:
>
> diff --git a/lisp/isearch.el b/lisp/isearch.el
> index 75a80840d6..065f6b3c2a 100644
> --- a/lisp/isearch.el
> +++ b/lisp/isearch.el
> @@ -3571,7 +3571,7 @@ isearch-search-fun
>
>  (defun isearch--lax-regexp-function-p ()
>    "Non-nil if next regexp-function call should be lax."
> -  (or (memq this-command '(isearch-printing-char isearch-del-char))
> +  (or (memq this-command '(isearch-del-char))
>        isearch-yank-flag))
> --
>