From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Devon Sean McCullough Newsgroups: gmane.emacs.bugs Subject: bug#4392: (Regexp Functions): The PAREN argument to `regexp-opt' can be `symbols'. Date: Thu, 10 Sep 2009 14:48:08 -0700 (PDT) Message-ID: <200909102148.n8ALm8wq058841@jovi.net> Reply-To: Devon Sean McCullough , 4392@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1252672745 3670 80.91.229.12 (11 Sep 2009 12:39:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Sep 2009 12:39:05 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 11 14:38:58 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mm5Oz-00041Q-IA for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 Sep 2009 14:38:58 +0200 Original-Received: from localhost ([127.0.0.1]:45395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mm5Oy-0001u4-Us for geb-bug-gnu-emacs@m.gmane.org; Fri, 11 Sep 2009 08:38:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MlrnI-0003Vw-Qe for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2009 18:07:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MlrnE-0003Vk-0e for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2009 18:07:08 -0400 Original-Received: from [199.232.76.173] (port=35594 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MlrnD-0003Vh-Qz for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2009 18:07:03 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:46370) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MlrnD-0007Vt-78 for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2009 18:07:03 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8AM6xwL009490; Thu, 10 Sep 2009 15:06:59 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n8AM04lr007520; Thu, 10 Sep 2009 15:00:04 -0700 Resent-Date: Thu, 10 Sep 2009 15:00:04 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Devon Sean McCullough Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Thu, 10 Sep 2009 22:00:04 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 4392 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12526195816595 (code B ref -1); Thu, 10 Sep 2009 22:00:04 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 10 Sep 2009 21:53:01 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8ALqxpH006592 for ; Thu, 10 Sep 2009 14:53:01 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MlrZb-0002Zm-Lw for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2009 17:52:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MlrZX-0002Xk-6A for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2009 17:52:59 -0400 Original-Received: from [199.232.76.173] (port=54891 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MlrZX-0002Xb-2A for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2009 17:52:55 -0400 Original-Received: from jovi.net ([66.161.136.54]:4206) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MlrZW-0005hm-E1 for bug-gnu-emacs@gnu.org; Thu, 10 Sep 2009 17:52:54 -0400 Original-Received: from jovi.net (localhost [127.0.0.1]) by jovi.net (8.14.1/8.14.1) with ESMTP id n8ALmPfZ058847 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 10 Sep 2009 17:48:25 -0400 (EDT) (envelope-from Devon@Jovi.Net) Original-Received: (from devon@localhost) by jovi.net (8.14.1/8.14.1/Submit) id n8ALm8wq058841; Thu, 10 Sep 2009 14:48:08 -0700 (PDT) (envelope-from Devon@Jovi.Net) X-Authentication-Warning: jovi.net: devon set sender to Devon@Jovi.Net using -f Received-SPF: Pass (client IP white listed); receiver=localhost; client-ip=127.0.0.1; envelope-from= Received-SPF: Pass (client IP white listed); receiver=localhost; client-ip=127.0.0.1; helo= X-DCC-Misty-Metrics: grant.org 1170; Body=2 Fuz1=2 Fuz2=2 X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Thu, 10 Sep 2009 18:07:08 -0400 X-Mailman-Approved-At: Fri, 11 Sep 2009 08:09:13 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:30956 Archived-At: 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 / \