#!/usr/local/bin/bash
#
# THIS IS JUST AN EXAMPLE.
# IT IS HIGHLY UNLIKELY THAT THIS IS USEFUL, AS-IS, FOR ANYONE.
#
# do-etags++
#
# This is an example of using etags++, hier++, and emacs in batch mode
# to save out the tags-completion-alist in TAGS.alist.
#
# 1) Goes to my code directory (where TAGS should be created)
# 2) Runs etags++ on all my source (.c files first so that M-. finds
#    the definitions before the declarations)
# 3) Loads up an Emacs with the tags just generated (depends upon $USER's
#    .emacs having (setq tags-file-name "~/project/TAGS")) and writes out
#    a TAGS.alist file, so successive Emacs' don't have to rebuild the alist.
#
# This is run automatically during my night-build.

pushd $HOME/project

etags++ tools/*/*.c \
        tools/*/*.h  \
        tools/roguewave/toolsrc/*.c \
        tools/roguewave/rw/*.h \
        rhythm/*/*.c \
        rhythm/*/*.h

emacs -batch -u $USER -load tags -f save-tags-completion-alist
# Assumes that -u $USER's .emacs specifies the appropriate TAGS file
# such that -load tags builds the appropriate tags-completion-alist
# such that -f save-tags-completion-alist has something to save out.

hier++  tools/*/*.h  \
        tools/roguewave/rw/*.h \
        rhythm/*/*.h

popd
