From octave-sources-request at bevo dot che dot wisc dot edu Thu Nov 12 06:48:05 1998 Subject: octave-tags (Emacs) (was: etags for mfiles?) From: Mario Storti To: Francesco Potorti` cc: mstorti at minerva dot unl dot edu dot ar, octave-sources@bevo.che.wisc.edu Date: Thu, 12 Nov 1998 09:47:32 -0300 >>>>> On Thu, 12 Nov 1998 09:48:14 +0100 (CET), >>>>> Francesco Potorti` said: > Well, following this discussion I checked the regexps more > exhaustively, and modified it slightly (in the previous version it > didn't treated well the case with several return values). > Okay, the new version looks better. > Also I found > that the tags for global variables don't work. I mean that it works if > there is only one global variable in the line :-(. > Sure? Your second version tags the first variable on the line it seems, > even if I don't understand why it is so complex. Your first version looked > nice (apart from the fact that it required a space after "global"), it just > didn't tag the variable. Tagging is not required, it just speeds things > up. You are right. You helped me to understand better the tagging mechanism. Now I replaced the regex for global's by a simpler one. I use a space or tab after 'global' to avoid the case of an assignement to a variable that begins with 'global', for instance 'global_var=40;'. > I'd suggest you rewrite the global regexp in a simpler way, not necessarily > using tagging. Thanks, Mario ================================================================ #!/bin/bash #$Id: otags,v 1.7 1998/11/12 12:00:04 mstorti Exp mstorti $ # generates a TAGS file a set of Octave .m files for use with Emacs. # Run as '$ otags' in the given octave directory and will generate a # TAGS file. If you want to include another directory add a line # prior to the "*.m" line containing something like # `--include=/path/to/other/directory/TAGS" \'. # Tags are generated for function names and for global variables. For # global variables it doesn't work for more than one line og global # variables. :-((( # Tags are also created for lines of the form '###key foobar' so that # you can jump to this specific place just by typing # `M-. foobar'. Note that tags are not generated for scripts so that # you have to add a line by yourself of the form `###key # ' if you want to jump to it. :-( etags --lang=none \ --regex='/[ \t]*function.*=[ \t]*\([^ \t]*\)[ \t]*(/\1/' \ --regex='/###key \(.*\)/\1/' \ --regex='/[ \t]*global[ \t].*/' \ *.m