6071
|
1 #! /bin/sh |
7019
|
2 # |
|
3 # Copyright (C) 1998, 2002, 2003, 2006, 2007 Mario Storti |
|
4 # |
|
5 # This file is part of Octave. |
|
6 # |
|
7 # Octave is free software; you can redistribute it and/or modify it |
|
8 # under the terms of the GNU General Public License as published by the |
|
9 # Free Software Foundation; either version 3 of the License, or (at |
|
10 # your option) any later version. |
|
11 # |
|
12 # Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 # for more details. |
|
16 # |
|
17 # You should have received a copy of the GNU General Public License |
|
18 # along with Octave; see the file COPYING. If not, see |
|
19 # <http://www.gnu.org/licenses/>. |
|
20 |
|
21 # Author: Mario Storti <mstorti@minerva.unl.edu.ar> |
6071
|
22 |
|
23 # Generate a TAGS file from a set of Octave .m files for use with Emacs. |
|
24 # |
|
25 # Run as '$ octave-tags' in the given Octave directory to generate a |
|
26 # TAGS file. If you want to include another directory, add a line |
|
27 # prior to the "*.m" line containing something like |
|
28 # `--include=/path/to/other/directory/TAGS" \'. |
|
29 |
|
30 # Tags are generated for function names and for global variables. For |
|
31 # global variables it doesn't work for more than one line global |
|
32 # variables. :-( |
|
33 |
|
34 # Tags are also created for lines of the form '###key foobar' so that |
|
35 # you can jump to this specific place just by typing `M-. foobar'. |
|
36 # Note that tags are not generated for scripts so that you have to add |
|
37 # a line by yourself of the form `###key <script-name>' if you want to |
|
38 # jump to it. :-( |
|
39 |
|
40 etags --lang=none \ |
|
41 --regex='/[ \t]*function.*=[ \t]*\([^ \t()]*\)[ \t]*(/\1/' \ |
|
42 --regex='/[ \t]*function.*=[ \t]*\([^ \t()]*\)[ \t]*$/\1/' \ |
|
43 --regex='/[ \t]*function[ \t]*\([^ \t()]*\)[ \t]*(/\1/' \ |
|
44 --regex='/[ \t]*function[ \t]*\([^ \t()]*\)[ \t]*$/\1/' \ |
|
45 --regex='/###key \(.*\)/\1/' \ |
|
46 --regex='/[ \t]*global[ \t].*/' \ |
|
47 *.m |