emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 00/16] Speeding up DEFVAR_PER_BUFFER


From: Stefan Monnier
Subject: Re: [PATCH v2 00/16] Speeding up DEFVAR_PER_BUFFER
Date: Tue, 01 Dec 2020 11:01:12 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> So in effect we make every access to built-in buffer-local variables
> pay for the single use case when the let-binding is done in a buffer
> that has no local value.

Yup, increase the average time taken in order to avoid the
"pathological" worst case.

BTW, for the original problem (i.e. let-binding case-fold-search in
a buffer that doesn't have a buffer-local setting of that variable), we
could attack the problem in a different way:

1- change `case-fold-search` to a plain DEFVAR_LISP instead of a PER_BUFFER.
2- change its `let-binding` rule so it automatically becomes buffer-local
   within the `let` (i.e. the let-binding stops affecting other buffers).


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]