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: Stefan Monnier
Subject: Re: Why is Elisp's defvar weird? And is eval_sub broken?
Date: Thu, 19 Feb 2015 08:23:55 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> 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.

Your code is clearly meant to be inside desktop.el, so it's perfectly
normal to have to add various extra declarations to reproduce some
context before calling internal functions.

> 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».

A general rule is that if you need makunbound you're probably doing
something wrong.


        Stefan



reply via email to

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