GNU bug report logs -
#66117
30.0.50; `find-buffer-visiting' is slow when opening large number of buffers
Previous Next
Reported by: Ihor Radchenko <yantar92 <at> posteo.net>
Date: Wed, 20 Sep 2023 08:53:02 UTC
Severity: minor
Found in version 30.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #438 received at 66117 <at> debbugs.gnu.org (full text, mbox):
Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:
>>>> (defvar-local let-tests-buffer-local-var 'value)
>>>> (with-temp-buffer
>>>> (setq-local let-tests-buffer-local-var 'baz)
>>>> (let ((let-tests-buffer-local-var 'bar))
>>>> ;; This is failing.
>>>> (should (eq 'bar (default-value 'let-tests-buffer-local-var)))
>>>
>>> C-h f default-value explains this:
>>>
>>> Return SYMBOL’s default value.
>>> This is the value that is seen in buffers that do not have their own values
>>> for this variable.
>>
>> Are you saying that `let' never changes `default-value' output?
>
> Not really. I tried to explain why default-value, in this case, returns
> what it returns.
I am sorry, but I do not see how the docstring explains what is
happening there. Because it is not clear what `let' does with the
default value.
>> Unfortunately, no.
>
> Maybe you are seeing something like bug#65209? Or the fix done by Stefan
> Monnier in the course of that bug? (See the mails under the bug.)
I am on the latest master.
And I do not think that it is bug#65209.
Let me simplify my example to avoid `setq-local' inside `let'.
AFAIU, what `let' does to the default value depends on whether current
buffer has its own local value of the variable or not.
(defvar-local let-tests-buffer-local-var2 'value) ;; default value is 'value
(with-temp-buffer
(setq-local let-tests-buffer-local-var2 'baz)
(let ((let-tests-buffer-local-var2 'bar))
;; Let does not change the default value for variable.
(should (eq 'value (default-value 'let-tests-buffer-local-var2)))
(should (eq 'bar let-tests-buffer-local-var2))
(with-temp-buffer
;; We are in a new buffer - `let-tests-buffer-local-var2' has its global default value.
(should (eq 'value (default-value 'let-tests-buffer-local-var2)))
(should (eq 'value let-tests-buffer-local-var2)))))
(with-temp-buffer
;; !!! After commenting out this line, the behaviour changes.
;; (setq-local let-tests-buffer-local-var2 'baz)
(let ((let-tests-buffer-local-var2 'bar))
;; Now, let DOES change the default value for variable.
(should (eq 'bar (default-value 'let-tests-buffer-local-var2)))
(should (eq 'bar let-tests-buffer-local-var2))
(with-temp-buffer
;; We are in a new buffer - `let-tests-buffer-local-var2' still has
;; let-bound global and local values.
(should (eq 'bar (default-value 'let-tests-buffer-local-var2)))
(should (eq 'bar let-tests-buffer-local-var2)))))
--
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>
This bug report was last modified 1 year and 136 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.