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

From: Eli Zaretskii <[email-masked]>
Date: Wed, 13 Dec 2023 14:10:35 +0200

> From: Stefan Monnier <[email-masked]>
> Cc: Ihor Radchenko <[email-masked]>,  Eli Zaretskii <[email-masked]>,
>   [email-masked]
> Date: Tue, 12 Dec 2023 22:55:15 -0500
> 
> > That sounds attractive (ignoring all buffer-locals when let-bound?),
> > but I'm guessing there are enough valid use cases for this behavior.
> 
> Yup, that would break lots of existing code, indeed, and in subtle
> enough ways that people would go crazy.
> 
> Luckily, there's no "100% ideal" way buffer-local and scoped bindings
> can interact.  All choices suck in some circumstances, so there's really
> no good reason to lament the current choice: it's no worse than
> the alternatives, AFAIK.

Btw, the title of this bug is about find-buffer-visiting, and AFAIR I
proposed to have a primitive written in C that replaces
find-buffer-visiting without a need to actually switch to each buffer
(which is what triggers the costly rebinding of buffer-local variables
like case-fold-search).  So why we are talking about case-fold-search
instead of solving the original problem?  If we want to discuss the
case-fold-search issue, IMO we should discuss it in a separate bug
report.