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:52:33 +0000

Eli Zaretskii <[email-masked]> writes:

>> The messages you linked to discuss problems with _other_ proposed
>> approaches.
>
> Maybe I'm confused, but won't this change have at least _some_ effect
> on Lisp programs?  For example, what about this fragment from the
> ELisp manual, which describes the effect of
> make-variable-buffer-local:
>
>      A peculiar wrinkle of this feature is that binding the variable
>      (with ‘let’ or other binding constructs) does not create a
>      buffer-local binding for it.  Only setting the variable (with ‘set’
>      or ‘setq’), while the variable does not have a ‘let’-style binding
>      that was made in the current buffer, does so.
>
> Will this case work the same after the change as it did before?

I read this differently - when you have

   (let ((var 'val))
    (make-variable-buffer-local 'var))

it will not set buffer-local value to 'val.
You have to set the buffer value explicitly via set/setq outside let
context.

And the patch makes `case-fold-search' buffer-local internally. Nothing
needs to call (make-variable-buffer-local 'case-fold-search).

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