* bug#1719: marked as done (23.0.60; Does rx (eval FORM) interfere with byte compiling?)
2008-12-28 2:29 ` bug#1719: 23.0.60; Does rx (eval FORM) interfere with byte compiling? Lennart Borgman (gmail)
@ 2008-12-28 4:30 ` Emacs bug Tracking System
0 siblings, 0 replies; 2+ messages in thread
From: Emacs bug Tracking System @ 2008-12-28 4:30 UTC (permalink / raw)
To: Chong Yidong
[-- Attachment #1: Type: text/plain, Size: 904 bytes --]
Your message dated Sat, 27 Dec 2008 23:23:07 -0500
with message-id <87d4fdhqs4.fsf@cyd.mit.edu>
and subject line Re: 23.0.60; Does rx (eval FORM) interfere with byte compiling?
has caused the Emacs bug report #1719,
regarding 23.0.60; Does rx (eval FORM) interfere with byte compiling?
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)
--
1719: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=1719
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems
[-- Attachment #2: Type: message/rfc822, Size: 3703 bytes --]
From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: emacs-pretest-bug@gnu.org
Subject: 23.0.60; Does rx (eval FORM) interfere with byte compiling?
Date: Sun, 28 Dec 2008 03:29:09 +0100
Message-ID: <4956E475.1010104@gmail.com>
I believe that rx (eval FORM) interferes with byte compiling. The
following code gives an error like this during byte compilation:
nxhtml-js.el:118:8:Error: Symbol's value as variable is void:
nxhtml-smoothgallery-mark
(defconst nxhtml-smoothgallery-mark "<!-- SmoothGallery -->")
(defun nxhtml-smoothgallery-find ()
(save-excursion
(save-restriction
(widen)
(goto-char (point-min))
(when (search-forward nxhtml-smoothgallery-mark nil t)
(back-to-indentation)
(when (looking-at (rx
"<div id=\""
(submatch
(1+ (not (any ">")))
)
"\">" (eval nxhtml-smoothgallery-mark)
))
(cons
(copy-marker (match-beginning 0))
(buffer-substring-no-properties
(match-beginning 1) (match-end 1))))))))
In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
of 2008-12-25
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags
-Ic:/g/include -fno-crossjumping'
[-- Attachment #3: Type: message/rfc822, Size: 1716 bytes --]
From: Chong Yidong <cyd@stupidchicken.com>
To: "Lennart Borgman \(gmail\)" <lennart.borgman@gmail.com>
Cc: 1719-done@emacsbugs.donarmstrong.com
Subject: Re: 23.0.60; Does rx (eval FORM) interfere with byte compiling?
Date: Sat, 27 Dec 2008 23:23:07 -0500
Message-ID: <87d4fdhqs4.fsf@cyd.mit.edu>
> I believe that rx (eval FORM) interferes with byte compiling. The
> following code gives an error like this during byte compilation
rx is a Lisp macro, so its arguments are evaluated at compile time.
Your defconst is not defined there; that's why there's an error. See
"Macros and Byte Compilation" in the Elisp manual for a detailed
explanation.
I've added a note to the rx docstring making this plainer.
Basically, you want to add an eval-when-compile statement of some sort
to allow the regexp to be translated at compile time, or, otherwise, use
the rx-to-string function and translate the regexp at runtime.
^ permalink raw reply [flat|nested] 2+ messages in thread