#!/usr/bin/env bash SRC_DIR=$1 if [ ! -e "$SRC_DIR/lib-src/etags.c" ] then echo "\`$SRC_DIR' is not top directory of emacs source code" exit 1 fi pushd "$SRC_DIR" for d in src lib-src lib do pushd "$d" etags -o TAGS.sub *.[hc] INCLUDE_ETAGS_FILES="$INCLUDE_ETAGS_FILES --include $PWD/TAGS.sub" popd done for d in lisp do pushd "$d" etags -o TAGS.sub *.el INCLUDE_ETAGS_FILES="$INCLUDE_ETAGS_FILES --include $PWD/TAGS.sub" for sub in * do if [ -d "$sub" ] then pushd "$sub" etags -o TAGS.sub *.el INCLUDE_ETAGS_FILES="$INCLUDE_ETAGS_FILES --include $PWD/TAGS.sub" popd fi done popd done if [ -n "$INCLUDE_ETAGS_FILES" ] then etags $INCLUDE_ETAGS_FILES fi popd