unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Andrea Greselin <greselin.andrea@gmail.com>
Cc: 52394@debbugs.gnu.org
Subject: bug#52394: 27.2; Isearch with char folding enabled doesn’t match equivalent strings
Date: Fri, 10 Dec 2021 09:51:06 +0200	[thread overview]
Message-ID: <86ilvwkidx.fsf@mail.linkov.net> (raw)
In-Reply-To: <CAJ_oJbZMCgcoeHYfOvy7gWr=N0bdDdk0Wjg9XRUA3MrppUqoLQ@mail.gmail.com> (Andrea Greselin's message of "Thu, 9 Dec 2021 21:41:33 +0100")

> Launch `emacs -Q`, paste these four lines on a buffer
>
> aaaaaaaaa'aaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaa'aaaaaaaaaaaaaaaaaaa'aaaaaaaaaa
> aaaaaaaaa’aaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaa’aaaaaaaaaaaaaaaaaaa’aaaaaaaaaa
>
> nnnnnnnnn'nnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnn'nnnnnnnnnnnnnnnnnnn'nnnnnnnnnn
> nnnnnnnnn’nnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnn’nnnnnnnnnnnnnnnnnnn’nnnnnnnnnn
>
> Search for the first one with char folding enabled. In my system Emacs
> doesn’t match the second line. It matches after I hit ‘C-M-d’ to
> delete the last character from the search query.
>
> If you search with char folding enabled for the third line then it
> does match the fourth, even though the third and the fourth lines are
> just copies of the first two with the a’s replaced by n’s.

Please note that when the search string is too long for char folding,
then it displays the message at the end of the Isearch prompt
before disabling char folding:

  "Too many words; switched to literal mode"

Char folding is regexp-based and converts the search string
into a very long regexp that matches all character variants.
But the regexp have limitations when matching runs out of
internal stack space.  This is described in the Info node:

  (info "(elisp) Regexp Problems")

For example, my stack is longer than yours, so the second line
of the described case matches with line length of 74 characters.
But the search still switches to literal mode on 87 characters.





  parent reply	other threads:[~2021-12-10  7:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09 20:41 bug#52394: 27.2; Isearch with char folding enabled doesn’t match equivalent strings Andrea Greselin
2021-12-10  2:00 ` Michael Heerdegen
2021-12-10  7:51 ` Juri Linkov [this message]
2021-12-10 11:00   ` Andrea Greselin
2021-12-11 19:46     ` Juri Linkov
2021-12-11 20:13       ` Andrea Greselin
2021-12-11 20:34         ` Juri Linkov
2021-12-11 21:14           ` Andrea Greselin
2021-12-12  8:37             ` Juri Linkov
2021-12-12  9:31               ` Andrea Greselin
2021-12-12 17:19                 ` Juri Linkov
2021-12-12 17:53                   ` Eli Zaretskii
2021-12-12 18:06                     ` Juri Linkov
2021-12-12 18:25                       ` Eli Zaretskii
2021-12-12 18:30                         ` Juri Linkov
2021-12-12 18:43                           ` Eli Zaretskii
2021-12-12 18:54                             ` Juri Linkov
2021-12-12 18:59                               ` Eli Zaretskii
2021-12-12 19:12                                 ` 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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86ilvwkidx.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=52394@debbugs.gnu.org \
    --cc=greselin.andrea@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).