From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joe Corneli Newsgroups: gmane.emacs.help Subject: Error: Symbol's value as variable is void Date: Fri, 25 Mar 2005 12:28:38 -0600 Message-ID: NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1111776646 10360 80.91.229.2 (25 Mar 2005 18:50:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 25 Mar 2005 18:50:46 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 25 19:50:46 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DEtsy-0007St-Rg for geh-help-gnu-emacs@m.gmane.org; Fri, 25 Mar 2005 19:50:21 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DEu8V-0006wO-UD for geh-help-gnu-emacs@m.gmane.org; Fri, 25 Mar 2005 14:06:23 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DEu2m-0001ES-6G for help-gnu-emacs@gnu.org; Fri, 25 Mar 2005 14:00:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DEu24-0000qj-4e for help-gnu-emacs@gnu.org; Fri, 25 Mar 2005 13:59:52 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DEu21-0000kp-NU for help-gnu-emacs@gnu.org; Fri, 25 Mar 2005 13:59:41 -0500 Original-Received: from [146.6.139.124] (helo=dell3.ma.utexas.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DEtXy-0002NP-QD for help-gnu-emacs@gnu.org; Fri, 25 Mar 2005 13:28:39 -0500 Original-Received: from lab45.ma.utexas.edu (mail@lab45.ma.utexas.edu [128.83.133.159]) by dell3.ma.utexas.edu (8.11.0.Beta3/8.10.2) with ESMTP id j2PIScC30255; Fri, 25 Mar 2005 12:28:38 -0600 Original-Received: from jcorneli by lab45.ma.utexas.edu with local (Exim 3.36 #1 (Debian)) id 1DEtXy-0005uB-00; Fri, 25 Mar 2005 12:28:38 -0600 Original-To: help-gnu-emacs 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 X-MailScanner-To: geh-help-gnu-emacs@m.gmane.org Xref: news.gmane.org gmane.emacs.help:25150 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:25150 I wrote some code that contains the following forms: (defvar nero-link-regexp "\\[\\([0-9]+\\)\\]" "Regular expression that tells nero what links look like. The first parenthesized subexpression is the unique string denoting the webpage to load, which will sought among the references.") (defvar nero-font-lock-keywords (eval-when-compile (list `(,nero-link-regexp . font-lock-keyword-face))) "Font lock for `nero-mode'. Currently, only numbered links are fontified.") These work fine for me, but another person using the code reports the following error upon byte-compiling: Compiling file /stor/garray/src/nero.el at Fri Mar 25 08:21:48 2005 nero.el:295:33:Error: Symbol's value as variable is void: nero-link-regexp I don't see any such error when I byte compile. I'm just curious to know if using `eval-when-compile' here is bad form, or what. I think I've seen it being used in other packages in a similar context, but I don't understand it well enough to know whether I should be using it here. Removing it did make the other user's error go away. I told him to create a bug report, but if its just the fault of my bad code, I'd like to know. More generally, as a point of style, when is it good to use `eval-when-compile'?