unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Joe Corneli <jcorneli@math.utexas.edu>
Subject: Error: Symbol's value as variable is void
Date: Fri, 25 Mar 2005 12:28:38 -0600	[thread overview]
Message-ID: <E1DEtXy-0005uB-00@lab45.ma.utexas.edu> (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'?

             reply	other threads:[~2005-03-25 18:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-25 18:28 Joe Corneli [this message]
2005-03-25 19:26 ` Error: Symbol's value as variable is void Denis Bueno
     [not found] <mailman.227.1111777231.28103.help-gnu-emacs@gnu.org>
2005-03-26  0:00 ` 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1DEtXy-0005uB-00@lab45.ma.utexas.edu \
    --to=jcorneli@math.utexas.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).