emacs-devel
[Top][All Lists]
Advanced

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

Re: Can't M-x compile-defun `edebug' because dynamic variables are false


From: Stefan Monnier
Subject: Re: Can't M-x compile-defun `edebug' because dynamic variables are falsely taken as lexical.
Date: Tue, 03 Jan 2017 16:48:15 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

> It looks like you've already done that, possibly on 2015-10-29.  Looking
> at the source (now I know what to look for), eval-sexp-add-defvars is
> also in Emacs 25.1's source for compile-defun.

Oh, indeed.  Not sure why you're seeing what you're seeing, then.
At least on Emacs's master branch I can't seem to reproduce your problem
(don't have a fresh emacs-25 build to try it right now).

> , so the question becomes why is setting the declared_special flag done
> inside the "if (CONSP (tail))" rather than outside?  I.e. why is it only
> done when a variable has an initialisation?

Because this code is only relevant when you evaluate (defvar <foo>),
whereas here we're not evaluating it, we're only processing it for the
byte-compiler.

There's also the important difference that a (defvar <foo>) only
has effect for the code in the same file rather than having a global
effect, so you can do (defvar toto) and then use `toto` as
a dynamically-scoped variable in your file without wreaking havoc in all
other files which happen to also use `toto` as a (lexical) variable.


        Stefan



reply via email to

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