emacs-devel
[Top][All Lists]
Advanced

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

Re: master 48aacbf292 2/2: Make many seldom-used generalized variables o


From: Augusto Stoffel
Subject: Re: master 48aacbf292 2/2: Make many seldom-used generalized variables obsolete
Date: Mon, 19 Sep 2022 14:35:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

On Mon, 19 Sep 2022 at 14:22, Lars Ingebrigtsen wrote:

> Augusto Stoffel <arstoffel@gmail.com> writes:
>
>> Is it possible at all to set a variable buffer-locally but outside any
>> let-bindings?
>
> That's what `setq-local' does (but you have to switch to the buffer
> first).

set-local just relies on set, so if the variable is let-bound, then the
"toplevel" local value is unchanged:

   (progn (setq-local x 1)
          (let (x) (setq-local x 2))
          x)
   ==> 1

I've had some trouble with this when a major mode (and therefore its
mode hook) is called from a place with let-bound variables.  But then
one could argue that working around it is even more problematic...



reply via email to

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