9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Acme, Edit, code and newline
@ 2014-03-31 15:20 Daniel Peyrolon
  2014-03-31 15:36 ` Mark van Atten
  0 siblings, 1 reply; 9+ messages in thread
From: Daniel Peyrolon @ 2014-03-31 15:20 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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

Hi there,

I'm using p9p's acme, and I would like to take a piece of code and change,
for example this:

int main(int argc, char *argv[]) {

For this:

int main(int argc, char *argv[])
{

So, for doing that, I thought about using some regexps and the Edit command.

I would like to work with some generic regexp, so I wrote the following:

Edit , x/^[^ ]+[ ]*[^(]*\([^)]*\)[ ]*\{[ ]*$/ s/[ ]*{[ ]*$/\n{/g

By the man, the x command, under sam(1) does execute the command after the
x. Also, we
have to use \n, instead of a real newline.

AFAICT, these two commands work, separatedly. Using the first one prints me
the whole
set of function definitions, and using the s// when selecting the line that
holds something like:

blah blah (blah blah) {

Does indeed change that for:
blah blah (blah blah)
{

But when used together, this command doesn't work. Could please someone
provide
me with some insight on why this doesn't work? Thanks a lot.

(Sorry for the blah)

--
Daniel

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-04-01  8:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-31 15:20 [9fans] Acme, Edit, code and newline 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 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).