9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Rob Pike <robpike@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: Wed,  1 Aug 2012 15:21:11 -0700	[thread overview]
Message-ID: <CAKzdPgyCVKw-FBJr9FbOO5bRXTcMrmeiJLa3TBuLnYyFCxXMcw@mail.gmail.com> (raw)
In-Reply-To: <CAOEdRO2JjuFyQnejo0rpppZ0pJt9az_2RDjoHgcb7vvg6e-+aA@mail.gmail.com>

Break it down:

a,b means: from the beginning of a to the end of b
.,. means: from the beginning of . to the end of .
1 means: from the beginning of line 1 to the end of line 1.
.,.+0 means: from the beginning of . to the end of .+0, and .+0 is the
null string at the end of .

Now the step:

.,.+0-1 means: from the beginning of . to the end of .+0-1, which
means the end of the line preceding the null string at the end of .,
which ends right back at .+0, so it means the last line of ., so this
doesn't work.
 .,.+0-2 means: from the beginning of . to the end of .+0-2, which
means the end of the second line preceding .+0, which is one line back
from the end.

QED.

The key observation is that on the right of the comma you're talking
about where the address *ends*.

-rob



  reply	other threads:[~2012-08-01 22:21 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 [this message]
2012-08-02  8:45     ` Rudolf Sykora
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=CAKzdPgyCVKw-FBJr9FbOO5bRXTcMrmeiJLa3TBuLnYyFCxXMcw@mail.gmail.com \
    --to=robpike@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).