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

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

RE: [External] : The operation of default-value


From: Heime
Subject: RE: [External] : The operation of default-value
Date: Thu, 01 Dec 2022 23:35:33 +0000

------- Original Message -------
On Thursday, December 1st, 2022 at 11:16 PM, Drew Adams <drew.adams@oracle.com> 
wrote:


> > The documentation states that
> > 
> > "This is the value that is seen in buffers that
> > do not have their own values for this variable.
> > The default value is meaningful for variables
> > with local bindings in certain buffers."
> 
> 
> Good to see you are looking at the doc now!
> 
> Did you read the nodes previous to that one,
> in the same chapter (Buffer-Local Variables)?
> I think they answer your questions.
> 
> > When do buffer variables have their own values,
> > and when do they not have them?
> 
> 
> I think node `Creating Buffer-Local' explains this.
> 
> If you don't create/set a buffer-local value in
> buffer A for a variable then its global, "default"
> value applies in buffer A. It's as simple as that.

Meaning that a package can change the buffer-local variable,
with the default-value being different.  Thusly, the variable
used in the buffer is either the default value when the local
value is nil, or the local value when they differ.

Meaning that I cannot rely completely on default-value, because
the local value might be set up differently.

 
> > How can one figure out what has been set or not (whether buffers have
> > variable values or not)?.
> 
> 
> Check whether (buffer-local-value THE-VAR) is the
> same as (default-value THE-VAR).
> 
> Again, this is explained in the node that precedes
> the node you quoted from.
> 
> I suggest starting at the beginning of chapter
> Buffer-Local Variables, and reading from there.



reply via email to

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