From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chetan Newsgroups: gmane.emacs.help Subject: Re: Conditional compilation to avoid "assignment to free variable" Date: Wed, 24 Sep 2008 14:34:35 -0700 Organization: Noname Inc. Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1222310298 18709 80.91.229.12 (25 Sep 2008 02:38:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Sep 2008 02:38:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 25 04:39:15 2008 connect(): Connection refused Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Kigl6-0004j9-Fy for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Sep 2008 04:39:13 +0200 Original-Received: from localhost ([127.0.0.1]:36850 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kigk3-0007LI-IW for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Sep 2008 22:38:07 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!flpi089.ffdc.sbc.com!prodigy.net!flpi088.ffdc.sbc.com!prodigy.com!flpi107.ffdc.sbc.com!nlpi070.nbdc.sbc.com.POSTED!8e1d8614!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Emacs Gnus Cancel-Lock: sha1:Nmc7t30e0156jqeBAesnKTPeSIA= Original-Lines: 25 Original-NNTP-Posting-Host: 75.36.179.225 Original-X-Complaints-To: abuse@prodigy.net Original-X-Trace: nlpi070.nbdc.sbc.com 1222292075 ST000 75.36.179.225 (Wed, 24 Sep 2008 17:34:35 EDT) Original-NNTP-Posting-Date: Wed, 24 Sep 2008 17:34:35 EDT X-UserInfo1: Q[R_PJSCTS@SSVPXJJMF_W@BFJT@QDDMEPWXODMMHXMTWA]EPMTC@AWZWDXZXQ[K\FFSKCVM@F_N_DOBWVWG__LG@VVOIPLIGX\\BU_B@\P\PFX\B[APHTWAHDCKJF^NHD[YJAZMCY_CWG[SX\Y]^KC\HSZRWSWKGAY_PC[BQ[BXAS\F\\@DMTLFZFUE@\VL Original-Xref: news.stanford.edu gnu.emacs.help:162687 X-Mailman-Approved-At: Wed, 24 Sep 2008 22:36:13 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:58031 Archived-At: Michael Hoffman <4g4trz802@sneakemail.com> writes: > I use the same .emacs file on multiple systems, and each have various packages > installed. There are various forms in my .emacs to only interact with these > packages if they are actually installed: > > (when (locate-library "auctex") > (load "auctex.el" nil t t) > (setq TeX-auto-save t)) > > When I byte-compile, however, I get a warning like this: > > emacs.el:320:9:Warning: assignment to free variable `TeX-auto-save' > > Is there a way to skip over that form at compile time if the library cannot be > found? I tried various permutations of using eval-when-compile, but I still get > the warning. > > I suppose the other solution is to wrap the setq in a boundp check, but this > seems silly as the result of the boundp check will be the same as the result of > locate-library. > > In this case, I may be able to use a custom variable instead but I am looking > for a more general solution. C-h f eval-when-compile