bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#1719: marked as done (23.0.60; Does rx (eval FORM) interfere with b


From: Emacs bug Tracking System
Subject: bug#1719: marked as done (23.0.60; Does rx (eval FORM) interfere with byte compiling?)
Date: Sun, 28 Dec 2008 04:30:03 +0000

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
--- Begin Message --- Subject: 23.0.60; Does rx (eval FORM) interfere with byte compiling? Date: Sun, 28 Dec 2008 03:29:09 +0100 User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666
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'



--- End Message ---
--- Begin Message --- Subject: Re: 23.0.60; Does rx (eval FORM) interfere with byte compiling? Date: Sat, 27 Dec 2008 23:23:07 -0500
> 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.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]