emacs-devel
[Top][All Lists]
Advanced

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

Re: Why is Elisp's defvar weird? And is eval_sub broken?


From: Kelly Dean
Subject: Re: Why is Elisp's defvar weird? And is eval_sub broken?
Date: Thu, 19 Feb 2015 10:32:27 +0000

Stefan Monnier wrote:
>> In that case, should desktop-first-buffer, desktop-buffer-ok-count, and
>> desktop-buffer-fail-count be given init values to prevent local specialness,
>> so that code outside desktop.el that calls desktop functions that use those
>> variables doesn't have to do defvar on them?
>
> We could, but AFAICT, these vars are only used in desktop.el (they
> could/should use a double-dash to indicate that they're internal), so it
> would be kind of pointless.

If they're locally special, then I have to declare them in my code too, before 
I let-bind them so I can call desktop-create-buffer (which barfs if I don't), 
even though I don't use them.

For my code, see line 942 (and 97 for the macro that generates the 
declarations) of:
http://prtime.org/emacs/usablizer.el

That's no problem, but I wanted to make sure you really do want variables to 
have to be re-declared like that.

This is where I was previously just doing setq (followed by makunbound after 
calling desktop-create-buffer), until I discovered that I can do defvar 
followed by «let».



reply via email to

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