[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: defvars at compile time
From: |
Katsumi Yamaoka |
Subject: |
Re: defvars at compile time |
Date: |
Wed, 22 Mar 2006 10:59:43 +0900 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/23.0.0 (gnu/linux) |
>>>>> In <address@hidden> Stefan Monnier wrote:
>>>> (let* ((load-path (image-load-path-for-library "mh-e" "mh-logo.xpm"))
>>>> (image-load-path (cons (car load-path)
>>>> (when (boundp 'image-load-path)
>>>> image-load-path))))
>>>> (mh-tool-bar-folder-buttons-init))
>>> How would you fix this, then?
>>> While compiling mh-folder-mode in file
>>> /usr/local/src/mh-e/src/emacs/lisp/mh-e/mh-folder.el:
>>> ** reference to free variable image-load-path
> How/when do you see this?
This is continuation of the thread:
http://news.gmane.org/group/gmane.emacs.gnus.general/thread=62179
And I esteemed Reiner Steib's `Mail-Followup-To: emacs-devel'
(http://article.gmane.org/gmane.emacs.gnus.general/62266).
> Emacs-21 should complain indeed, but Emacs-CVS
> shouldn't (because it recognizes the (if (boundp ..) ..) form).
Yes it is. But Gnus CVS supports Emacs 21 and XEmacs, so we
have to do something to avoid a compile warning.
>> I usually do this:
>> (when (boundp 'image-load-path)
>> (symbol-value 'image-load-path))
> Since (symbol-value 'foo) is equivalent to just `foo' the change may work
> for some versions of the byte-compiler (which doesn't optimize one form into
> the other) but not for others.
It relies on just Emacs 21's compiler and XEmacs' compiler.
> I.e. it's a bad solution.
I think the reason it is bad is only that it might take more
time than directly referring the value of the variable.
Therefore, we should not use such a countermeasure if a program
uses it frequently. However, if not, I feel it is not very ugly
rather than putting `(eval-when-compile (defvar variable))' here
and there. Did I overlook something?
- Re: New GNOME icons, (continued)
- Re: New GNOME icons, Bill Wohler, 2006/03/10
- Re: New GNOME icons, Katsumi Yamaoka, 2006/03/13
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Re: defvars at compile time, Katsumi Yamaoka, 2006/03/15
- Re: defvars at compile time, Kevin Rodgers, 2006/03/16
- Re: defvars at compile time, Johan Bockgård, 2006/03/16
- Re: defvars at compile time, Bill Wohler, 2006/03/16
- Re: defvars at compile time, Miles Bader, 2006/03/16
- Re: defvars at compile time, Richard Stallman, 2006/03/17
- Re: defvars at compile time, Stefan Monnier, 2006/03/20
- Re: defvars at compile time,
Katsumi Yamaoka <=
- Re: defvars at compile time, Stefan Monnier, 2006/03/27
- Re: defvars at compile time, Bill Wohler, 2006/03/27
- Re: defvars at compile time, Stefan Monnier, 2006/03/28
- Re: defvars at compile time, Richard Stallman, 2006/03/29
- Re: defvars at compile time, Richard Stallman, 2006/03/28