From: rsalz@osf.org
To: john@civil.su.oz.au
Cc: sam-fans@hawkwind.utcs.toronto.edu
Subject: Re: Byron's comments
Date: Thu, 19 Nov 1992 10:31:40 -0500 [thread overview]
Message-ID: <9211191531.AA05933@earth.osf.org> (raw)
Modifying sam to use, for example, ctags, might be more of a
challenge.
Well, Samuel sounds real cool, but...
The following script has reasonable speed. If it ends a tags file entry
it outputs the set of commands that would make sam open that file and
(more or less) move to the right place. I say more or less because I
just turn Sam's re metachars into dots.
Here's how to use it. In the command window type "!samtag Cmd", for
example. Then select the two lines that it outputs:
!samtag Cmd
B ../sam/parse.h
/^typedef struct Cmd Cmd;$/
then click "send" on the middle menu.
If you have xcb (get it get it get it) then you can jump from text, too.
Double-click on a function, then on the middle menu click "snarf" then "exch".
Then click to the ~~sam~~ window and type "!samtag" and use as before.
#! /bin/rc
## Output a series of commands that will make same go to the tag named on
## the command line. If no argument, use the word in the current X
## selection. The best way to get the selection is to install xcb; available
## as contrib/xcb-2.1.tar.Z on export.lcs.mit.edu.
## Useful variables
~ $#tagspath 0 && tagspath = (. .. /usr/lib/tags)
nl = '
'
tab=' '
## Get the current X selection. I strongly recommend xcb;
if ( ~ $#* 0 ) {
function = `{xcb -p 0}
} else {
function = $1
}
function = $function ^ ' '
for (i in $tagspath)
test -f $i ^ /tags && {
line = `` ($nl) { look $function $i ^ /tags ; echo $status }
~ $#line 2 && ~ $line(2) 0 && {
* = `` ($tab $nl) { echo $line(1) }
if ( ~ $i . || ~ $2 /* ) {
dir = ''
} else {
dir = $i ^ '/'
}
echo B $dir ^ $2
shift ; shift
# Gross hack...
echo $* | tr '()*' '...'
exit 0
}
}
exit 1
next reply other threads:[~1992-11-19 15:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1992-11-19 15:31 rsalz [this message]
1992-11-19 22:32 ` Scott Schwartz
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=9211191531.AA05933@earth.osf.org \
--to=rsalz@osf.org \
--cc=john@civil.su.oz.au \
--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).