From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Structural regular expressions Date: Thu, 9 Sep 2010 19:02:44 +0200 Message-ID: References: <87sk1lt4uf.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1284053541 14012 80.91.229.12 (9 Sep 2010 17:32:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Sep 2010 17:32:21 +0000 (UTC) Cc: emacs-devel@gnu.org To: Tom Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 09 19:32:19 2010 Return-path: 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 ) id 1Otkyw-0002GK-MO for ged-emacs-devel@m.gmane.org; Thu, 09 Sep 2010 19:32:18 +0200 Original-Received: from localhost ([127.0.0.1]:59814 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Otkyw-0006C6-4g for ged-emacs-devel@m.gmane.org; Thu, 09 Sep 2010 13:32:18 -0400 Original-Received: from [140.186.70.92] (port=42239 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Otkyn-0006Aw-MI for emacs-devel@gnu.org; Thu, 09 Sep 2010 13:32:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Otkyl-0003d5-8C for emacs-devel@gnu.org; Thu, 09 Sep 2010 13:32:09 -0400 Original-Received: from mail-gy0-f169.google.com ([209.85.160.169]:61585) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Otkyl-0003cw-5w for emacs-devel@gnu.org; Thu, 09 Sep 2010 13:32:07 -0400 Original-Received: by gyf3 with SMTP id 3so992105gyf.0 for ; Thu, 09 Sep 2010 10:32:06 -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; bh=pytkSDBLglQO7+82/RyR2lmBD2WgZjzjZSYkqbPWh9s=; b=SzYZyQfV80Be1Ih3XMbXU8wk0XqGVXFrURVdX2wXjJTGPTTpDwmrV8G0fOwDavBBTM ztAl1rkNOEoq4jrK+SeJp/ix5TknTdJSkJHy6u9JnZjQIOTEm1xK/GAKeF19qOjdX+qh wJ7r8vwkvhLtopNCtQ0XqPD344SVkOPoG3Two= 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; b=nES6xO2nSu18NCjd2c5YE12UcEV9U38L20C+RJ19aHWDA1eWDQt3ChG0W0S2GQb+wL +FW1HV2nzYi+dyjfUv3QjOB7BQbYxbk2eRvOXVp3ev0nJxaH7iETAZaGQ+to7rXavbhw 8QrEzO7lyOVIeRhSC7h8qYyg/xEDy//y+V56E= Original-Received: by 10.229.236.8 with SMTP id ki8mr177281qcb.102.1284053526541; Thu, 09 Sep 2010 10:32:06 -0700 (PDT) Original-Received: by 10.229.216.74 with HTTP; Thu, 9 Sep 2010 10:02:44 -0700 (PDT) In-Reply-To: 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." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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:129828 Archived-At: On Thu, Sep 9, 2010 at 6:53 PM, Tom wrote: > Lennart Borgman gmail.com> writes: > >> > And what happens then if I want to regexp replace "foo\s-*bar"? It would >> > still be susceptible to the above mentioned boundary problem, so it's >> > not a robust workaround. >> >> It does not look to me like it would be susceptible to that problem. >> Maybe I am misunderstanding you. Can you explain more in detail why >> you think it would be a problem with the solution I suggested? (Please >> note that I said the parts outside of the multiple narrowing should be >> treated as "whitespace", not "invisible" or "non-existent".) > > Maybe I am misunderstanding you. > > As I understood your suggestion: > > <.....foo> ... whitespace ... > > Since \s- as a regexp matches whitespace the regexp "foo\s-*bar" would match > the end of the first range and the beginning of the second range separated > by whitespace. Ah, I see. Yes, it could be a problem in an example like that. So if something like my suggestion was implemented then perhaps we have to distinguish this "whitespace" from other whitespace. However I think that it would still be useful to let it behave as whitespace in many situations. I am thinking about parsers in multi major mode buffers for example.