From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from postman.osf.org ([130.105.1.152]) by hawkwind.utcs.toronto.edu with SMTP id <2795>; Thu, 19 Nov 1992 10:31:55 -0500 Received: from earth.osf.org by postman.osf.org (5.64+/OSF 1.0) id AA04927; Thu, 19 Nov 92 10:31:41 -0500 Received: by earth.osf.org (5.65/4.7) id AA05933; Thu, 19 Nov 92 10:31:40 -0500 Date: Thu, 19 Nov 1992 10:31:40 -0500 From: rsalz@osf.org Message-Id: <9211191531.AA05933@earth.osf.org> To: john@civil.su.oz.au Subject: Re: Byron's comments Cc: sam-fans@hawkwind.utcs.toronto.edu 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