emacs-devel
[Top][All Lists]
Advanced

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

Re: Evil defvars in org.el


From: Stefan Monnier
Subject: Re: Evil defvars in org.el
Date: Fri, 27 Apr 2012 22:14:29 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

> org.el (and org-agenda.el, and maybe others) have defvars like this:
> (defvar entry)
> (defvar date)

> This is going to blow up in someone's face, because it makes `entry' and
> `date' unusable as lexical variables, even though those are very common
> variable names.

While I strongly support fixing such things, do note that since those
cases are very common, the lexical-binding code had to find a way to
avoid this mess.  So in reality in Emacs-24 such (defvar <foo>) only
affect the current file (actually only the current scope, so you can do
(defun test () (defvar toto) (let (toto ...) ...)) and `toto' will only
be dynbound within `test'.

On the other hand, in the case of eieio's `this' we can't so easily
avoid the mess, because `this' is declared with a global value, making
it *globally* dynamically bound.


        Stefan



reply via email to

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