unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#7010: [PATCH] sregex.el: Ease limitation on literal sregexes.
@ 2010-09-10 14:45 Breanndán Ó Nualláin
  2010-09-10 17:08 ` Andreas Schwab
  0 siblings, 1 reply; 2+ messages in thread
From: Breanndán Ó Nualláin @ 2010-09-10 14:45 UTC (permalink / raw)
  To: 7010


Currently, the `sregexq' macro accepts only literal sregexes as args. 
The patch permits it to accept all kinds of macro-generated goodness. 
A simple example:

          (let ((forms '("abc" "def")))
            (sregexq `(or ,@forms)))

---
=== modified file 'lisp/emacs-lisp/sregex.el'
--- old/lisp/emacs-lisp/sregex.el	2010-01-13 08:35:10 +0000
+++ new/lisp/emacs-lisp/sregex.el	2010-09-10 14:29:30 +0000
@@ -476,7 +476,7 @@
 - A pair (MIN . MAX)
   Where MIN and MAX are characters, adds the range of characters
   from MIN through MAX to the set."
-  `(apply 'sregex ',exps))
+  `(sregex ,@exps))
 
 (defun sregex--engine (exp combine)
   (cond







^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#7010: [PATCH] sregex.el: Ease limitation on literal sregexes.
  2010-09-10 14:45 bug#7010: [PATCH] sregex.el: Ease limitation on literal sregexes Breanndán Ó Nualláin
@ 2010-09-10 17:08 ` Andreas Schwab
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2010-09-10 17:08 UTC (permalink / raw)
  To: Breanndán Ó Nualláin; +Cc: 7010-done

Breanndán Ó Nualláin <bon@science.uva.nl> writes:

> Currently, the `sregexq' macro accepts only literal sregexes as args. 
> The patch permits it to accept all kinds of macro-generated goodness. 
> A simple example:
>
>           (let ((forms '("abc" "def")))
>             (sregexq `(or ,@forms)))

That's what sregex is for.  The point of the sregexq macro is that it
quotes its argument.

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-10 17:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-10 14:45 bug#7010: [PATCH] sregex.el: Ease limitation on literal sregexes Breanndán Ó Nualláin
2010-09-10 17:08 ` Andreas Schwab

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