sam-fans - fans of the sam editor
 help / color / mirror / Atom feed
From: "James A. Robinson" <jim.robinson@stanford.edu>
To: "sam Fans" <sam-fans@hawkwind.utcs.toronto.edu>
Subject: Re: shorter struct regex?
Date: Thu, 23 Mar 2000 10:19:04 -0500	[thread overview]
Message-ID: <200003231518.HAA06451@highwire.stanford.edu> (raw)
In-Reply-To: Message from "Russ Cox" <rsc@plan9.bell-labs.com>  of "Wed, 22 Mar 2000 19:26:06 EST."References: <200003230026.TAA06530@smtp3.fas.harvard.edu>  <200003230026.TAA06530@smtp3.fas.harvard.edu>

> 	,x/{\n([^}]+\n)+	}/x/, +[^\n]/x/ +/c/\n		/
> 
> 	Is there way I could of done this with less work?
> 
> > In sam, highlight the suspect arrays and then ,s/, */,\n	/g
> would work.  This is a case where I think using the mouse
> makes more sense than typing all the gook.  

Ah, but the point was to do this without the mouse. =) Not because I'm
perverse, but because I had about 30 of these arrays in my program. Plus
I'm writing it in noweb, so I had a mix of latex documentation mixed in
with the code (which about doubles the size of the file).

> But if you want
> to type the gook, can't you just say
> 
> 	,x/{([^}]|\n)+}/,s/, */,\n	/g

The extra ',' in there before s/// would mess things up. But with a few
tweaks, like making sure it doesn't add a newline if one already exists:

	,x/{([^}]|\n)+}/s/, *[^\n]/,\n		/g

It works and would have saved 8 characters. Thank you!


Jim


       reply	other threads:[~2000-03-23 21:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <rsc@plan9.bell-labs.com>
     [not found] ` <200003230026.TAA06530@smtp3.fas.harvard.edu>
2000-03-23 15:19   ` James A. Robinson [this message]
2000-03-23  9:51 Bengt Kleberg
  -- strict thread matches above, loose matches on Subject: below --
2000-03-23  0:05 Byron Rakitzis
2000-03-18  5:24 James A. Robinson

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=200003231518.HAA06451@highwire.stanford.edu \
    --to=jim.robinson@stanford.edu \
    --cc=sam-fans@hawkwind.utcs.toronto.edu \
    /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).