help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Why does saving a buffer to a new file clear local variables?


From: Michael Heerdegen
Subject: Re: Why does saving a buffer to a new file clear local variables?
Date: Thu, 12 Dec 2024 14:01:32 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Jean Louis <bugs@gnu.support> writes:

> > Are you sure that you don't just see the global binding of that
> > variable?
>
> Unless you wish to reveal some new fact about it to me, I see that by
> using `defvar-local' I can save file and variable `abc' still has
> initially assigned value.
>
> And it has this description:
>
> abc’s value is 123
>
> Not documented as a variable.
>
>   Automatically becomes buffer-local when set.

That's the global binding.  A buffer local binding is reported as "local
in buffer XYZ" - even when the local binding is the same as the global
one.

`defvar-local' defines a global (aka "default") value.  Until you make an
assignment in some buffer no buffer local bindings exist.


Michael.




reply via email to

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