Subject: 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:56:45 +0000

Eli Zaretskii <[email-masked]> writes:

> Also, re this part of the patch:
>
>> +  DEFVAR_LISP ("case-fold-search", Vcase_fold_search,
>> +	       doc: /* Non-nil if searches and matches should ignore case.  */);
>> +  Vcase_fold_search = Qt;
>> +  DEFSYM (Qcase_fold_search, "case-fold-search");
>> +  Fmake_variable_buffer_local (Qcase_fold_search);
>
> Which value does this set to t -- the global default?  Isn't that
> different from what we had before?

AFAIU, not different. Previously, we had

> @@ -4785,7 +4779,6 @@ init_buffer_once (void)
>    bset_tab_line_format (&buffer_defaults, Qnil);
>    bset_abbrev_mode (&buffer_defaults, Qnil);
>    bset_overwrite_mode (&buffer_defaults, Qnil);
> -  bset_case_fold_search (&buffer_defaults, Qt);

So, the default value was Qt previously as well.

The DEFVAR_LISP + V... + DEFSYM + Fmake_variable_buffer_local is taken
from other buffer-local variables. For example,

  DEFVAR_LISP ("display-line-numbers-width", Vdisplay_line_numbers_width,
    doc: /* Minimum width of space reserved for line number display.
A positive number means reserve that many columns for line numbers,
even if the actual number needs less space.
The default value of nil means compute the space dynamically.
Any other value is treated as nil.  */);
  Vdisplay_line_numbers_width = Qnil;
  DEFSYM (Qdisplay_line_numbers_width, "display-line-numbers-width");
  Fmake_variable_buffer_local (Qdisplay_line_numbers_width);

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