From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: don@donarmstrong.com (Emacs bug Tracking System) Newsgroups: gmane.emacs.bugs Subject: bug#1518: marked as done (`rx' making nested `or' forms in a `group' wrong) Date: Tue, 9 Dec 2008 13:25:05 -0800 Message-ID: References: <1228796360.10749.17.camel@eep> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_1228857905-15636-0" X-Trace: ger.gmane.org 1228859111 9136 80.91.229.12 (9 Dec 2008 21:45:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Dec 2008 21:45:11 +0000 (UTC) To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 09 22:46:14 2008 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 1LAAOq-0004G7-Vy for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Dec 2008 22:45:50 +0100 Original-Received: from localhost ([127.0.0.1]:48647 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAANf-0000SD-Rt for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Dec 2008 16:44:35 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAANT-0000N8-B3 for bug-gnu-emacs@gnu.org; Tue, 09 Dec 2008 16:44:23 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAANQ-0000Mb-SN for bug-gnu-emacs@gnu.org; Tue, 09 Dec 2008 16:44:22 -0500 Original-Received: from [199.232.76.173] (port=50042 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAANQ-0000MY-OG for bug-gnu-emacs@gnu.org; Tue, 09 Dec 2008 16:44:20 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:40929) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LAANP-00020k-Tn for bug-gnu-emacs@gnu.org; Tue, 09 Dec 2008 16:44:20 -0500 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB9LiHMI021248; Tue, 9 Dec 2008 13:44:18 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id mB9LP5Tc015751; Tue, 9 Dec 2008 13:25:05 -0800 X-Mailer: MIME-tools 5.420 (Entity 5.420) X-Loop: don@donarmstrong.com X-Emacs-PR-Message: closed 1518 X-Emacs-PR-Package: emacs X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:23107 Archived-At: This is a multi-part message in MIME format... ------------=_1228857905-15636-0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Your message dated Tue, 09 Dec 2008 16:17:29 -0500 with message-id and subject line Re: bug#1518: `rx' making nested `or' forms in a `group' w= rong has caused the Emacs bug report #1518, regarding `rx' making nested `or' forms in a `group' wrong to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact don@donarmstrong.com immediately.) --=20 1518: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3D1518 Emacs Bug Tracking System Contact don@donarmstrong.com with problems ------------=_1228857905-15636-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.0000 Tokens: new, 57; hammy, 151; neutral, 179; spammy, 0. spammytokens: hammytokens:0.000-+--emacs, 0.000-+--23.0.60, 0.000-+--23060, 0.000-+--Emacs, 0.000-+--nil X-Spam-Status: No, score=-5.9 required=4.0 tests=BAYES_00,FOURLA,PUSSY, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 9 Dec 2008 04:20:54 +0000 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB94KnNY017699 for ; Mon, 8 Dec 2008 20:20:51 -0800 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L9u5Z-0000lr-HT for bug-gnu-emacs@gnu.org; Mon, 08 Dec 2008 23:20:49 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L9u5Y-0000lV-NE for bug-gnu-emacs@gnu.org; Mon, 08 Dec 2008 23:20:49 -0500 Received: from [199.232.76.173] (port=47364 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L9u5Y-0000lS-Ji for bug-gnu-emacs@gnu.org; Mon, 08 Dec 2008 23:20:48 -0500 Received: from yx-out-1718.google.com ([74.125.44.155]:50280) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L9u5Y-0003bh-A9 for bug-gnu-emacs@gnu.org; Mon, 08 Dec 2008 23:20:48 -0500 Received: by yx-out-1718.google.com with SMTP id 34so637396yxf.66 for ; Mon, 08 Dec 2008 20:20:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:content-type :date:message-id:mime-version:x-mailer:content-transfer-encoding; bh=4n54wN7cvnGBC559OU10BVpwa9tTdxrT/Ag3Avxv4WE=; b=uJINOXHJnupI9RF/2d711x5mEa5+ZfNU+omc0HTRNUZv3kWGK28RnTdlFLibK8vGRG eoMzbQWwc9Jid+JJKw1daakQwIRn52sL+SAp/8OFXv6zjUImma889xzftGMlA6V5lJp8 tfxuZUn/8nQb5t6w6JHVkr1zyAsaUCQlfvjSQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; b=rqlt0eesfCa4WGkT57cngVTLKJgbwPYle2axNbjkYhJtQWDW74Zm8OdV0Y275uzf9A URwJIT1+5ErKr+U2t8AxhhC3aYEusVQZDcy9rphkOnaplw0kYAdrfCjxYqbChu+vBQ9Z 0BuaOtFKLA/QO7ifSyXANcGK7TruBNwYQCXWU= Received: by 10.142.214.11 with SMTP id m11mr1897935wfg.57.1228796446028; Mon, 08 Dec 2008 20:20:46 -0800 (PST) Received: from ?192.168.1.2? (pool-173-51-86-88.lsanca.fios.verizon.net [173.51.86.88]) by mx.google.com with ESMTPS id 9sm13648470wfc.16.2008.12.08.20.20.43 (version=SSLv3 cipher=RC4-MD5); Mon, 08 Dec 2008 20:20:44 -0800 (PST) Subject: `rx' making nested `or' forms in a `group' wrong From: Derick Eddington To: bug-gnu-emacs@gnu.org Content-Type: text/plain Date: Mon, 08 Dec 2008 20:19:20 -0800 Message-Id: <1228796360.10749.17.camel@eep> Mime-Version: 1.0 X-Mailer: Evolution 2.24.2 Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) This one is wrong: (rx (seq (group "foo" (or (or "asdf" "lkjh") "zab")) "bar")) => "\\(foo\\(?:asdf\\|lkjh\\)\\|zab\\)bar" This similar one without the group is correct: (rx (seq "foo" (or (or "asdf" "lkjh") "zab") "bar")) => "foo\\(?:\\(?:asdf\\|lkjh\\)\\|zab\\)bar" -- : Derick ---------------------------------------------------------------- In GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+ Version 2.14.3) of 2008-10-13 on rothera, modified by Debian (emacs-snapshot package, version 1:20081013-1) Windowing system distributor `The X.Org Foundation', version 11.0.10502000 configured using `configure '--build' 'i486-linux-gnu' '--host' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.0.60/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.60/site-lisp:/usr/share/emacs/site-lisp' '--with-x=yes' '--with-x-toolkit=gtk' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS='' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Text Minor modes in effect: show-paren-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: ) g r o u p SPC C-j M-w C-y C-M-SPC C-M-SPC C-w C-y C-M-k C-j M-x r e p o r t - e m a c s - b u Recent messages: 1 match Making completion list... Mark set [4 times] Quit Mark set [5 times] Entering debugger... Mark set [2 times] Entering debugger... Undo! [2 times] Mark set [8 times] ------------=_1228857905-15636-0 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.0000 Tokens: new, 33; hammy, 116; neutral, 36; spammy, 1. spammytokens:0.874-1--FORM hammytokens:0.000-+--emacs, 0.000-+--H*M:fsf, 0.000-+--H*UA:Emacs, 0.000-+--H*u:Emacs, 0.000-+--H*UA:Gnus X-Spam-Status: No, score=-5.5 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER,MURPHY_DRUGS_REL8,PUSSY autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1518-done) by emacsbugs.donarmstrong.com; 9 Dec 2008 21:17:35 +0000 Received: from pruche.dit.umontreal.ca (pruche.dit.umontreal.ca [132.204.246.22]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mB9LHUbb014143 for <1518-done@emacsbugs.donarmstrong.com>; Tue, 9 Dec 2008 13:17:32 -0800 Received: from alfajor.home (vpn-132-204-232-230.acd.umontreal.ca [132.204.232.230]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id mB9LI7JW018775; Tue, 9 Dec 2008 16:18:07 -0500 Received: by alfajor.home (Postfix, from userid 20848) id EC1D51C91C; Tue, 9 Dec 2008 16:17:29 -0500 (EST) From: Stefan Monnier To: Derick Eddington Cc: 1518-done@emacsbugs.donarmstrong.com Subject: Re: bug#1518: `rx' making nested `or' forms in a `group' wrong Message-ID: References: <1228796360.10749.17.camel@eep> Date: Tue, 09 Dec 2008 16:17:29 -0500 In-Reply-To: <1228796360.10749.17.camel@eep> (Derick Eddington's message of "Mon, 08 Dec 2008 20:19:20 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3165=0 > This one is wrong: > (rx (seq (group "foo" (or (or "asdf" "lkjh") "zab")) "bar")) > => > "\\(foo\\(?:asdf\\|lkjh\\)\\|zab\\)bar" I've installed the patch below which should fix it. Thank you for your help. Stefan Index: lisp/emacs-lisp/rx.el =================================================================== RCS file: /sources/emacs/emacs/lisp/emacs-lisp/rx.el,v retrieving revision 1.29 diff -u -r1.29 rx.el --- lisp/emacs-lisp/rx.el 7 Oct 2008 18:08:26 -0000 1.29 +++ lisp/emacs-lisp/rx.el 9 Dec 2008 21:13:50 -0000 @@ -666,7 +666,13 @@ (defun rx-submatch (form) "Parse and produce code from FORM, which is `(submatch ...)'." - (concat "\\(" (mapconcat #'rx-form (cdr form) nil) "\\)")) + (concat "\\(" + (if (= 2 (length form)) + ;; Only one sub-form. + (rx-form (cadr form)) + ;; Several sub-forms implicitly concatenated. + (mapconcat (lambda (re) (rx-form re ':)) (cdr form) nil)) + "\\)")) (defun rx-backref (form) ------------=_1228857905-15636-0--