9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Bence Fábián" <begnoc@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] How to do this with [acme | sam | sed ] ?
Date: Fri, 11 Jan 2013 12:46:17 +0100	[thread overview]
Message-ID: <CAOCRf5VGvu-UFx39sS+RfNGLsYqCCv=C0d-m=nNYY3mhuEnq9A@mail.gmail.com> (raw)
In-Reply-To: <CAM6ozu5TrRihh9Q-2Y9Fo7Raqo0OOzQ1umgE07AHddVR247Wnw@mail.gmail.com>

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

for the third:
/\+\+[a-zA-Z_]+[0-9a-zA-Z_]*/{
x/\+\+/d
a/++/
}

the braces stuff is pretty tough, but maybe someone will have an idea.
however it is really easy to do it by hand in acme.

click on the inside of the opening paren with a double click then click
button 2
(while still holding down button 1 from the double click) this will cut
everything
inside that and the matching paren. then highlight the remaining () and
while
still holding down button 1 push button3.
Looks complicated written down but it's a really quick and easy to learn
sequence.



2013/1/11 Peter A. Cejchan <tyapca7@gmail.com>

> ## How to do this with [acme | sam | sed ]  ?
> # compound commands
> # remove outermost pair of braces:  abcd(x+(y-z))efgh  --> abcdx+(y-z)efgh
>          [ no idea :-( ]
> # remove semicolon before // comments:  xyz;[tab][space]*//  --> xyz
>          [ Edit /;[     ]*\/\// Edit s/;//      # find and remove semicolon
> before // comments ]
> # prefix to postfix operator: ++i --> i++
>          [ Edit s/\+\+[a-zA-Z]+[0-9a-zA-Z]*/&++/ Edit s/\+\+/d]
>
> thanks,
> ++pac
>
>

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

  parent reply	other threads:[~2013-01-11 11:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-11 11:19 Peter A. Cejchan
2013-01-11 11:44 ` Rudolf Sykora
2013-01-11 12:24   ` Peter A. Cejchan
2013-01-11 12:27     ` dexen deVries
2013-01-11 12:38       ` Bence Fábián
2013-01-11 14:24   ` erik quanstrom
2013-01-11 15:16     ` Rudolf Sykora
2013-01-11 11:46 ` Bence Fábián [this message]
2013-01-11 12:07   ` Peter A. Cejchan
2013-01-11 12:09 ` Nicolas Bercher
2013-01-11 13:10   ` Peter A. Cejchan
2013-01-11 13:24     ` Nicolas Bercher

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='CAOCRf5VGvu-UFx39sS+RfNGLsYqCCv=C0d-m=nNYY3mhuEnq9A@mail.gmail.com' \
    --to=begnoc@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).