From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 11 Jan 2013 13:07:37 +0100 Message-ID: From: "Peter A. Cejchan" To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] How to do this with [acme | sam | sed ] ? Topicbox-Message-UUID: 05c63b18-ead8-11e9-9d60-3106f5b1d025 how it come i didn't realize that ;-) ! thanks, peter On Fri, Jan 11, 2013 at 12:46 PM, Bence F=C3=A1bi=C3=A1n = wrote: > 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 > >> ## How to do this with [acme | sam | sed ] ? >> # compound commands >> # remove outermost pair of braces: abcd(x+(y-z))efgh --> abcdx+(y-z)ef= gh >> [ 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 >> >