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: Andreas Schwab
Subject: bug#23795: 24.5; rx eval on variable gives symbol error
Date: Sat, 18 Jun 2016 18:19:03 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux)

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]