[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: |
Jean Louis |
Subject: |
Re: Why does saving a buffer to a new file clear local variables? |
Date: |
Thu, 12 Dec 2024 21:31:27 +0300 |
User-agent: |
Mutt/2.2.12 (2023-09-09) |
* Michael Heerdegen via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> [2024-12-12 16:02]:
> 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.
Okay, I am lost, will review it again when I need it, even though I use heavily
permanent-local variables:
(defvar-local rcd-tabulated-original-entries nil
"Original `tabulated-list-entries'.")
(put 'rcd-tabulated-original-entries 'permanent-local t)
But now when I use them, I just use them, I forgot pretty much about
it. It just works in the application.
--
Jean Louis
Re: Why does saving a buffer to a new file clear local variables?, Michael Heerdegen, 2024/12/12