Subject: bug#64652: 28.2; Adding a property bug on Windows 11

From: Mattias Engdegård <[email-masked]>
Date: Sun, 16 Jul 2023 13:07:01 +0200

16 juli 2023 kl. 12.25 skrev Ihor Radchenko <[email-masked]>:

> Eli Zaretskii <[email-masked]> writes:
> 
>>> Hmm... One way could be modifying regexps to something like
>>> [Pp][Rr][Oo][Pp][Ee][Rr][Tt][Ii][Ee][Ss]. May Emacs provide something
>>> like (regexp-case-quote REGEXP &optional CASE-TABLE)?
>> 
>> What would regexp-case-quote do with REGEXP?
>> 
>> Regarding [Pp][Rr] etc.: does this have any significant effect on
>> performance, due to use of character classes?

Yes, that would be substantially slower. The regexp engine combines sequences of literal characters into literal strings that are matched atomically, without either the overhead of individual NFA ops or pushing backtracking points on the NFA stack for each character.

Indeed a quick micro-benchmark bears that out.

How much that affects performance overall is a different matter and can only be answered by measuring.

In general we should make an effort to stop the user's locale leaking into elisp code logic. Ideally, case-folding should be property of a regexp or part of it, not controlled by a user-customisable global variable.

I'm just waiting for the horde of irate Turkish Pascal programmers to complain about broken font-lock.