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

From: Ihor Radchenko <[email-masked]>
Date: Thu, 14 Dec 2023 14:20:18 +0000

Eli Zaretskii <[email-masked]> writes:

>> ... and syntax-table can be set in text properties; so not just affected
>> by current buffer - also by position in buffer.
>
> If you search the buffer text, then having syntax-table on that text
> is less surprising: after all, it only affects the text which has this
> property.
>
> But buffer-local case-table is much more subtle: it is in effect even
> if you match strings, not portions of buffer text, and only because
> some buffer _happens_ to be the current buffer when, say, string-match
> is called.

Good point. I did not even think about this subtlety.
Then, I think that having a global variable like
`case-fold-search-override' could make things more predictable if we
advertise it for let-bindings.
Also, it is much easier to implement.
WDYT?

>> In the past, me and Mattias Engdegård even discussed a possibility to
>> incorporate case-fold-search flag into regexps directly
>> (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63225#74)
>> That way, things would be less affected by the buffer-locals.
>
> Indeed.

There are multiple ways to implement this. Though I think that this part
of the discussion should continue in bug#63225 or even a separate
feature request.

-- 
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>