GNU bug report logs - #4392
(Regexp Functions): The PAREN argument to `regexp-opt' can be `symbols'.

Previous Next

Package: emacs;

Reported by: Devon Sean McCullough <emacs-hacker <at> Jovi.Net>

Date: Thu, 10 Sep 2009 22:00:04 UTC

Severity: wishlist

Tags: wontfix

Merged with 1402

Fixed in version 24.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 4392 in the body.
You can then email your comments to 4392 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4392; Package emacs. (Thu, 10 Sep 2009 22:00:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Devon Sean McCullough <emacs-hacker <at> Jovi.Net>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Thu, 10 Sep 2009 22:00:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Devon Sean McCullough <emacs-hacker <at> Jovi.Net>
To: bug-gnu-emacs <at> gnu.org
Subject: (Regexp Functions): The PAREN argument to `regexp-opt' can be `symbols'.
Date: Thu, 10 Sep 2009 14:48:08 -0700 (PDT)
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
	 / \




Forcibly Merged 1402 4392. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> emacsbugs.donarmstrong.com. (Fri, 11 Sep 2009 00:15:08 GMT) Full text and rfc822 format available.

Information forwarded to bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#4392; Package emacs. (Fri, 11 Sep 2009 19:25:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
Extra info received and forwarded to list. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Fri, 11 Sep 2009 19:25:05 GMT) Full text and rfc822 format available.

Message #12 received at 4392 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Devon Sean McCullough <emacs-hacker <at> Jovi.Net>
Cc: 4392 <at> debbugs.gnu.org
Subject: Re: bug#4392: (Regexp Functions): The PAREN argument to `regexp-opt' can be `symbols'.
Date: Fri, 11 Sep 2009 15:17:27 -0400
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



Added tag(s) wontfix. Request was from Stefan Monnier <monnier <at> iro.umontreal.ca> to control <at> emacsbugs.donarmstrong.com. (Fri, 11 Sep 2009 19:25:07 GMT) Full text and rfc822 format available.

Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Sat, 09 Jul 2011 18:50:03 GMT) Full text and rfc822 format available.

Notification sent to Devon Sean McCullough <emacs-hacker <at> Jovi.Net>:
bug acknowledged by developer. (Sat, 09 Jul 2011 18:50:03 GMT) Full text and rfc822 format available.

Message #19 received at 4392-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 4392-done <at> debbugs.gnu.org
Subject: Re: bug#4392: (Regexp Functions): The PAREN argument to `regexp-opt'
	can be `symbols'.
Date: Sat, 09 Jul 2011 14:49:16 -0400
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 "\\(?:").




Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Sat, 09 Jul 2011 18:50:03 GMT) Full text and rfc822 format available.

Notification sent to xah lee <xah <at> xahlee.org>:
bug acknowledged by developer. (Sat, 09 Jul 2011 18:50:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 07 Aug 2011 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 14 years and 12 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.