The program we use to make tags is called "etags".
Say we have the following files: splash_screen.cc, splash_screen.h,
encrypt.cc, encrypt.h, main.cc. To make tags for these files, at
the shell prompt type:
etags splash_screen.h encrypt.h splash_screen.cc encrypt.cc main.cc
If you want to make tags for all the .h and .cc files in your current
directory, you can type:
etags *.h *.cc
You will get a file called "TAGS". If you want the file to have some
other name, use the -f option, e.g.
etags -f thistags splash_screen.h encrypt.h splash_screen.cc encrypt.cc main.cc
We use emacs to use tags. Below are some commands. ("M" is the Meta key, and "C" is the Control key. "M" or "C" followed by "-" and some character means hold down the Meta or Control key and hit the character key at the same time.)
M-. Splash_Screen M-. show_variables
Used this way, tags only finds definitions, not declarations or calls. These commands also find declarations and calls, and allow you to replace all instances of a name:
A regular expression is simply a pattern which many things may match. We already use regular expressions. The regular expression "one" matches only instances of the word "one". The regular expression "*.cc" matches any word ending with ".cc". The regular expression "*" matches anything at all.
There is quite a bit of information about etags both in the Unix man
pages (a kind of on-line documentation) and in the Emacs info. To
find out more about etags from the man pages, at the shell prompt
type:
man etagsor
man ctags
To find out more about etags from the Emacs info you have to know how to use the Emacs info! To get to the info, from within an Emacs buffer type: