Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!kim From: kim@kim.misemi (Kim Letkeman) Newsgroups: comp.emacs Subject: Re: Is there a fix for "File tags not a valid tag table"? Summary: ctags and etags are not the same ... ctags originated in the vi world ... Message-ID: <765@kim.misemi> Date: 14 Jun 89 13:01:11 GMT References: <380001@hpfcdq.HP.COM> Organization: MITEL Corporation, Kanata, Ontario, Canada. Lines: 74 In article <380001@hpfcdq.HP.COM>, todd@hpfcdq.HP.COM (Todd Spencer) writes: > I'm running emacs version 18.51.1 on a HP 9000/360 and I'm trying to > get ESC-. (find-tag) working. It appears that the "tags" file I > create via "ctags" is incompatible with my version of emacs. > The error message I receive is "File tags not a valid tag table." > > The documentation instructs that the tags file is to be created with > the "etags" command (not "ctags"). Where do I get such a beast? or > is the "ctags" command ok to use - which means my emacs is broken? > > Send comments to todd@hpfcra.hp.com > > Thanx in advance. > Todd ctags was originally designed to work (I believe) with vi. It also works well with jove. It does not work at all with gnu emacs. The file structures are completely different. I do not have any manuals, so I don't know all the ins and outs of emacs's tag tables, but I have reverse engineered both vi and emacs tag files to be used with a custom version of PASCAL that is used here. A vi tag file contains records of the format: \t\t/pattern/ The search key is a function name (or variable if you are using that feature.) The search key may be preceded by an "M" if it is the main of a specific program. The search pattern can use ?pattern? if you want it to search backwards. This allows you to see the function definition if it occurs in the same file before your current position (or some such reason.) The tag table must be sorted lexically. In emacs, the tag file has a more global structure. There is an entry for each file that consists of: ^L , ^?, ^?<...>,<...> and so on ... As you can see, this is a much more complex structure, but it allows some very nice functionality. For example, searching is extremely fast because emacs tries to find the search key at the specified offset first. Since it is usually there, response is immediate. If the file has been changed, emacs will search until it finds the key, it just takes a bit longer. I wrote an awk program to generate a tag table for our PASCAL source files and the results were nothing short of spectacular. I can instantaneously look at all files that contain a function or procedure that has any arbitrary character sequence as part of the name. It works to perfection (something my vi table never quite accomplished under jove.) Anyway ... etags is capable of building tag tables for C (with defines if you want) and for lisp. It handles a number of other language as well. Interestingly, it does not purport to handle PASCAL at all. On the other hand, ctags does purport to handle PASCAL, but the man page admits that the handling is not very clean, a fact that I can verify through experience. I would recommend that you use etags and forget that ctags exists. You should be able to find etags in $EMACS/etc. Kim P.S. I'm pretty new to the net and don't have my signature figured out yet. Sorry.