1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
1. CTAGS-EXUBERANT SETTINGS FOR CRAWL
For users of ctags-exuberant, there are some settings that can improve
your quality of living when working on crawl. Note that some of these
settings aren't appropriate for your ~/.ctags unless you work exclusively
on crawl.
--langdef=crawlmap
--langmap=crawlmap:+.des
--regex-crawlmap=/^ *NAME: *([^ ]*)/\1/q,map,map definition/
Create tags for maps in .des files, pointing to the NAME: line.
Single-quote the regex in the shell, but not in .ctags.
--regex-c++=/^ *DEF_BITFIELD *\( *([a-zA-Z0-9_:]*)/\1/t/
--regex-c++=/^ *FEATFN_MEMOIZED *\( *([a-zA-Z0-9_:]*)/\1/f/
Treat the DEF_BITFIELD macro as a typedef and FEATFN_MEMOIZED as a
function definition.
-I decltype+
More correctly interpret "auto func() -> decltype(foo)" as a declaration
of "func", not of "decltype".
-I override
-I PURE
-I IMMUTABLE
The same, for C++11 "override" and our function attribute macros.
--extra=+q
Allow searching for "player::rot", not just "rot".
--exclude=contrib
--exclude=android-project
--exclude=saves
Don't tag third-party code, and don't try to tag save files,
which would otherwise be mistaken for C# source.
2. RUNNING CTAGS AUTOMATICALLY
I like to run ctags automatically every time I take a git action, but don't
want to wait for it to complete each time. Instead, I run ctags in the
background. But, until ctags does finish, I'd rather have an outdated tag
file than an incomplete one; so I have ctags write the tag file to a temporary
location (containing the job's PID to avoid conflicts) then move it into
place once it is ready.
Create an executable script .git/hooks/ctags with the contents:
#! /bin/sh -e
cd crawl-ref/source
tagfile=../../.git/tags.tmp.$$
ctags -R -f "$tagfile" # Perhaps add some command-line options here
mv "$tagfile" tags
Add to your post-checkout, post-commit, and post-merge hooks the line:
.git/hooks/ctags >/dev/null 2>&1 &
Add to your post-rewrite hook:
[ "$1" = rebase ] && .git/hooks/ctags >/dev/null 2>&1 &
|