[net.lang.lisp] Tags for lisp

benson@dcdwest.UUCP (Peter Benson) (02/27/85)

Is there a program similar to ctags for lisp?  If someone has
such a program for Berkeley 4.2, I would appreciate receiving
a copy or some pointers to one.

Thanks in advance
-- 
                                _
Peter Benson                    | ITT Defense Communications Division
(619)578-3080                   | 10060 Carroll Canyon Road
decvax!ittvax!dcdwest!benson    | San Diego, CA 92131
ucbvax!sdcsvax!dcdwest!benson   | 

hopp@nbs-amrf.UUCP (Ted Hopp) (03/09/85)

> Is there a program similar to ctags for lisp?  If someone has
> such a program for Berkeley 4.2, I would appreciate receiving
> a copy or some pointers to one.

I use awk to scan for lines starting '(def...', ignoring case.  Each line
generates a tag for the second argument, which is usually the function
being defined.  Of course, there are all sorts of writing styles that can
break this, and it also picks up things like '(defprop ...', which you
may or may not want.  The tags file tells vi to search backwards in a
poor-man's attempt to find the last definition for things are multiply
defined.  This has worked well enough for me that I haven't felt the
need for anything better, although it is really quick and dirty.

#!/bin/csh
# make a tags file for lisp source files.
# usage:
#	lisptags file [ file ... ]
# generate the file 'tags'
#
awk '/^\([dD][eE][fF]/ {print $2 " " FILENAME " ?^" $0 "$?"}' $* | sort > tags
-- 

Ted Hopp	{seismo,umcp-cs}!nbs-amrf!hopp

blenko@rochester.UUCP (Tom Blenko) (03/10/85)

Lest this keep coming up, let me mention that Ken Arnold's ctags
program which has been reposted to the net recently, also handles Lisp
source files. It isn't perfect, but it does much better than any of the
awk scripts that I have seen.

	Tom