unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Error: Symbol's value as variable is void
@ 2005-03-25 18:28 Joe Corneli
  2005-03-25 19:26 ` Denis Bueno
  0 siblings, 1 reply; 7+ messages in thread
From: Joe Corneli @ 2005-03-25 18:28 UTC (permalink / raw)



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'?

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-03-28 20:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.227.1111777231.28103.help-gnu-emacs@gnu.org>
2005-03-26  0:00 ` Error: Symbol's value as variable is void Thien-Thi Nguyen
2005-03-26  2:48   ` Joe Corneli
     [not found]   ` <mailman.255.1111806378.28103.help-gnu-emacs@gnu.org>
2005-03-27  0:12     ` Stefan Monnier
2005-03-27  0:45       ` Joe Corneli
2005-03-28 20:18 ` Kevin Rodgers
2005-03-25 18:28 Joe Corneli
2005-03-25 19:26 ` Denis Bueno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).