unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4392: (Regexp Functions): The PAREN argument to `regexp-opt' can be `symbols'.
@ 2009-09-10 21:48 Devon Sean McCullough
  2009-09-11 19:17 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Devon Sean McCullough @ 2009-09-10 21:48 UTC (permalink / raw)
  To: bug-gnu-emacs

Please patch REGEXP-OPT to take a PAREN 'symbols argument.

Index: emacs/doc/lispref/searching.texi
===================================================================
RCS file: /sources/emacs/emacs/doc/lispref/searching.texi,v
retrieving revision 1.18
diff -u -r1.18 searching.texi
--- emacs/doc/lispref/searching.texi	27 Aug 2009 04:24:02 -0000	1.18
+++ emacs/doc/lispref/searching.texi	10 Sep 2009 20:20:36 -0000
@@ -921,6 +921,7 @@
 returned regular expression is always enclosed by at least one
 parentheses-grouping construct.  If @var{paren} is @code{words}, then
 that construct is additionally surrounded by @samp{\<} and @samp{\>}.
+Likewise if @var{paren} is @code{symbols}, by @samp{\_<} and @samp{\_>}.
 
 This simplified definition of @code{regexp-opt} produces a
 regular expression which is equivalent to the actual value

Index: emacs/lisp/emacs-lisp/regexp-opt.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/regexp-opt.el,v
retrieving revision 1.42
diff -u -r1.42 regexp-opt.el
--- emacs/lisp/emacs-lisp/regexp-opt.el	5 Jan 2009 03:21:08 -0000	1.42
+++ emacs/lisp/emacs-lisp/regexp-opt.el	10 Sep 2009 20:20:36 -0000
@@ -96,7 +96,7 @@
    (concat open (mapconcat 'regexp-quote STRINGS \"\\\\|\") close))
 
 If PAREN is `words', then the resulting regexp is additionally surrounded
-by \\=\\< and \\>."
+by \\=\\< and \\>.  Likewise if PAREN is `symbols', by \\_< and \\_>."
   (save-match-data
     ;; Recurse on the sorted list.
     (let* ((max-lisp-eval-depth 10000)
@@ -104,11 +104,14 @@
 	   (completion-ignore-case nil)
 	   (completion-regexp-list nil)
 	   (words (eq paren 'words))
+	   (symbols (eq paren 'symbols))
 	   (open (cond ((stringp paren) paren) (paren "\\(")))
 	   (sorted-strings (delete-dups
 			    (sort (copy-sequence strings) 'string-lessp)))
 	   (re (regexp-opt-group sorted-strings (or open t) (not open))))
-      (if words (concat "\\<" re "\\>") re))))
+      (cond (words (concat "\\<" re "\\>"))
+	    (symbols (concat "\\_<" re "\\_>"))
+	    (t re)))))
 
 ;;;###autoload
 (defun regexp-opt-depth (regexp)

		Peace
			--Devon
	 /~\
	 \ /	Health Care
	  X 	not warfare
	 / \






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

* bug#4392: (Regexp Functions): The PAREN argument to `regexp-opt' can be `symbols'.
  2009-09-10 21:48 bug#4392: (Regexp Functions): The PAREN argument to `regexp-opt' can be `symbols' Devon Sean McCullough
@ 2009-09-11 19:17 ` Stefan Monnier
  2009-09-11 19:25   ` Processed: " Emacs bug Tracking System
  2011-07-09 18:49   ` Glenn Morris
  0 siblings, 2 replies; 4+ messages in thread
From: Stefan Monnier @ 2009-09-11 19:17 UTC (permalink / raw)
  To: Devon Sean McCullough; +Cc: 4392

tag 4392 +wontfix
thanks


> Please patch REGEXP-OPT to take a PAREN 'symbols argument.

As the person responsible for adding the `words' value to PAREN, I'm
going to reject this request.  I think the `words' value was itself
a mistake.  It's just as easy to add (concat "\\<" ... "\\>") around the
call to regexp-opt.  Actually, the whole `paren' argument should
disappear (i.e. be hardcoded to "\\(?:").


        Stefan





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

* Processed: Re: bug#4392: (Regexp Functions): The PAREN argument to `regexp-opt' can be `symbols'.
  2009-09-11 19:17 ` Stefan Monnier
@ 2009-09-11 19:25   ` Emacs bug Tracking System
  2011-07-09 18:49   ` Glenn Morris
  1 sibling, 0 replies; 4+ messages in thread
From: Emacs bug Tracking System @ 2009-09-11 19:25 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Emacs Bugs

Processing commands for control@emacsbugs.donarmstrong.com:

> tag 4392 +wontfix
Bug #4392 [emacs] (Regexp Functions): The PAREN argument to `regexp-opt' can be `symbols'.
Bug #1402 [emacs] suggestion: add 'symbol to regexp-opt's second parameter
Added tag(s) wontfix.
Added tag(s) wontfix.
> thanks
Stopping processing here.

Please contact me if you need assistance.

Don Armstrong
(administrator, Emacs bugs database)




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

* bug#4392: (Regexp Functions): The PAREN argument to `regexp-opt' can be `symbols'.
  2009-09-11 19:17 ` Stefan Monnier
  2009-09-11 19:25   ` Processed: " Emacs bug Tracking System
@ 2011-07-09 18:49   ` Glenn Morris
  1 sibling, 0 replies; 4+ messages in thread
From: Glenn Morris @ 2011-07-09 18:49 UTC (permalink / raw)
  To: 4392-done

Version: 24.1

There seems no point keeping this report open. A SYMBOLS
option was added 2010-10-07, despire the following:

Stefan Monnier wrote:

> As the person responsible for adding the `words' value to PAREN, I'm
> going to reject this request.  I think the `words' value was itself
> a mistake.  It's just as easy to add (concat "\\<" ... "\\>") around the
> call to regexp-opt.  Actually, the whole `paren' argument should
> disappear (i.e. be hardcoded to "\\(?:").





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

end of thread, other threads:[~2011-07-09 18:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-10 21:48 bug#4392: (Regexp Functions): The PAREN argument to `regexp-opt' can be `symbols' Devon Sean McCullough
2009-09-11 19:17 ` Stefan Monnier
2009-09-11 19:25   ` Processed: " Emacs bug Tracking System
2011-07-09 18:49   ` Glenn Morris

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