From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: defvars at compile time Date: Mon, 20 Mar 2006 01:31:31 -0500 Message-ID: <87fyldk4tx.fsf-monnier+emacs@gnu.org> References: <20403.1141690692@olgas.newt.com> <3861.1142268982@olgas.newt.com> <22907.1142318606@olgas.newt.com> <3669.1142364565@olgas.newt.com> <7035.1142372131@olgas.newt.com> <28215.1142437339@olgas.newt.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1142836315 30466 80.91.229.2 (20 Mar 2006 06:31:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 20 Mar 2006 06:31:55 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 20 07:31:53 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FLDvi-0002sH-15 for ged-emacs-devel@m.gmane.org; Mon, 20 Mar 2006 07:31:50 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FLDvh-0000Sp-Aw for ged-emacs-devel@m.gmane.org; Mon, 20 Mar 2006 01:31:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FLDvV-0000QR-AP for emacs-devel@gnu.org; Mon, 20 Mar 2006 01:31:37 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FLDvS-0000Oj-Kt for emacs-devel@gnu.org; Mon, 20 Mar 2006 01:31:36 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FLDvS-0000Ob-HZ for emacs-devel@gnu.org; Mon, 20 Mar 2006 01:31:34 -0500 Original-Received: from [209.226.175.93] (helo=tomts36-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FLE0w-0007Bi-VR for emacs-devel@gnu.org; Mon, 20 Mar 2006 01:37:15 -0500 Original-Received: from alfajor ([70.55.140.81]) by tomts36-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20060320063133.WHZS13653.tomts36-srv.bellnexxia.net@alfajor>; Mon, 20 Mar 2006 01:31:33 -0500 Original-Received: by alfajor (Postfix, from userid 1000) id 55C7ED73BE; Mon, 20 Mar 2006 01:31:31 -0500 (EST) Original-To: Katsumi Yamaoka In-Reply-To: (Katsumi Yamaoka's message of "Thu, 16 Mar 2006 07:52:40 +0900") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:51870 Archived-At: >>> (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. Stefan