unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: bgoodr@gmail.com
Cc: 23795-done@debbugs.gnu.org
Subject: bug#23795: 24.5; rx eval on variable gives symbol error
Date: Sat, 18 Jun 2016 18:19:03 +0200	[thread overview]
Message-ID: <87lh228o7c.fsf@linux-m68k.org> (raw)
In-Reply-To: <22373.28050.673856.847792@gargle.gargle.HOWL> (bgoodr@gmail.com's message of "Sat, 18 Jun 2016 08:49:38 -0700")

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."





  parent reply	other threads:[~2016-06-18 16:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-18 15:49 bug#23795: 24.5; rx eval on variable gives symbol error bgoodr
2016-06-18 16:13 ` Noam Postavsky
2016-06-18 16:15   ` Brent Goodrick
2016-06-18 16:19 ` Andreas Schwab [this message]
2016-06-18 16:21   ` Brent Goodrick

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=87lh228o7c.fsf@linux-m68k.org \
    --to=schwab@linux-m68k.org \
    --cc=23795-done@debbugs.gnu.org \
    --cc=bgoodr@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).