From unknown Mon Aug 18 02:45:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52356: 27.2; Isearch prompt changes unexpectedly with char folding enabled Resent-From: Andrea Greselin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Dec 2021 18:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52356 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 52356@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163890277530425 (code B ref -1); Tue, 07 Dec 2021 18:47:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Dec 2021 18:46:15 +0000 Received: from localhost ([127.0.0.1]:38630 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mufTi-0007ue-Uq for submit@debbugs.gnu.org; Tue, 07 Dec 2021 13:46:15 -0500 Received: from lists.gnu.org ([209.51.188.17]:44930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mufTh-0007uW-El for submit@debbugs.gnu.org; Tue, 07 Dec 2021 13:46:14 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mufTh-00009x-5q for bug-gnu-emacs@gnu.org; Tue, 07 Dec 2021 13:46:13 -0500 Received: from [2607:f8b0:4864:20::1030] (port=54973 helo=mail-pj1-x1030.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mufTe-0001r0-GS for bug-gnu-emacs@gnu.org; Tue, 07 Dec 2021 13:46:12 -0500 Received: by mail-pj1-x1030.google.com with SMTP id np3so139420pjb.4 for ; Tue, 07 Dec 2021 10:46:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=6CZQWteMJIEmTF0tCfIV2R1xkj5r5WBaSMbiVrPevOw=; b=mNEKuXECok+VEQdaQdNys/A35zzmyIgtyi2xd8hH+HzczcjEHWkR0u3bkQRjoBXBj/ 2aklRyKtJYQbNBybvFquYs/STCKD/bmaieEgcIMVd1saBv+E44vuNmza0P48WIGGyiPZ QWFZeOFLG82QPkbBr589dqoxwV84Iqojs6FOJrvL8pXA4hP5BGOjCm8GKXHo4yFrxmMZ kCqIlElXJWrDbwKI5luErdjnfaj2sg6cWtSlx9FM24/spdZP3jA9YBpd7eOMrPxXDs6O tog38MhVm3Z7JkzLnIlEJrs9AANT78dgobsaAJ4uhiybr1iLUv2BSWSllj1ntFYOeIGV OySg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=6CZQWteMJIEmTF0tCfIV2R1xkj5r5WBaSMbiVrPevOw=; b=n1Bi7XJS2zmgfgsARJ5pTP6d8/8nqMNKw1I3VEy3tEm8TNCPKha1NoOzrMaGLFY6Hi wxSr/wLLICqUi1ksFX321RGE1Bx6cktx0jNAODFPLSQBE5u9Ly4fqaf8czDrVGrZYfS+ v6ApijaUPs0QsFsowuSSoDwbHTI1NXuF2e2KoOISYW0OrfkEiziCHfgq8J7h5ykUgpob vcq7HUv+aXUiTYnMvczqM0cQr/v61sGC38yPCS8sC9R9riSbaj57C7/2uW7lEndySrTj e70vHnCNlqjYzfccRwCbCiaVYu5Q0zz9VbGvnUCY+g2Dcs67FNDvug+/NzhgJUMYBXAD oe8w== X-Gm-Message-State: AOAM5317paCMz9Zdh9ZRYfSIub1/yYjxY+uueGNcRtwPa9hYh5tK7n6M wS7P3dw7FcHTcJbXQwnrCK2dEqkO13rYvctDqZSP/1tAvAA= X-Google-Smtp-Source: ABdhPJzhLWJJhLJ3N+uZQrAsGsGwuI2uRMIXGFWwl0gSuuLgP+ZXwXzOcZgvW4YFciqNH9mOIacSNOKZaayEpx9qepM= X-Received: by 2002:a0c:8104:: with SMTP id 4mr1135741qvc.118.1638902331168; Tue, 07 Dec 2021 10:38:51 -0800 (PST) MIME-Version: 1.0 From: Andrea Greselin Date: Tue, 7 Dec 2021 19:38:15 +0100 Message-ID: Content-Type: multipart/alternative; boundary="000000000000455be305d292af07" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1030 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=greselin.andrea@gmail.com; helo=mail-pj1-x1030.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --000000000000455be305d292af07 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, 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 =E2=80=98lazy-count-*-format=E2=80=99 and =E2=80=98search-default= -mode=E2=80=99 (if they all have their default value the prompt is =E2=80=98Pending char-fold I-search:= =E2=80=A6=E2=80=99; with the settings described below it=E2=80=99s just =E2=80=98I-search: =E2= =80=A6=E2=80=99, and it changes briefly to =E2=80=98Pending I-search: =E2=80=A6=E2=80=99). Steps to reproduce: ------------------- Launch =E2=80=98Emacs -Q=E2=80=99, evaluate these forms (setq isearch-lazy-count t) (setq lazy-count-prefix-format nil lazy-count-suffix-format " [%s/%s]") (setq-local search-default-mode 'char-fold-to-regexp) (electric-quote-local-mode) and Isearch for something. All the best, Andrea In GNU Emacs 27.2 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.30, cairo version 1.17.4) of 2021-08-07 built on buildvm-x86-29.iad2.fedoraproject.org Windowing system distributor 'The X.Org Foundation', version 11.0.12101003 System Description: Fedora 34 (Workstation Edition) Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Making completion list... [5 times] Configured using: 'configure --build=3Dx86_64-redhat-linux-gnu --host=3Dx86_64-redhat-linux-gnu --program-prefix=3D --disable-dependency-tracking --prefix=3D/usr --exec-prefix=3D/usr --bindir=3D/usr/bin --sbindir=3D/usr/sbin --sysconfdir=3D/etc --datadir=3D/usr/share --includedir=3D/usr/include --libdir=3D/usr/lib64 --libexecdir=3D/usr/libexec --localstatedir=3D/var --sharedstatedir=3D/var/lib --mandir=3D/usr/share/man --infodir=3D/usr/share/info --with-dbus --with-gif --with-jpeg --with-png --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=3Dgtk3 --with-gpm=3Dno --with-xwidgets --with-modules --with-harfbuzz --with-cairo --with-json build_alias=3Dx86_64-redhat-linux-gnu host_alias=3Dx86_64-redhat-linux-gnu CC=3Dgcc 'CFLAGS=3D-DMAIL_USE_LOCKF -= O2 -flto=3Dauto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=3Dformat-security -Wp,-D_FORTIFY_SOURCE=3D2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=3D/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=3Dgeneric -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' LDFLAGS=3D-Wl,-z,relro PKG_CONFIG_PATH=3D:/usr/lib64/pkgconfig:/usr/share/pkgconfig' Configured features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS LIBSYSTEMD JSON PDUMPER GMP Important settings: value of $LANG: en_GB.UTF-8 value of $XMODIFIERS: @im=3Dibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting xwidget-internal cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 47051 7677) (symbols 48 6007 1) (strings 32 15798 2213) (string-bytes 1 518549) (vectors 16 11404) (vector-slots 8 137751 8790) (floats 8 20 45) (intervals 56 271 0) (buffers 1000 12)) --000000000000455be305d292af07 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,
when I use Isearch with char folding enabled, th= e prompt changes very
briefly at every character I type in. The actual p= rompt depends on the
values of =E2=80=98lazy-count-*-format=E2=80=99 and= =E2=80=98search-default-mode=E2=80=99 (if they all
have their default v= alue the prompt is =E2=80=98Pending char-fold I-search:=E2=80=A6=E2=80=99;<= br>with the settings described below it=E2=80=99s just =E2=80=98I-search: = =E2=80=A6=E2=80=99, and it
changes briefly to =E2=80=98Pending I-search:= =E2=80=A6=E2=80=99).

Steps to reproduce:
-------------------
=
Launch =E2=80=98Emacs -Q=E2=80=99, evaluate these forms

=C2=A0 = =C2=A0 (setq isearch-lazy-count t)
=C2=A0 =C2=A0 (setq lazy-count-prefix= -format nil
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 lazy-count-suffix-format = " [%s/%s]")
=C2=A0 =C2=A0 (setq-local search-default-mode '= ;char-fold-to-regexp)
=C2=A0 =C2=A0 (electric-quote-local-mode)

a= nd Isearch for something.

All the best,
Andrea



In = GNU Emacs 27.2 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.30, cai= ro version 1.17.4)
=C2=A0of 2021-08-07 built on buildvm-x86-29.iad2.fedoraproject.org<= br>Windowing system distributor 'The X.Org Foundation', version 11.= 0.12101003
System Description: Fedora 34 (Workstation Edition)

Re= cent messages:
For information about GNU Emacs and the GNU system, type = C-h C-a.
Making completion list... [5 times]

Configured using:=C2=A0'configure --build=3Dx86_64-redhat-linux-gnu
=C2=A0--host=3Dx= 86_64-redhat-linux-gnu --program-prefix=3D
=C2=A0--disable-dependency-tr= acking --prefix=3D/usr --exec-prefix=3D/usr
=C2=A0--bindir=3D/usr/bin --= sbindir=3D/usr/sbin --sysconfdir=3D/etc
=C2=A0--datadir=3D/usr/share --i= ncludedir=3D/usr/include --libdir=3D/usr/lib64
=C2=A0--libexecdir=3D/usr= /libexec --localstatedir=3D/var
=C2=A0--sharedstatedir=3D/var/lib --mand= ir=3D/usr/share/man
=C2=A0--infodir=3D/usr/share/info --with-dbus --with= -gif --with-jpeg --with-png
=C2=A0--with-rsvg --with-tiff --with-xft --w= ith-xpm --with-x-toolkit=3Dgtk3
=C2=A0--with-gpm=3Dno --with-xwidgets --= with-modules --with-harfbuzz
=C2=A0--with-cairo --with-json build_alias= =3Dx86_64-redhat-linux-gnu
=C2=A0host_alias=3Dx86_64-redhat-linux-gnu CC= =3Dgcc 'CFLAGS=3D-DMAIL_USE_LOCKF -O2
=C2=A0-flto=3Dauto -ffat-lto-o= bjects -fexceptions -g -grecord-gcc-switches
=C2=A0-pipe -Wall -Werror= =3Dformat-security -Wp,-D_FORTIFY_SOURCE=3D2
=C2=A0-Wp,-D_GLIBCXX_ASSERT= IONS
=C2=A0-specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-prot= ector-strong
=C2=A0-specs=3D/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 = -mtune=3Dgeneric
=C2=A0-fasynchronous-unwind-tables -fstack-clash-protec= tion -fcf-protection'
=C2=A0LDFLAGS=3D-Wl,-z,relro
=C2=A0PKG_CONF= IG_PATH=3D:/usr/lib64/pkgconfig:/usr/share/pkgconfig'

Configured= features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NO= TIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LI= BOTF
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS=
LIBSYSTEMD JSON PDUMPER GMP

Important settings:
=C2=A0 value = of $LANG: en_GB.UTF-8
=C2=A0 value of $XMODIFIERS: @im=3Dibus
=C2=A0 = locale-coding-system: utf-8-unix

Major mode: Lisp Interaction
Minor modes in effect:
=C2=A0 tooltip-mode: t
=C2=A0 global-eldoc-mo= de: t
=C2=A0 eldoc-mode: t
=C2=A0 electric-indent-mode: t
=C2=A0 m= ouse-wheel-mode: t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mode: t=C2=A0 file-name-shadow-mode: t
=C2=A0 global-font-lock-mode: t
=C2= =A0 font-lock-mode: t
=C2=A0 blink-cursor-mode: t
=C2=A0 auto-composi= tion-mode: t
=C2=A0 auto-encryption-mode: t
=C2=A0 auto-compression-m= ode: t
=C2=A0 line-number-mode: t
=C2=A0 transient-mark-mode: t
Load-path shadows:
None found.

Features:
(shadow sort mail-e= xtr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mm= l easymenu mml-sec password-cache epa derived epg
epg-config gnus-util r= mail rmail-loaddefs text-property-search time-date
subr-x seq byte-opt g= v bytecomp byte-compile cconv mm-decode mm-bodies
mm-encode mail-parse r= fc2231 mailabbrev gmm-utils mailheader cl-loaddefs
cl-lib sendmail rfc20= 47 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
tooltip eldoc electr= ic uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win = term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabul= ated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode re= gister page tab-bar menu-bar rfn-eshadow isearch
timer select scroll-bar= mouse jit-lock font-lock syntax facemenu
font-core term/tty-colors fram= e minibuffer cl-generic cham georgian
utf-8-lang misc-lang vietnamese ti= betan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek ro= manian slovak czech european
ethiopic indian cyrillic chinese composite = charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev= obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp fi= les
text-properties overlay sha1 md5 base64 format env code-pages mulecustom widget hashtable-print-readable backquote threads dbusbind
inot= ify dynamic-setting system-font-setting font-render-setting
xwidget-inte= rnal cairo move-toolbar gtk x-toolkit x multi-tty
make-network-process e= macs)

Memory information:
((conses 16 47051 7677)
=C2=A0(symbo= ls 48 6007 1)
=C2=A0(strings 32 15798 2213)
=C2=A0(string-bytes 1 518= 549)
=C2=A0(vectors 16 11404)
=C2=A0(vector-slots 8 137751 8790)
= =C2=A0(floats 8 20 45)
=C2=A0(intervals 56 271 0)
=C2=A0(buffers 1000= 12))
--000000000000455be305d292af07-- From unknown Mon Aug 18 02:45:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52356: 27.2; Isearch prompt changes unexpectedly with char folding enabled Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Dec 2021 19:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52356 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Andrea Greselin Cc: 52356@debbugs.gnu.org Received: via spool by 52356-submit@debbugs.gnu.org id=B52356.16389051432030 (code B ref 52356); Tue, 07 Dec 2021 19:26:01 +0000 Received: (at 52356) by debbugs.gnu.org; 7 Dec 2021 19:25:43 +0000 Received: from localhost ([127.0.0.1]:38671 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mug5u-0000Wg-Pm for submit@debbugs.gnu.org; Tue, 07 Dec 2021 14:25:42 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:46115) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mug5q-0000WQ-J5 for 52356@debbugs.gnu.org; Tue, 07 Dec 2021 14:25:41 -0500 Received: (Authenticated sender: juri@linkov.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 81027FF804; Tue, 7 Dec 2021 19:25:31 +0000 (UTC) From: Juri Linkov Organization: LINKOV.NET References: Date: Tue, 07 Dec 2021 21:23:53 +0200 In-Reply-To: (Andrea Greselin's message of "Tue, 7 Dec 2021 19:38:15 +0100") Message-ID: <868rwwdxrq.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > 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: …’). > > Steps to reproduce: > ------------------- > > Launch ‘Emacs -Q’, evaluate these forms > > (setq isearch-lazy-count t) > (setq lazy-count-prefix-format nil > lazy-count-suffix-format " [%s/%s]") > (setq-local search-default-mode 'char-fold-to-regexp) > (electric-quote-local-mode) > > and Isearch for something. Thanks for the bug report. Some time ago I proposed the following patch: diff --git a/lisp/isearch.el b/lisp/isearch.el index 75a80840d6..5aa8ea2f14 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -3479,7 +3479,6 @@ isearch-message-prefix ;; If currently failing, display no ellipsis. (or isearch-success (setq ellipsis nil)) (let ((m (concat (if isearch-success "" "failing ") - (if isearch-adjusted "pending " "") (if (and isearch-wrapped (not isearch-wrap-function) (if isearch-forward But it was unclear whether it's really justified to remove the message "pending" completely. From unknown Mon Aug 18 02:45:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52356: 27.2; Isearch prompt changes unexpectedly with char folding enabled Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Dec 2021 20:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52356 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Andrea Greselin Cc: 52356@debbugs.gnu.org Received: via spool by 52356-submit@debbugs.gnu.org id=B52356.16389077206386 (code B ref 52356); Tue, 07 Dec 2021 20:09:01 +0000 Received: (at 52356) by debbugs.gnu.org; 7 Dec 2021 20:08:40 +0000 Received: from localhost ([127.0.0.1]:38717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muglU-0001ew-3s for submit@debbugs.gnu.org; Tue, 07 Dec 2021 15:08:40 -0500 Received: from relay10.mail.gandi.net ([217.70.178.230]:37359) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1muglS-0001eh-Ai for 52356@debbugs.gnu.org; Tue, 07 Dec 2021 15:08:39 -0500 Received: (Authenticated sender: juri@linkov.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id E0F18240002; Tue, 7 Dec 2021 20:08:30 +0000 (UTC) From: Juri Linkov Organization: LINKOV.NET References: <868rwwdxrq.fsf@mail.linkov.net> Date: Tue, 07 Dec 2021 22:07:48 +0200 In-Reply-To: <868rwwdxrq.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 07 Dec 2021 21:23:53 +0200") Message-ID: <86tufkch63.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> 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)) -- From unknown Mon Aug 18 02:45:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52356: 27.2; Isearch prompt changes unexpectedly with char folding enabled Resent-From: Andrea Greselin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 10 Dec 2021 10:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52356 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 52356@debbugs.gnu.org Received: via spool by 52356-submit@debbugs.gnu.org id=B52356.16391329491288 (code B ref 52356); Fri, 10 Dec 2021 10:43:01 +0000 Received: (at 52356) by debbugs.gnu.org; 10 Dec 2021 10:42:29 +0000 Received: from localhost ([127.0.0.1]:45599 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvdMD-0000Ki-4d for submit@debbugs.gnu.org; Fri, 10 Dec 2021 05:42:29 -0500 Received: from mail-qv1-f52.google.com ([209.85.219.52]:45768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mvdMA-0000KU-NN for 52356@debbugs.gnu.org; Fri, 10 Dec 2021 05:42:28 -0500 Received: by mail-qv1-f52.google.com with SMTP id s9so7581422qvk.12 for <52356@debbugs.gnu.org>; Fri, 10 Dec 2021 02:42:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=/f0ZR5sPzPpjF3/SZXzwmy0qlmhMDRceEwwMHr2nO9I=; b=JxKR4O57gDcifbOGZaV0xeKzTeXSbN4SFgsNrlsIiMCt0iNZtn6ucvULkaBChnOmPw OQ3ZK2iiVDFi8f5EaL/EsuYdoC4H+y5h0pwKXtlBsjS+OY+hb0bGYCK1iwSKmTTTS8oM ajYRdI70xqzxF44U4eezS7yZ/qLArg0+aD2PGkjYBuXSzwD6tKOuggGo4ZAArLG4hZ6k ic5ZvyCoySnej5mURVNvqVownSZgaAlGMvI8El5N+J5Gwa0j5JRAwWo1Pl45QHwKLuuY WUWBQ5JyyVkodcluaslYTuZoRzn5QAi1b47/qmpUH+QuynMiX18diFxGIpyGK2XtWdfh uY2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=/f0ZR5sPzPpjF3/SZXzwmy0qlmhMDRceEwwMHr2nO9I=; b=Tp9PbQYTcXSBdkDfbk60SmTPDppyPtrsO2C2bFqrjbq3zstO63F6vLeoOGcma5i6Hb R1W0Olc0E4YsDDiKWu6DkV4+PdCxIzMiM9Ah+Kf/Q3jcb1McTwJ7VjKukK3TVv0EyyVl AxJ5aADf1z8B3+JEgSKc3KAK5WJpXbdJ1dEmo8W1DT+WtRZRhjyaotzDEv5vbIHloWJ0 lkA/Bp9qZb0FdoDNZgh3GeocnAqmeegXmlYZhfbXmhCfLaFoubG7PRNcr/NYFz79MsdS zIDWHtBB9mvgjH91Iita5F8EzeZ2vadkN8C9X8iDTOnHgU5uXcRVheE+N/EhJbvBeMH0 TGEg== X-Gm-Message-State: AOAM530B+g8xi2etVAOo6Sqqch+NWrUuhfiCSVVkcCyYG1I1ssYch8mN MYpQWM+OvVKbS7eY3FXhdFCt8WUuFjve4O/7cx5spq7uAoI= X-Google-Smtp-Source: ABdhPJz3RWDc7NnjfuTvCfrw82kFA6GevvikOOeD5NXgaKf9+MSNvb0PnwnyatELxCA+QOieG9sUNuN6T7Bp3BhRWdM= X-Received: by 2002:ad4:5bec:: with SMTP id k12mr23498255qvc.94.1639132940953; Fri, 10 Dec 2021 02:42:20 -0800 (PST) MIME-Version: 1.0 References: <868rwwdxrq.fsf@mail.linkov.net> <86tufkch63.fsf@mail.linkov.net> In-Reply-To: <86tufkch63.fsf@mail.linkov.net> From: Andrea Greselin Date: Fri, 10 Dec 2021 11:41:44 +0100 Message-ID: Content-Type: multipart/alternative; boundary="000000000000af6cda05d2c8608b" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000af6cda05d2c8608b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Juri, your patch works for me. If you=E2=80=99re 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 =E2=80=98memq=E2=80=99 for comparing against a single i= tem. Thanks, Andrea On Tue, 7 Dec 2021 at 21:08, Juri Linkov 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 =E2=80=98lazy-count-*-format=E2=80=99 and =E2=80=98search-de= fault-mode=E2=80=99 (if they all > >> have their default value the prompt is =E2=80=98Pending char-fold I-se= arch:=E2=80=A6=E2=80=99; > >> with the settings described below it=E2=80=99s just =E2=80=98I-search:= =E2=80=A6=E2=80=99, and it > >> changes briefly to =E2=80=98Pending I-search: =E2=80=A6=E2=80=99). > > > > Thanks for the bug report. Some time ago I proposed the following patc= h: > > > > - (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)) > -- > --000000000000af6cda05d2c8608b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello Juri,

your patch works for me. If you=E2=80= =99re going to submit it for merging
you might consider replacing the ol= d line with

=C2=A0 =C2=A0 (or (eq this-command 'isearch-del-char= )

just to avoid using =E2=80=98memq=E2=80=99 for comparing against a= single item.

Thanks,
Andrea

=
On Tue, 7 Dec 2021 at 21:08, Juri Lin= kov <juri@linkov.net> wrote:
>> when I u= se Isearch with char folding enabled, the prompt changes very
>> briefly at every character I type in. The actual prompt depends on= the
>> values of =E2=80=98lazy-count-*-format=E2=80=99 and =E2=80=98searc= h-default-mode=E2=80=99 (if they all
>> have their default value the prompt is =E2=80=98Pending char-fold = I-search:=E2=80=A6=E2=80=99;
>> with the settings described below it=E2=80=99s just =E2=80=98I-sea= rch: =E2=80=A6=E2=80=99, and it
>> changes briefly to =E2=80=98Pending I-search: =E2=80=A6=E2=80=99).=
>
> Thanks for the bug report.=C2=A0 Some time ago I proposed the followin= g patch:
>
> -=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if isearch-a= djusted "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

=C2=A0(defun isearch--lax-regexp-function-p ()
=C2=A0 =C2=A0"Non-nil if next regexp-function call should be lax."= ;
-=C2=A0 (or (memq this-command '(isearch-printing-char isearch-del-char= ))
+=C2=A0 (or (memq this-command '(isearch-del-char))
=C2=A0 =C2=A0 =C2=A0 =C2=A0isearch-yank-flag))
--
--000000000000af6cda05d2c8608b-- From unknown Mon Aug 18 02:45:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52356: 27.2; Isearch prompt changes unexpectedly with char folding enabled Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Dec 2021 20:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52356 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Andrea Greselin Cc: 52356@debbugs.gnu.org Received: via spool by 52356-submit@debbugs.gnu.org id=B52356.16392531311504 (code B ref 52356); Sat, 11 Dec 2021 20:06:01 +0000 Received: (at 52356) by debbugs.gnu.org; 11 Dec 2021 20:05:31 +0000 Received: from localhost ([127.0.0.1]:50038 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mw8cd-0000OC-BU for submit@debbugs.gnu.org; Sat, 11 Dec 2021 15:05:31 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:37489) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mw8cc-0000Nz-Cv for 52356@debbugs.gnu.org; Sat, 11 Dec 2021 15:05:30 -0500 Received: (Authenticated sender: juri@linkov.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 5AAF5FF802; Sat, 11 Dec 2021 20:05:22 +0000 (UTC) From: Juri Linkov Organization: LINKOV.NET References: <868rwwdxrq.fsf@mail.linkov.net> <86tufkch63.fsf@mail.linkov.net> Date: Sat, 11 Dec 2021 22:04:55 +0200 In-Reply-To: (Andrea Greselin's message of "Fri, 10 Dec 2021 11:41:44 +0100") Message-ID: <86tufelxg8.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hello Andrea, > 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. I'm still not sure about this change. Do you think this problem exists only when isearch-lazy-count is customized to t? Do you see the same problem with the "pending" message while using the default value of isearch-lazy-count nil? From unknown Mon Aug 18 02:45:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52356: 27.2; Isearch prompt changes unexpectedly with char folding enabled Resent-From: Andrea Greselin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 11 Dec 2021 20:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52356 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 52356@debbugs.gnu.org Received: via spool by 52356-submit@debbugs.gnu.org id=B52356.16392546663973 (code B ref 52356); Sat, 11 Dec 2021 20:32:01 +0000 Received: (at 52356) by debbugs.gnu.org; 11 Dec 2021 20:31:06 +0000 Received: from localhost ([127.0.0.1]:50081 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mw91O-000121-D9 for submit@debbugs.gnu.org; Sat, 11 Dec 2021 15:31:06 -0500 Received: from mail-qt1-f178.google.com ([209.85.160.178]:46047) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mw91L-00011V-32 for 52356@debbugs.gnu.org; Sat, 11 Dec 2021 15:31:04 -0500 Received: by mail-qt1-f178.google.com with SMTP id p19so11649949qtw.12 for <52356@debbugs.gnu.org>; Sat, 11 Dec 2021 12:31:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=kEJlZ20u6l3mS/vKvJfwgO67TLihjv5A30SsZIsEJrE=; b=UCvUbNfE8N6p4T/k/duLxH0XJdxFIlQy6FhOt2Z0RbGL9OCVF6iOfNuu/FrEE0sg4y GnpDSvlh3w5fe6k3PDQMKlsLNWIFmdnX9xz4FfH8L41n0K5ELyTVsTi7ZzRilMX6ZJwh Xbn4RwdxKMRNWDXAecWv0hW/Y97uBy9/0BKKpNi8u7cGgXUXvJ5MwhwClEY1CECgiKQ2 zXXLy3oURkqtj7b6Lx8rsyRHO+vfu5qr5ddnucjO427R72LuGkouC0H4ePqFazG47eey WC/SaB3mOtcyxEyl7zQSxinrrcemC8K0EexwHS5C0U8kQiJUDnS5DHjx/uRaONBtDi4q TtqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=kEJlZ20u6l3mS/vKvJfwgO67TLihjv5A30SsZIsEJrE=; b=X/tqFNH7MhIPW/yVvFBo6HrGQOfN+oeTwtsbQeDhk33XhGjFk01o74X5UJV3dzaKVY /qFMp8xWyoFSkdV8Eyuj0hNFz1dM5VOGPaphVpa5DJf5do2lSBhGklTj1HuItMXvLthO 92pIrMOTGoCSr6QIrG5nQvRF/RU9etW+GVogb/izgiPhUJ37hlqm2iGrwpIl6UtrmJmz NTLG6EpIpqIxiLFUpuN1dm7tq2dE5M/qZixcuUlt/5AMQtOPY3dyOFZcO26S4GsaiWFG p4w6D7hBqd5b26AiC+swq+N8mmB95MyhZX2QdohFqzQe6iqGkhskeHkyoc24GlB53sH1 uj7Q== X-Gm-Message-State: AOAM530kjYYL6rr87kh58VvBbD/+9LwWDVojflB+p8yIO0AhvgX3X+UD zDy14sUaIFF/Qp90InRHD4ig8iQlet/PmyRiuXXO6F0h6j0= X-Google-Smtp-Source: ABdhPJxyCouuBmWQ5oEX6kAXOxSC5Z8pY2LmvCzO5m0fGS8lpvfnWVSZEwUKElHSWv5yhEqqBG1tlNO7HWvjZX+JRcs= X-Received: by 2002:a05:622a:1350:: with SMTP id w16mr35232671qtk.394.1639254657446; Sat, 11 Dec 2021 12:30:57 -0800 (PST) MIME-Version: 1.0 References: <868rwwdxrq.fsf@mail.linkov.net> <86tufkch63.fsf@mail.linkov.net> <86tufelxg8.fsf@mail.linkov.net> In-Reply-To: <86tufelxg8.fsf@mail.linkov.net> From: Andrea Greselin Date: Sat, 11 Dec 2021 21:30:21 +0100 Message-ID: Content-Type: multipart/alternative; boundary="0000000000008db65005d2e4b7c3" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000008db65005d2e4b7c3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > Do you think this problem exists only when isearch-lazy-count is customised to t? No, I can just launch =E2=80=98emacs -Q=E2=80=99, go to the beginning of th= e buffer and start searching for something with =E2=80=98C-s M-s '=E2=80=99 to get t= he flickering prompt. What the settings in the first message do is change the prompt: it is =E2=80=98Pending char-fold I-search=E2=80=99 without them= (after doing =E2=80=98C-s M-s '=E2=80=99) and just =E2=80=98I-search:=E2=80=99 wit= h them (where just =E2=80=98C-s=E2=80=99 suffices for starting a char-folded search). Your patch works both with and without my settings. I don=E2=80=99t know if there are cases where it suppresses useful messages. On Sat, 11 Dec 2021 at 21:05, Juri Linkov wrote: > Hello Andrea, > > > your patch works for me. If you=E2=80=99re going to submit it for mergi= ng > > you might consider replacing the old line with > > > > (or (eq this-command 'isearch-del-char) > > > > just to avoid using =E2=80=98memq=E2=80=99 for comparing against a sing= le item. > > I'm still not sure about this change. Do you think this problem > exists only when isearch-lazy-count is customized to t? > Do you see the same problem with the "pending" message > while using the default value of isearch-lazy-count nil? > --0000000000008db65005d2e4b7c3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> Do you think this problem exists only when isearch-la= zy-count is
customised to t?

No, I can just launch =E2=80=98emacs= -Q=E2=80=99, go to the beginning of the buffer
and start searching for = something with =E2=80=98C-s M-s '=E2=80=99 to get the
flickering pro= mpt. What the settings in the first message do is change
the prompt: it = is =E2=80=98Pending char-fold I-search=E2=80=99 without them (after
doin= g =E2=80=98C-s M-s '=E2=80=99) and just =E2=80=98I-search:=E2=80=99 wit= h them (where just =E2=80=98C-s=E2=80=99
suffices for starting a char-fo= lded search).

Your patch works both with and without my settings. I = don=E2=80=99t know if
there are cases where it suppresses useful message= s.

On Sat, 11 Dec 2021 at 21:05, Juri Linkov <juri@linkov.net> wrote:
Hello Andrea,

> your patch works for me. If you=E2=80=99re going to submit it for merg= ing
> you might consider replacing the old line with
>
>=C2=A0 =C2=A0 =C2=A0(or (eq this-command 'isearch-del-char)
>
> just to avoid using =E2=80=98memq=E2=80=99 for comparing against a sin= gle item.

I'm still not sure about this change.=C2=A0 Do you think this problem exists only when isearch-lazy-count is customized to t?
Do you see the same problem with the "pending" message
while using the default value of isearch-lazy-count nil?
--0000000000008db65005d2e4b7c3-- From unknown Mon Aug 18 02:45:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52356: 27.2; Isearch prompt changes unexpectedly with char folding enabled Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Dec 2021 17:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52356 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Andrea Greselin Cc: 52356@debbugs.gnu.org Received: via spool by 52356-submit@debbugs.gnu.org id=B52356.16393305528985 (code B ref 52356); Sun, 12 Dec 2021 17:36:02 +0000 Received: (at 52356) by debbugs.gnu.org; 12 Dec 2021 17:35:52 +0000 Received: from localhost ([127.0.0.1]:53021 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwSlM-0002Kq-AJ for submit@debbugs.gnu.org; Sun, 12 Dec 2021 12:35:52 -0500 Received: from relay11.mail.gandi.net ([217.70.178.231]:53639) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mwSlK-0002KS-TH for 52356@debbugs.gnu.org; Sun, 12 Dec 2021 12:35:51 -0500 Received: (Authenticated sender: juri@linkov.net) by relay11.mail.gandi.net (Postfix) with ESMTPSA id DEE34100006; Sun, 12 Dec 2021 17:35:43 +0000 (UTC) From: Juri Linkov Organization: LINKOV.NET References: <868rwwdxrq.fsf@mail.linkov.net> <86tufkch63.fsf@mail.linkov.net> <86tufelxg8.fsf@mail.linkov.net> Date: Sun, 12 Dec 2021 19:30:16 +0200 In-Reply-To: (Andrea Greselin's message of "Sat, 11 Dec 2021 21:30:21 +0100") Message-ID: <86r1ahopzb.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit >> Do you think this problem exists only >> when isearch-lazy-count is customised to t? > > No, I can just launch ‘emacs -Q’, go to the beginning of the buffer > and start searching for something with ‘C-s M-s '’ to get the > flickering prompt. What the settings in the first message do is change > the prompt: it is ‘Pending char-fold I-search’ without them (after > doing ‘C-s M-s '’) and just ‘I-search:’ with them (where just ‘C-s’ > suffices for starting a char-folded search). > > Your patch works both with and without my settings. I don’t know if > there are cases where it suppresses useful messages. A possible variant would be not to flicker too much by transitioning from the message: Pending char-fold I-search: string to 1/20 Pending char-fold I-search: string whereas currently it changes to 1/20 Char-fold I-search: string by removing the prefix "Pending" after a delay. But maybe better not to display "Pending" at all? So with the following patch, adding or removing characters in the search string doesn't show with the message "Pending" in char-fold mode: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=isearch-adjusted-lax.patch diff --git a/lisp/isearch.el b/lisp/isearch.el index 75a80840d6..e3b0c34b4a 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -3479,7 +3479,7 @@ isearch-message-prefix ;; If currently failing, display no ellipsis. (or isearch-success (setq ellipsis nil)) (let ((m (concat (if isearch-success "" "failing ") - (if isearch-adjusted "pending " "") + (if (eq isearch-adjusted t) "pending " "") (if (and isearch-wrapped (not isearch-wrap-function) (if isearch-forward @@ -3586,7 +3586,7 @@ isearch-search-fun-default (let ((lax (and (not bound) (isearch--lax-regexp-function-p)))) (when lax - (setq isearch-adjusted t)) + (setq isearch-adjusted 'lax)) (if (functionp isearch-regexp-function) (funcall isearch-regexp-function string lax) (word-search-regexp string lax)))) --=-=-=-- From unknown Mon Aug 18 02:45:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52356: 27.2; Isearch prompt changes unexpectedly with char folding enabled Resent-From: Andrea Greselin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Dec 2021 19:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52356 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 52356@debbugs.gnu.org Received: via spool by 52356-submit@debbugs.gnu.org id=B52356.163976979416501 (code B ref 52356); Fri, 17 Dec 2021 19:37:01 +0000 Received: (at 52356) by debbugs.gnu.org; 17 Dec 2021 19:36:34 +0000 Received: from localhost ([127.0.0.1]:40669 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myJ1u-0004I4-1h for submit@debbugs.gnu.org; Fri, 17 Dec 2021 14:36:34 -0500 Received: from mail-qt1-f181.google.com ([209.85.160.181]:41850) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1myJ1s-0004Hp-IJ for 52356@debbugs.gnu.org; Fri, 17 Dec 2021 14:36:33 -0500 Received: by mail-qt1-f181.google.com with SMTP id v22so3710506qtx.8 for <52356@debbugs.gnu.org>; Fri, 17 Dec 2021 11:36:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=dekeJOcfE/Tr22+d+OfpwW3T2hDXMQ20cKOM3xoQ8zs=; b=ohofqXsT37bSHkz6WazydWuF1ScaJuoj9WtlEWHt22EGNZBoNclkdDEEzAfKimegM0 DsAaUuFFGWDj0SEPB8dZ0ofHjgNf5lVNP14CwBJFSZDSv7yBd3jCWmhQhlteqmr/tN6p d42K4ROLK8XlszWgFWw/41vVCJ2GPpwBwFlmh2Xgarc5YQTGzxHWxKStuJzty4FIQtx+ +bp20m70p0w77DnFJ3N/89vZdZHyn/DZlX2k9OKnW138BVHbeSIKYZXky6lkykA3lg1J ltspsUcWnmE7SoSrOuA9BSsqcv7z8elOV+/DsZmJZN/H5Ph72YTR7iuxizeuWbw3gOwa +chg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=dekeJOcfE/Tr22+d+OfpwW3T2hDXMQ20cKOM3xoQ8zs=; b=rfTl/XYjfS1zf7dv7+t7q1wnVi4dp6Iwfr52oMb55ScVaLiX6LC5OO9eu3k8/BOKFF g/5BAiB586YiofJIXj+IDuXRYu9CuCrIuBrFd4WOhfymvaId9rQfBWkXgJKtXXVQQpfa r8lFBp4CdX5IFdzK+lcINMQlq8QHe8wujGRFidvrhAG/tKR3am6EmG0nKJi03QIHzmzo 30w/sM0F3z1xQGQphfqaQG1uDhIEqgiJQdpiBCQMOxMuqyopMdU9wxhT0hWo25DAJiwg x6ZxRtkodls6tv8g8neAzf3SScEG1ZYUzGvecZ7+p95+TRQt/LFOJY89O0h+7DcJA+h7 gJ3g== X-Gm-Message-State: AOAM533fFrNf3KsOvkCx/ATfYcj39EOkgngfHKGoE0A/t6di+wPCQaXV s067I7AH68tULmdQad87G5WyEKs3czNumO8mQdidXCqKBlk= X-Google-Smtp-Source: ABdhPJwjazcsVrqWZT71gRB+zunUFjXDPHDN/ZHRADdho0I0Ln/3qU/gLxoMt/bzMxiRyOpQ5BsSmgm0WlJCABrQ9Io= X-Received: by 2002:a05:622a:5ca:: with SMTP id d10mr3743727qtb.603.1639769786830; Fri, 17 Dec 2021 11:36:26 -0800 (PST) MIME-Version: 1.0 References: <868rwwdxrq.fsf@mail.linkov.net> <86tufkch63.fsf@mail.linkov.net> <86tufelxg8.fsf@mail.linkov.net> <86r1ahopzb.fsf@mail.linkov.net> In-Reply-To: <86r1ahopzb.fsf@mail.linkov.net> From: Andrea Greselin Date: Fri, 17 Dec 2021 20:35:50 +0100 Message-ID: Content-Type: multipart/alternative; boundary="000000000000a8520805d35ca750" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000a8520805d35ca750 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Juri, thanks for your help. I=E2=80=99ve tested your latest patch in two ways and in both tests the pro= mpt didn=E2=80=99t flicker on adding letters to the search string. So it looks fine to me. > A possible variant would be not to flicker too much by > transitioning from the message: > > Pending char-fold I-search: string > > to > > 1/20 Pending char-fold I-search: string If I understand it correctly the jittering there is all due to =E2=80=98lazy-count-prefix-format=E2=80=99 being non-nil. If you set it to = nil (and use =E2=80=98lazy-count-suffix-format=E2=80=99 to display the counter) then= you have no jittering at all. > But maybe better not to display "Pending" at all? I personally don=E2=80=99t like delayed changes to graphical elements, so I= =E2=80=99d say yes. Now I'm curious though, what=E2=80=98s the meaning of =E2=80=9Cpending=E2= =80=9D in the context of Isearch? Anyway, these were my tests: 1) Run =E2=80=98emacs -Q=E2=80=99, evaluate functions with your patch. At e= ach step on the left I get the prompt on the right: C-s =E2=86=92 I-search: M-s ' =E2=86=92 Pending char-fold I-search: Type smth =E2=86=92 Char-fold I-search: Type smth 2) Run =E2=80=98emacs -Q=E2=80=99, evaluate my settings and the functions w= ith your patch. Result: C-s =E2=86=92 I-search: (At this point the search is already being done with char-folding enabled because of my settings.) Type smth =E2=86=92 I-search: Type smth [0/0] Here are my settings and the patched functions, for convenience. (setq isearch-lazy-count t) (setq lazy-count-prefix-format nil lazy-count-suffix-format " [%s/%s]") (setq-local search-default-mode 'char-fold-to-regexp) (electric-quote-local-mode) (defun isearch-message-prefix (&optional ellipsis nonincremental) ;; If about to search, and previous search regexp was invalid, ;; check that it still is. If it is valid now, ;; let the message we display while searching say that it is valid. (and isearch-error ellipsis (condition-case () (progn (re-search-forward isearch-string (point) t) (setq isearch-error nil)) (error nil))) ;; If currently failing, display no ellipsis. (or isearch-success (setq ellipsis nil)) (let ((m (concat (if isearch-success "" "failing ") (if (eq isearch-adjusted t) "pending " "") (if (and isearch-wrapped (not isearch-wrap-function) (if isearch-forward (> (point) isearch-opoint) (< (point) isearch-opoint))) "over") (if isearch-wrapped "wrapped ") (if (and (not isearch-success) (not isearch-case-fold-search)) "case-sensitive ") (let ((prefix "")) (advice-function-mapc (lambda (_ props) (let ((np (cdr (assq 'isearch-message-prefix props)))) (if np (setq prefix (concat np prefix))))) isearch-filter-predicate) prefix) (isearch--describe-regexp-mode isearch-regexp-function) (cond (multi-isearch-file-list "multi-file ") (multi-isearch-buffer-list "multi-buffer ") (t "")) (or isearch-message-prefix-add "") (if nonincremental "search" "I-search") (if isearch-forward "" " backward") (if current-input-method ;; Input methods for RTL languages use RTL ;; characters for their title, and that messes ;; up the display of search text after the prompt. (bidi-string-mark-left-to-right (concat " [" current-input-method-title "]: ")) ": ") ))) (apply #'propertize (concat (isearch-lazy-count-format) (upcase (substring m 0 1)) (substring m 1)) isearch-message-properties))) (defun isearch-search-fun-default () "Return default functions to use for the search." (lambda (string &optional bound noerror count) (let (;; Evaluate this before binding `search-spaces-regexp' which ;; can break all sorts of regexp searches. In particular, ;; calling `isearch-regexp-function' can trigger autoloading ;; (Bug#35802). (regexp (cond (isearch-regexp-function (let ((lax (and (not bound) (isearch--lax-regexp-function-p)))) (when lax (setq isearch-adjusted 'lax)) (if (functionp isearch-regexp-function) (funcall isearch-regexp-function string lax) (word-search-regexp string lax)))) (isearch-regexp string) (t (regexp-quote string)))) ;; Use lax versions to not fail at the end of the word while ;; the user adds and removes characters in the search string ;; (or when using nonincremental word isearch) (search-spaces-regexp (when (if isearch-regexp isearch-regexp-lax-whitespace isearch-lax-whitespace) search-whitespace-regexp))) (funcall (if isearch-forward #'re-search-forward #'re-search-backward) regexp bound noerror count)))) --000000000000a8520805d35ca750 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Juri, thanks for your help.
I=E2=80=99ve tested your= latest patch in two ways and in both tests the prompt
didn=E2=80=99t fl= icker on adding letters to the search string. So it looks
fine to me.
> A possible variant would be not to flicker too much by
> tr= ansitioning from the message:
>
> =C2=A0 Pending char-fold I-se= arch: string
>
> to
>
> =C2=A0 1/20 Pending char-fo= ld I-search: string

If I understand it correctly the jittering there= is all due to
=E2=80=98lazy-count-prefix-format=E2=80=99 being non-nil.= If you set it to nil (and
use =E2=80=98lazy-count-suffix-format=E2=80= =99 to display the counter) then you have
no jittering at all.

&g= t; But maybe better not to display "Pending" at all?

I per= sonally don=E2=80=99t like delayed changes to graphical elements, so I=E2= =80=99d
say yes.

Now I'm curious though, what=E2=80=98s the m= eaning of =E2=80=9Cpending=E2=80=9D in the context
of Isearch?

An= yway, these were my tests:

1) Run =E2=80=98emacs -Q=E2=80=99, evalua= te functions with your patch. At each step on
=C2=A0 =C2=A0the left I ge= t the prompt on the right:

=C2=A0 =C2=A0C-s =C2=A0 =C2=A0 =C2=A0 =E2= =86=92 I-search:
=C2=A0 =C2=A0M-s ' =C2=A0 =C2=A0 =E2=86=92 Pending = char-fold I-search:
=C2=A0 =C2=A0Type smth =E2=86=92 Char-fold I-search:= Type smth

2) Run =E2=80=98emacs -Q=E2=80=99, evaluate my settings a= nd the functions with your
=C2=A0 =C2=A0patch. Result:

=C2=A0 =C2= =A0C-s =C2=A0 =C2=A0 =C2=A0 =E2=86=92 I-search:

=C2=A0 =C2=A0(At thi= s point the search is already being done with char-folding
=C2=A0 =C2=A0= enabled because of my settings.)

=C2=A0 =C2=A0Type smth =E2=86=92 I-= search: Type smth [0/0]

Here are my settings and the patched functio= ns, for convenience.

=C2=A0 =C2=A0 (setq isearch-lazy-count t)
= =C2=A0 =C2=A0 (setq lazy-count-prefix-format nil
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 lazy-count-suffix-format " [%s/%s]")
=C2=A0 =C2= =A0 (setq-local search-default-mode 'char-fold-to-regexp)
=C2=A0 =C2= =A0 (electric-quote-local-mode)

=C2=A0 =C2=A0 (defun isearch-message= -prefix (&optional ellipsis nonincremental)
=C2=A0 =C2=A0 =C2=A0 ;; = If about to search, and previous search regexp was invalid,
=C2=A0 =C2= =A0 =C2=A0 ;; check that it still is.=C2=A0 If it is valid now,
=C2=A0 = =C2=A0 =C2=A0 ;; let the message we display while searching say that it is = valid.
=C2=A0 =C2=A0 =C2=A0 (and isearch-error ellipsis
=C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0(condition-case ()
=C2=A0 =C2=A0 =C2=A0 (pro= gn (re-search-forward isearch-string (point) t)
=C2=A0 =C2=A0 =C2=A0(set= q isearch-error nil))
=C2=A0 =C2=A0 (error nil)))
=C2=A0 =C2=A0 =C2= =A0 ;; If currently failing, display no ellipsis.
=C2=A0 =C2=A0 =C2=A0 (= or isearch-success (setq ellipsis nil))
=C2=A0 =C2=A0 =C2=A0 (let ((m (c= oncat (if isearch-success "" "failing ")
=C2=A0 =C2= =A0 =C2=A0 (if (eq isearch-adjusted t) "pending " "")=C2=A0 =C2=A0 (if (and isearch-wrapped
=C2=A0 =C2=A0 =C2=A0 =C2=A0(not= isearch-wrap-function)
=C2=A0 =C2=A0 =C2=A0 =C2=A0(if isearch-forward=C2=A0 =C2=A0 (> (point) isearch-opoint)
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(< (point) isearch-opoint)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 "over")
=C2=A0 =C2=A0 =C2=A0 (if isearch-wrapped "= wrapped ")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0(if (and (not isearch-success) (not isearch-case= -fold-search))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"case-sensitive ")
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(let ((prefix ""))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(advice-function= -mapc
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 (lambda (_ props)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let = ((np (cdr (assq 'isearch-message-prefix props))))
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 (if np (setq prefix (concat np prefix)))))
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 isearch-filter-predicate)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0prefix)
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(isear= ch--describe-regexp-mode isearch-regexp-function)
=C2=A0 =C2=A0 =C2=A0 (= cond
=C2=A0 =C2=A0 =C2=A0 =C2=A0(multi-isearch-file-list "multi-fil= e ")
=C2=A0 =C2=A0 =C2=A0 =C2=A0(multi-isearch-buffer-list "mu= lti-buffer ")
=C2=A0 =C2=A0 =C2=A0 =C2=A0(t ""))
=C2= =A0 =C2=A0 =C2=A0 (or isearch-message-prefix-add "")
=C2=A0 = =C2=A0 =C2=A0 (if nonincremental "search" "I-search")=C2=A0 =C2=A0 =C2=A0 (if isearch-forward "" " backward&quo= t;)
=C2=A0 =C2=A0 =C2=A0 (if current-input-method
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 ;; Input methods for RTL languages use RTL
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 ;; characters for their title, and that messes
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; up the display of search text after t= he prompt.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (bidi-string-mark-left-to-= right
=C2=A0 =C2=A0 (concat " [" current-input-method-title &q= uot;]: "))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ": ")
=C2=A0 = =C2=A0 =C2=A0 )))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (apply #'propertize (c= oncat (isearch-lazy-count-format)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (upcase (substr= ing m 0 1)) (substring m 1))
=C2=A0 =C2=A0 =C2=A0 isearch-message-proper= ties)))

=C2=A0 =C2=A0 (defun isearch-search-fun-default ()
=C2=A0= =C2=A0 =C2=A0 "Return default functions to use for the search."<= br>=C2=A0 =C2=A0 =C2=A0 (lambda (string &optional bound noerror count)<= br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 (let (;; Evaluate this before binding `searc= h-spaces-regexp' which
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 ;; can break all sorts of regexp searches.=C2=A0 In particular,
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; calling `isearch-regexp-fu= nction' can trigger autoloading
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 ;; (Bug#35802).
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 (regexp
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(c= ond (isearch-regexp-function
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (let ((lax (and (not bound)
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (isearch--lax-regexp-f= unction-p))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 (when lax
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (setq isearch-adju= sted 'lax))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 (if (functionp isearch-regexp-function)
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 (funcall isearch-regexp-function string lax)
=C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 (word-search-regexp string lax))))
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(isearch-regexp string)=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0(t (regexp-quote string))))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 ;; Use lax versions to not fail at the end of the word while
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; the user adds and remov= es characters in the search string
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 ;; (or when using nonincremental word isearch)
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (search-spaces-regexp (when (if isea= rch-regexp
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 isearch-regexp-lax-whitespace
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 isearch-= lax-whitespace)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 search-whitespace-regexp)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (func= all
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(if isearch-forward #'r= e-search-forward #'re-search-backward)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0regexp bound noerror count))))
--000000000000a8520805d35ca750-- From unknown Mon Aug 18 02:45:23 2025 X-Loop: help-debbugs@gnu.org Subject: bug#52356: 27.2; Isearch prompt changes unexpectedly with char folding enabled Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Dec 2021 17:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52356 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Andrea Greselin Cc: 52356@debbugs.gnu.org Received: via spool by 52356-submit@debbugs.gnu.org id=B52356.163993614430593 (code B ref 52356); Sun, 19 Dec 2021 17:50:02 +0000 Received: (at 52356) by debbugs.gnu.org; 19 Dec 2021 17:49:04 +0000 Received: from localhost ([127.0.0.1]:48029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mz0Ix-0007xM-VL for submit@debbugs.gnu.org; Sun, 19 Dec 2021 12:49:04 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:35091) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mz0Iv-0007wl-UY; Sun, 19 Dec 2021 12:49:02 -0500 Received: (Authenticated sender: juri@linkov.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id C429B60006; Sun, 19 Dec 2021 17:48:52 +0000 (UTC) From: Juri Linkov Organization: LINKOV.NET References: <868rwwdxrq.fsf@mail.linkov.net> <86tufkch63.fsf@mail.linkov.net> <86tufelxg8.fsf@mail.linkov.net> <86r1ahopzb.fsf@mail.linkov.net> Date: Sun, 19 Dec 2021 19:48:19 +0200 In-Reply-To: (Andrea Greselin's message of "Fri, 17 Dec 2021 20:35:50 +0100") Message-ID: <86bl1cfpuk.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) close 52356 29.0.50 thanks > I’ve tested your latest patch in two ways and in both tests the prompt > didn’t flicker on adding letters to the search string. So it looks > fine to me. Thanks for testing. So now pushed to Emacs 29. >> A possible variant would be not to flicker too much by >> transitioning from the message: >> >> Pending char-fold I-search: string >> >> to >> >> 1/20 Pending char-fold I-search: string > > If I understand it correctly the jittering there is all due to > ‘lazy-count-prefix-format’ being non-nil. If you set it to nil (and > use ‘lazy-count-suffix-format’ to display the counter) then you have > no jittering at all. Indeed, there is no jittering when the count is at the end of I-search message. >> But maybe better not to display "Pending" at all? > > I personally don’t like delayed changes to graphical elements, so I’d > say yes. > > Now I'm curious though, what‘s the meaning of “pending” in the context > of Isearch? “Pending” was intended to say the current search state might not correspond to the search string until the user types C-s or C-r to search for the next match. But this should be obvious without this prefix message.