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

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

Re: Basic emacs lisp question


From: Robert Thorpe
Subject: Re: Basic emacs lisp question
Date: Wed, 10 Sep 2014 01:49:58 +0100

Emanuel Berg <address@hidden> writes:

> Ken <address@hidden> writes:
>
>> OK, I will try changing it to let, but I don't think
>> it will improve the functionality. :-)
>
> Well, perhaps not in isolation. The advantage of let is
> rather when you have several functions (even hundreds),
> all available at the same time, at the base level. And,
> it might be wise to practice good form from the very
> start with Elisp.

Yes.  It's also useful if the code could be running in two different
buffers at once.  By default variables created with setq on it's own
have global scope, so if the code is running in two different buffers
things will get confused.

A useful half-way house is to make variables buffer local using
make-local-variable.

BR,
Robert Thorpe



reply via email to

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