--- Begin Message ---
Subject: |
[Leo Liu] Byte-compile lexical-scoped elisp |
Date: |
Mon, 25 Feb 2013 10:07:56 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Forwarding to get a bug-number.
--- Begin Message ---
Subject: |
Byte-compile lexical-scoped elisp |
Date: |
Mon, 25 Feb 2013 20:43:53 +0800 |
Hello Stefan,
I got a bug report on ack.el (https://github.com/leoliu/ack-el/issues/1)
when running ack.el uncompiled.
The steps to reproduce:
1. wget https://github.com/leoliu/ack-el/raw/master/ack.el
2. Emacs -q -l ack.el
3. M-x ack
file-name-nondirectory: Symbol's value as variable is void: project-root
Could you help me understand what is wrong here? It seems when
uncompiled project-root is not treated as a special variable.
Thank you,
Leo
--- End Message ---
--- End Message ---
--- Begin Message ---
Subject: |
Re: Byte-compile lexical-scoped elisp |
Date: |
Mon, 25 Feb 2013 11:06:54 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
> The steps to reproduce:
> 1. wget https://github.com/leoliu/ack-el/raw/master/ack.el
> 2. Emacs -q -l ack.el
> 3. M-x ack
> file-name-nondirectory: Symbol's value as variable is void: project-root
Indeed, the problem is that the dynamic binding of project-root is
created inside the `interactive' spec and that spec is not run in the
proper lexical environment (it is run in lexical mode, but in an empty
lexical environment).
> Could you help me understand what is wrong here?
A bug in Emacs. Should be fixed on the trunk now.
BTW, please add an "ack--" prefix to your `project-root' var: all
`defvar'd variables should have such a prefix.
Stefan
--- End Message ---