GNU bug report logs - #66117
30.0.50; `find-buffer-visiting' is slow when opening large number of buffers

Previous Next

Package: emacs;

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


View this message in rfc822 format

From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
To: Ihor Radchenko <yantar92 <at> posteo.net>
Cc: 66117 <at> debbugs.gnu.org, dmitry <at> gutov.dev, Eli Zaretskii <eliz <at> gnu.org>, mattias.engdegard <at> gmail.com, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: bug#66117: 30.0.50; `find-buffer-visiting' is slow when opening large number of buffers
Date: Tue, 02 Jan 2024 13:57:44 +0100
Ihor Radchenko <yantar92 <at> posteo.net> writes:

> Gerd Möllmann <gerd.moellmann <at> gmail.com> writes:
>
>>> Both versions are actually clear for me. What was not clear for me is
>>> how the docstring explains my `let' example.
>>
>> Sorry, I've lost track what the let example is. 
>
> (defvar-local eval-tests/buffer-local-var 'default-value)
>

Thanks. 

> (with-temp-buffer
>     (setq-local eval-tests/buffer-local-var 'local-value)
>     (let ((eval-tests/buffer-local-var 'let-value))
>       ;; Let in a buffer with local binding does not change the
>       ;; default value for variable.
>       (should (eq 'default-value (default-value
>     'eval-tests/buffer-local-var)))))

I assume this is clear. Temp buffer has local value, the let changes the
local (current) value, default-value determines the value as if the
local values weren't there, and so on.

>
> (with-temp-buffer
>     ;; (setq-local eval-tests/buffer-local-var 'local-value)
>     (let ((eval-tests/buffer-local-var 'let-value))
>       ;; Let in a buffer with local binding does not change the
>       ;; default value for variable.
>       (should (eq 'let-value (default-value 'eval-tests/buffer-local-var)))))

Here, temp has no local value, so the current value is the global one.
Let changes the global (current) value, and default-value picks that up.

In both cases, I don't know if that's mentioned explicitly in some doc
string. It's the normal behavior of let with special variables (dynamic
variables). The current value that is set changes depending on
circumstances.




This bug report was last modified 1 year and 135 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.