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

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

Re: outline-regexp) using ";; *+ " for elisp code


From: Joost Kremers
Subject: Re: outline-regexp) using ";; *+ " for elisp code
Date: Tue, 11 May 2021 12:29:55 +0200
User-agent: mu4e 1.5.12; emacs 27.2

On Tue, May 11 2021, Christopher Dimech wrote:
> defvar-local is buffer-local variable. I would think that I could use defvar
> as the setting rather than a buffer-local variable, as the value would be the
> same for all elisp files.

=defvar= and =defvar-local= define global variables. The difference is that
variables defined with =defvar-local= become buffer-local whenever they are set
(with =setq=). But the value set with the =defvar-local= expression itself is
the default value, which is the value that applies in buffers that do not have
their own local value for said variable. (You can set a default value explicitly
with =setq-default=.)



-- 
Joost Kremers
Life has its moments



reply via email to

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