[Top][All Lists]

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

RE: Auto Fill Comments

From: Drew Adams
Subject: RE: Auto Fill Comments
Date: Thu, 26 Nov 2020 13:51:43 -0800 (PST)

> Had thought that setq was actually a global
> thing, not local. For local variables I was
> using "let" and "let*", but that seems a
> wrong understanding.

Please read the manual, node `Variables', as
Tomas advised.  But don't just skim it.  And
read its (5) subnodes.

As seems to be the case with many of your
questions, this is all explained clearly in
the Emacs doc.

There are local variables and ... local
variables.  Variables bound by `let',
`lambda', and named functions (formal
parameters) are typically local in more or
less the usual programming sense.

[But if such a variable is in fact defined
 as "special", or global if you prefer,
 then a `let' binding of it is "local" to
 the _duration_ of the `let' - the binding
 is _temporary_.  E.g., (defvar foo 42)
 followed by (let ((foo 24)) ...) may
 (depending on the context) bind global
 variable `foo' temporarily to 24.]

Buffer-local and file-local variables are
something else altogether.  They are global
variables that have a value that is specific
to - local in scope to - the current buffer
or file.  Some variables have a buffer-local
value in some buffers but only a global
value in other buffers (no buffer-local
value there).  Other variables are always
only buffer-local.

But again, don't listen to my explanation.
Consult the doc instead.  It's more exact,
more complete, and better presented

And when you've read what the Emacs manual
has to tell you about variables, consider
reading what the Elisp manual has to say
about variables.  There too, start with its
node `Variables', and move on to its (17!)

You don't do yourself any favors, or
encourage help in forums such as this, by
not trying to make use of the doc.

The doc is the result of years of effort
and collaboration, taking into account
tons of feedback by users of all sorts.
You're not special - try benefitting from
the efforts of those who've gone before.
THEN, if you have a question, please do
ask it.


reply via email to

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