From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Hoffman <4g4trz802@sneakemail.com> Newsgroups: gmane.emacs.help Subject: Conditional compilation to avoid "assignment to free variable" Date: Wed, 24 Sep 2008 12:46:26 -0700 Organization: Aioe.org NNTP Server Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1222310187 18516 80.91.229.12 (25 Sep 2008 02:36:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Sep 2008 02:36:27 +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:37:25 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 1KigjL-0004GE-Ig for geh-help-gnu-emacs@m.gmane.org; Thu, 25 Sep 2008 04:37:23 +0200 Original-Received: from localhost ([127.0.0.1]:56674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KigiI-0006BJ-7G for geh-help-gnu-emacs@m.gmane.org; Wed, 24 Sep 2008 22:36:18 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!feeder.erje.net!news.k-dsl.de!aioe.org!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 22 Original-NNTP-Posting-Host: uu67l2iXQaBeXWbbg6o9Pw.user.aioe.org Original-X-Complaints-To: abuse@aioe.org User-Agent: Thunderbird 1.5.0.12 (X11/20080411) Original-Xref: news.stanford.edu gnu.emacs.help:162683 X-Mailman-Approved-At: Wed, 24 Sep 2008 22:35:56 -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:58029 Archived-At: 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.