[Top][All Lists]

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

Re: defvars at compile time

From: Stefan Monnier
Subject: Re: defvars at compile time
Date: Mon, 20 Mar 2006 01:31:31 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>>> (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?  Emacs-21 should complain indeed, but Emacs-CVS
shouldn't (because it recognizes the (if (boundp ..) ..) form).

> 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.  I.e. it's a bad solution.


reply via email to

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