Subject: Re: bug#66117: 30.0.50; `find-buffer-visiting' is slow when opening large number of buffers

From: Ihor Radchenko <[email-masked]>
Date: Sun, 17 Dec 2023 10:31:50 +0000

Eli Zaretskii <[email-masked]> writes:

>> AFAIK this is a purely internal change with no visible effect at the
>> ELisp level

> It sounds like there will be some effect on some Lisp programs, at
> least in some cases, and if so, we should mention those cases, even if
> we think they are rare.

We have discussed a number of approaches to handle the let-binding
performance and to handle sometimes-confusing behaviour of
`case-fold-search'. Most of them had problems with breaking the existing
behaviour or potentially causing unexpected side effects. Except the one
I used in the patch.

The messages you linked to discuss problems with _other_ proposed
approaches.

> ??? Then what were these about:
>
>   https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66117#199

This is about an idea to make let-binding the `case-fold-search' affect
current buffer only, but never other buffers.
What the patch does is different - it turns `case-fold-search' into an
ordinary buffer-local variable, like the ones defined from Elisp.

>   https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66117#217
>   https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66117#283

These two are about creating a new case-fold-search-override that
ignores buffer-local bindings. Again, a different idea.

>   https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66117#295

This was not about this patch, but about a more general problem of
case-fold-search serving two purposes - user setting for interactive
searches and internal regexp search switch.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>