From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman <lennart.borgman@gmail.com> Newsgroups: gmane.emacs.devel Subject: Re: Structural regular expressions Date: Sun, 12 Sep 2010 16:09:46 +0200 Message-ID: <AANLkTinyJbCULKZTWWV6_f3LtWdt-5FNjTD9PKP=0q3q@mail.gmail.com> References: <loom.20100907T212314-566@post.gmane.org> <AANLkTimYvE0aqrG-OQxuY6BTca7ngzrfQUa62mOxyV=+@mail.gmail.com> <loom.20100907T222143-475@post.gmane.org> <87sk1lt4uf.fsf@gmail.com> <jwvsk1kaav2.fsf-monnier+emacs@gnu.org> <pvhphbi0wq0d.fsf@gmx.li> <jwvlj7c9ura.fsf-monnier+emacs@gnu.org> <46875.130.55.118.19.1284065220.squirrel@webmail.lanl.gov> <AANLkTimUS7zL77TGiWoEdS+=nuww=TSABKMZuSiYPaCc@mail.gmail.com> <E1Ou5lY-0006Jj-MB@fencepost.gnu.org> <AANLkTi=dv8n40x-rTtz@mail.gmail.com> <loom.20100910T221237-941@post.gmane.org> <E1OuSKz-0004vv-Gp@fencepost.gnu.org> <jwvd3sjxekd.fsf-monnier+emacs@gnu.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 1284300624 25712 80.91.229.12 (12 Sep 2010 14:10:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 12 Sep 2010 14:10:24 +0000 (UTC) Cc: Tom <levelhalom@gmail.com>, rms@gnu.org, emacs-devel@gnu.org To: Stefan Monnier <monnier@iro.umontreal.ca> Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 12 16:10:23 2010 Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org> Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>) id 1OunG9-0006q6-IC for ged-emacs-devel@m.gmane.org; Sun, 12 Sep 2010 16:10:21 +0200 Original-Received: from localhost ([127.0.0.1]:39022 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OunG8-0007uc-Vp for ged-emacs-devel@m.gmane.org; Sun, 12 Sep 2010 10:10:21 -0400 Original-Received: from [140.186.70.92] (port=59132 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OunG1-0007tb-2p for emacs-devel@gnu.org; Sun, 12 Sep 2010 10:10:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from <lennart.borgman@gmail.com>) id 1OunFw-0004oo-Ui for emacs-devel@gnu.org; Sun, 12 Sep 2010 10:10:12 -0400 Original-Received: from mail-qy0-f176.google.com ([209.85.216.176]:37730) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from <lennart.borgman@gmail.com>) id 1OunFw-0004oi-Sd; Sun, 12 Sep 2010 10:10:08 -0400 Original-Received: by qyk2 with SMTP id 2so4742744qyk.0 for <multiple recipients>; Sun, 12 Sep 2010 07:10:08 -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=36kuKFjSMLE6KLpfkLRoHaZhtouizD41W80/WyLsMdE=; b=gDc7WvBhvUoPRP4/rIB6juI2FsJWkpps0XAAuBZAYm31WmBy63xeB+QXoM8L8kBq2E 8VtOQ+dto5iC/U0UXsciVVTyy7HOqX6VvuuefJXBNwp16ngqlEBeJM7dA/SN9611UKBg uxvdcsJy6Ch0CyI4TDuv+37itwCqwNo6TbzJc= 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=n6El9cGYXjJme3+me5aGqBYKD+2KqNfMPCrpUjcmiQZUPWKf8F2l7oiS7R3HXn8ylH rK1QAtfd/rFuW677mS3pS+uWzRsXJMn7gjlhuCtYKwcUs9h86Hclixr/YolQwXPtfcJO JOXolsxr+DTiZAEDz9nACGHrbKN9eg72bC3t0= Original-Received: by 10.224.72.37 with SMTP id k37mr1934434qaj.398.1284300606111; Sun, 12 Sep 2010 07:10:06 -0700 (PDT) Original-Received: by 10.229.216.74 with HTTP; Sun, 12 Sep 2010 07:09:46 -0700 (PDT) In-Reply-To: <jwvd3sjxekd.fsf-monnier+emacs@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." <emacs-devel.gnu.org> List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/emacs-devel>, <mailto:emacs-devel-request@gnu.org?subject=unsubscribe> List-Archive: <http://lists.gnu.org/archive/html/emacs-devel> List-Post: <mailto:emacs-devel@gnu.org> List-Help: <mailto:emacs-devel-request@gnu.org?subject=help> List-Subscribe: <http://lists.gnu.org/mailman/listinfo/emacs-devel>, <mailto:emacs-devel-request@gnu.org?subject=subscribe> Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:130015 Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/130015> On Sun, Sep 12, 2010 at 3:48 PM, Stefan Monnier <monnier@iro.umontreal.ca> wrote: > > The term "structural regular expression" is indeed misleading, I think. > They use it to refer to the combination of 2 things: > 1- the ability to select particular kinds of elements in the text > =C2=A0 (which we could do in Emacs with non-contiguous regions). =C2=A0Th= e main > =C2=A0 example being commands that select "all the strings" or "all the > =C2=A0 comments" or that inverts the selection (select everything that > =C2=A0 wasn't selected before). > 2- the ability to apply regexp-operations to only those selected parts > =C2=A0 of the text (to the extent that we already have commands that appl= y > =C2=A0 only to the active region, we already have that, although it would > =C2=A0 probably require several tweaks to make it work right in the face = of > =C2=A0 non-contiguous regions). > > Together this allows you to do things like apply query-replace to all > non-string non-comment parts of the buffer, which is why they call it > "structural" regexps. There is a related need for searching that could be built on such capability: AND. Quite often I find myself searching for a node/a tree in a big .org file containing both word a and word b.