sam-fans - fans of the sam editor
 help / color / mirror / Atom feed
From: Steve_Kilbane@cegelecproj.co.uk (Steve_Kilbane)
To: sam-fans@hawkwind.utcs.toronto.edu
Subject: sam's pipe
Date: Thu, 20 Apr 1995 13:20:46 -0400	[thread overview]
Message-ID: <9504201620.AA02372@spirit.cegelecproj.co.uk> (raw)

Does anyone actually use sam's input pipe, apart from with
the B command? Generally, I've hardly used it at all, but I
was reading Rob's Acme paper the other day, and it mentioned
sam interacting with the compiler and debugger, and I thought,
why not?

Took about five minutes to write a script for handling compiler
errors: the script reads error messages <sent> to its stdin,
and tells sam to go to the appropriate file/line. The input
"make" is an exception; it does just that. feels quite nice.
And no, I haven't done anything about debugger interaction.:-)

So, I was just wondering if anyone else has written any
other useful applications with sam's pipe....

steve

#!/bin/rc
# Script for going to lines with errors in. Usage: run with
# no arguments, and <send> the error lines to stdin. Sends
# commands to sam's pipe.

# First bit comes straight from 'B':

if (~ $#USER 0)
	USER=$LOGNAME
pipe=/tmp/.sam.$USER

if (! ~ $#DISPLAY 0)
	pipe=$pipe.$DISPLAY

if (! test -r $pipe) {
	echo `{basename $0}^': No pipe "'$pipe'" to sam.' >[1=2]
	exit 1
}

while (cmd = `line) {
	if (~ $cmd '') {
		exit
	}
	if (~ $cmd (make exit)) {
		$cmd
	} else {
		cmd = `{echo $cmd | sed -ne 's/^"\([^"]*\)", line \([0-9]*\).*/f=''\1''; line=\2/p'}
		eval $cmd
		echo B $f >> $pipe
		echo $line >> $pipe
	}
}


             reply	other threads:[~1995-04-20 16:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-04-20 17:20 Steve_Kilbane [this message]
1995-04-20 22:09 Mark H. Wilkinson

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=9504201620.AA02372@spirit.cegelecproj.co.uk \
    --to=steve_kilbane@cegelecproj.co.uk \
    --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).