9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Rudolf Sykora <rudolf.sykora@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] sam, shorten dot by 1 line
Date: Thu,  2 Aug 2012 10:45:32 +0200	[thread overview]
Message-ID: <CAOEdRO1==K+w0D202BVCFnYhWXOVBCRM0o+uj5cBMycfSBSwHg@mail.gmail.com> (raw)
In-Reply-To: <CAKzdPgyCVKw-FBJr9FbOO5bRXTcMrmeiJLa3TBuLnYyFCxXMcw@mail.gmail.com>

On 2 August 2012 00:21, Rob Pike <robpike@gmail.com> wrote:
> .,.+0 means: from the beginning of . to the end of .+0, and .+0 is the
> null string at the end of .

It just does not work for me like that. (.+#0 seems to do what you describe.)

1) Having a line
asdfasdf asdfasdf asdfasdf | asdfasdfa  asfdsfasdfa
where | represents the current (emty) dot, .+0 selects everything to
the right from the original dot to the end of the line, including the
newline.

2) Having
| asdfasdf asdfasdf asdfasdf asdfasdfa asfdsfasdf
.+0 does nothing

3) Having
asdfasdf asdfasdf asdfasdf asdfasdfa asfdsfasdf |
.+0 selects the newline, and next .+0 selects the empty dot on the
beginning of the next line, like what we start from in the case 2).

This behaviour, along with the mentioned behaviour of +-, where for
| asdfasdf asdfasdf asdfasdf asdfasdfa asfdsfasdf
+- selects the previous line
while for
asdfasdf asdfasdf asdfasdf | asdfasdfa  asfdsfasdfa
it selects the current line
still stays ununderstood by me... (and the last example is contraintuitive).

[sideremark: -+ works even when the empty dot is on the first and last
line of the file, the latter being a problem for +-, which is a
strange asymmetry. How should one then select the line on which a
possibly multiline dot ends and at the same time this is the last line
in the file (which however, you do not have to know if this happens
under some loop command)?]

Any more explanation is highly welcome!
Ruda



  reply	other threads:[~2012-08-02  8:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-01 16:37 Rudolf Sykora
2012-08-01 19:09 ` Rob Pike
2012-08-01 20:21   ` Rudolf Sykora
2012-08-01 20:51 ` Rudolf Sykora
2012-08-01 22:21   ` Rob Pike
2012-08-02  8:45     ` Rudolf Sykora [this message]
2012-08-05  8:19       ` Rudolf Sykora
2012-08-06  0:52         ` Rob Pike
2012-08-06  7:04           ` Rudolf Sykora
2012-08-06 10:53             ` tlaronde
2012-08-06 15:05               ` Rob Pike
2012-08-10  9:32                 ` Rudolf Sykora

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='CAOEdRO1==K+w0D202BVCFnYhWXOVBCRM0o+uj5cBMycfSBSwHg@mail.gmail.com' \
    --to=rudolf.sykora@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).