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

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

bug#23795: 24.5; rx eval on variable gives symbol error


From: Brent Goodrick
Subject: bug#23795: 24.5; rx eval on variable gives symbol error
Date: Sat, 18 Jun 2016 09:21:03 -0700

Understood. Thanks Andreas.

On Sat, Jun 18, 2016 at 9:19 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
bgoodr@gmail.com writes:

> Insert this into a .el file and load it in using emacs -Q:
>
> (let ((page-name "the page"))
>        (let ((regexp
>             ;; (concat "[[" page-name "]]")
>             (rx "[[" (eval page-name) "]]" )))
>        regexp
>        ))

Since rx is a macro it cannot refer to runtime values.  You need to use
rx-to-string to construct the regexp at run time.  Or just use concat as
in the comment.

Andreas.

--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


reply via email to

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