[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ASCII-folded search [was: Re: Upcoming loss of usability ...]

From: Eli Zaretskii
Subject: Re: ASCII-folded search [was: Re: Upcoming loss of usability ...]
Date: Thu, 18 Jun 2015 11:46:44 +0300

> Date: Thu, 18 Jun 2015 09:16:16 +0100
> From: Artur Malabarba <address@hidden>
> Cc: "Stephen J. Turnbull" <address@hidden>, emacs-devel <address@hidden>, 
>       Stefan Monnier <address@hidden>
> If we're bringing this up again, I kindly suggest that people have a
> look a previous thread here called "Character group folding in
> searches". Here's the link:
> https://lists.gnu.org/archive/html/emacs-devel/2015-02/msg00362.html
> It offers 3 implementations. I think the second
> (group-folding-with-case-table-lisp.patch) was quite adequade.
> The only reason it wasn't applied is that Eli and Stefan wanted
> something that also matched non-spacing marks, or composite
> characters, whereas case tables can only map single characters to
> single characters.
> The first implementation (group-folding-with-regexp-lisp.patch) didn't
> have this caveat because it didn't use this case-tables. The only
> caveat it had is that it only works for non-regexp searches.
> Attached are the two patches I mentioned here.

Perhaps we should install the first one, it at least solves part of
the problem.  But I think it has a subtle bug: it assumes that
get-char-code-property returns value of the form '(SOMETHING CH1 ...)',
where CH1 is necessarily the character we want.  However, that is
false at least in some cases, for example:

  (get-char-code-property ?🄝 'decomposition) => (compat 40 78 41)

So I think perhaps we should subject the return value of
get-char-code-property to a few more tests, and either reject such
values, or maybe find the first character that matches [:alnum:], and
use that.

Btw, can the other patch be installed _in_addition_ to the first one?
IOW, they are orthogonal, or could be that, right?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]