emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] trunk r113896: Declare external variables.


From: Stefan Monnier
Subject: Re: [Emacs-diffs] trunk r113896: Declare external variables.
Date: Fri, 16 Aug 2013 12:28:48 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>>> +(eval-when-compile
>>> +  (defvar directory-sep-char)
>>> +  (defvar dired-move-to-filename-regexp))
>> You don't want to "eval" those defvars, since evaluating such a defvar is
>> mostly a no-op.  So don't put them inside eval-when-compile.
> But it doesn't hurt, does it?

Yes it does.  It actually hides those defvars from the compiler since it
passes the code to `eval' and only passes the result (aka nil) to the
compiler (at least, that's what "eval-when-compile" is supposed to
mean).

It's a bad habit.  The byte-compiler has to do extra work to find those
defvars because of people who write code like that.

Please fix it, so as not to set a bad example,


        Stefan



reply via email to

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