9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Daniel Peyrolon <tuchalia@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Acme, Edit, code and newline
Date: Tue,  1 Apr 2014 10:23:34 +0200	[thread overview]
Message-ID: <CA+yaQw_8-FsvA_XC5NicYNvMGRjmpPkq7xv=7QnDjFErzz6AEg@mail.gmail.com> (raw)
In-Reply-To: <CALAsyW1rQXF=iwgdxA4VSV4GjmJrFO5DwqiFQbSygtBy4NrVPA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1129 bytes --]

Hi there everyone,

Many thanks for the explanation, it's much clearer now.


2014-04-01 9:24 GMT+02:00 Mark van Atten <vanattenmark@gmail.com>:

> On Mon, Mar 31, 2014 at 5:54 PM, Daniel Peyrolon <tuchalia@gmail.com>
> wrote:
> >> Edit , x/^[^ ]+[ ]*[^(]*\([^)]*\)[ ]*\{[ ]*\n/ s/[ ]*\{[ ]*\n/\n\{/g
> >
> > So, it was simply a matter of changing "$" for "\n" at the x command!
>
> Yes. (In the version I gave, the replacement of the second $, the one
> in the s command, by \n was superfluous.)
>
> > How come my command didn't work?
> > It really should work with the "$", shouldn't it?
>
> In the original version, the x command matches up to the end of the
> line, but the resulting selection is no longer itself a line; so the
> subsequent s command, trying to match various things and then the
> empty string at the end of a line ($), does not succeed.
>
> But replacing, in the x command, the $ by \n leaves the result of a
> match (now one character longer because it includes the \n) a line, in
> which the s command then successfully matches $.
>
> As ever,
> Mark.
>
>


--
Daniel

[-- Attachment #2: Type: text/html, Size: 1676 bytes --]

      reply	other threads:[~2014-04-01  8:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-31 15:20 Daniel Peyrolon
2014-03-31 15:36 ` Mark van Atten
2014-03-31 15:39   ` erik quanstrom
2014-03-31 15:44     ` Mark van Atten
2014-03-31 15:46       ` erik quanstrom
2014-03-31 15:54   ` Daniel Peyrolon
2014-03-31 16:23     ` Ruben Schuller
2014-04-01  7:24     ` Mark van Atten
2014-04-01  8:23       ` Daniel Peyrolon [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+yaQw_8-FsvA_XC5NicYNvMGRjmpPkq7xv=7QnDjFErzz6AEg@mail.gmail.com' \
    --to=tuchalia@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).