From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.bugs Subject: bug#6384: Teach rx explicitly numbered submatches Date: Thu, 10 Jun 2010 18:21:36 +0200 Message-ID: References: <871vce98br.fsf@mail.jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1276187352 2864 80.91.229.12 (10 Jun 2010 16:29:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 10 Jun 2010 16:29:12 +0000 (UTC) Cc: 6384@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 10 18:29:09 2010 connect(): No such file or directory 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.69) (envelope-from ) id 1OMkcu-0008PW-In for geb-bug-gnu-emacs@m.gmane.org; Thu, 10 Jun 2010 18:29:08 +0200 Original-Received: from localhost ([127.0.0.1]:47592 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMkct-0004sa-Q5 for geb-bug-gnu-emacs@m.gmane.org; Thu, 10 Jun 2010 12:29:07 -0400 Original-Received: from [140.186.70.92] (port=53713 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OMkcG-0004aF-Kd for bug-gnu-emacs@gnu.org; Thu, 10 Jun 2010 12:28:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OMkcE-0005kA-Oy for bug-gnu-emacs@gnu.org; Thu, 10 Jun 2010 12:28:28 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36780) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMkcE-0005k6-MV for bug-gnu-emacs@gnu.org; Thu, 10 Jun 2010 12:28:26 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1OMkbp-0004e0-MQ; Thu, 10 Jun 2010 12:28:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lennart Borgman Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 10 Jun 2010 16:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6384 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 6384-submit@debbugs.gnu.org id=B6384.127618724317844 (code B ref 6384); Thu, 10 Jun 2010 16:28:01 +0000 Original-Received: (at 6384) by debbugs.gnu.org; 10 Jun 2010 16:27:23 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMkbD-0004dl-7T for submit@debbugs.gnu.org; Thu, 10 Jun 2010 12:27:23 -0400 Original-Received: from mail-gw0-f44.google.com ([74.125.83.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OMkbB-0004de-HX for 6384@debbugs.gnu.org; Thu, 10 Jun 2010 12:27:22 -0400 Original-Received: by gwj16 with SMTP id 16so73777gwj.3 for <6384@debbugs.gnu.org>; Thu, 10 Jun 2010 09:27:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=xjutSKKr2BDLlB9BtWuwSVtbNcnAycpGOywJt/4i9g8=; b=HGj7bEAk9g0GQb3+WG6thlpTelBZ3e9YucW9HKC0gvE5Pee9MTosAIw2FjyewNk3Bg k5v8XwM90qcPow/676WJSj1XiDBwzvlyFA1EL2KqVfzeWPAGEyOfdY8hMja5nk/Mnsqo ZmlDiC+yx+9f0y4Ckr3/Oy7Ap+waSY5KffWxo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=goZHO8aCl3P7lqQd0ROBBnpX6Cx2h9ZSbp8s2C9WFtkR1z53neNKADpcOC1ih1OsjI X/42xfw+npFZruAkjTF3YhHc4ZZJLfZxj6ifwyyx0LDvnOqOR5brhLqGflkRpERnjJEs /z1HsJYOLKXwcDxWbDsbE4j6D8ClfbJvbJyiM= Original-Received: by 10.101.106.12 with SMTP id i12mr367127anm.27.1276186916093; Thu, 10 Jun 2010 09:21:56 -0700 (PDT) Original-Received: by 10.100.154.15 with HTTP; Thu, 10 Jun 2010 09:21:36 -0700 (PDT) In-Reply-To: <871vce98br.fsf@mail.jurta.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 10 Jun 2010 12:28:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: bug-gnu-emacs@gnu.org 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:37667 Archived-At: On Thu, Jun 10, 2010 at 5:51 PM, Juri Linkov wrote: >> =C2=A0 =C2=A0 =C2=A0(submatch =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0. (rx-submatch 1 nil)) ; SRE >> + =C2=A0 =C2=A0(submatch-n =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0. (rx-submatch-n 2 nil)) > > I think better would be to allow the existing subform `submatch' > to support numbered groups, i.e. in addition to the current form > `(submatch SEXP1 SEXP2 ...)' also support > `(submatch N SEXP1 SEXP2 ...)' because the number is a parameter > of normal groups. > > There are already subforms that support different number of integer > arguments like `(repeat N SEXP)' and `(repeat N M SEXP)'. =C2=A0So the sa= me > could be done for `submatch' too. I thought of that, but currently you can do (rx (submatch 1 "str")) Should perhaps 1 etc be disallowed as SEXP:s in rx? (I do not know how to do it because I believe rx uses `read'.)