Skip to content

Commit e1c470c

Browse files
nikomatsakisbrson
authored andcommitted
new targets, TAGS.emacs and TAGS.vi. they must be manually made.
1 parent 99f876e commit e1c470c

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

Makefile.in

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ include $(CFG_SRC_DIR)/mk/autodep.mk
332332
include $(CFG_SRC_DIR)/mk/tools.mk
333333
include $(CFG_SRC_DIR)/mk/docs.mk
334334

335-
336335
######################################################################
337336
# Secondary makefiles, conditionalized for speed
338337
######################################################################
@@ -378,4 +377,10 @@ endif
378377
ifneq ($(findstring install,$(MAKECMDGOALS)),)
379378
CFG_INFO := $(info cfg: including install rules)
380379
include $(CFG_SRC_DIR)/mk/install.mk
381-
endif
380+
endif
381+
382+
ifneq ($(strip $(findstring TAGS.emacs,$(MAKECMDGOALS)) \
383+
$(findstring TAGS.vi,$(MAKECMDGOALS))),)
384+
CFG_INFO := $(info cfg: including ctags rules)
385+
include $(CFG_SRC_DIR)/mk/ctags.mk
386+
endif

mk/ctags.mk

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
######################################################################
2+
# TAGS file creation. No dependency tracking, just do it on demand.
3+
# Requires Exuberant Ctags: http://ctags.sourceforge.net/index.html
4+
######################################################################
5+
6+
CTAGS_OPTS=--options=${CFG_SRC_DIR}/mk/ctags.rust -R ${CFG_SRC_DIR}/src
7+
8+
TAGS.emacs:
9+
ctags -e -f $@ ${CTAGS_OPTS}
10+
11+
TAGS.vi:
12+
ctags -f $@ ${CTAGS_OPTS}

mk/ctags.rust

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
--langdef=rust
2+
--langmap=rust:.rs
3+
--regex-rust=/[ \t]*fn[ \t]+([a-zA-Z0-9_]+)/\1/f,function/
4+
--regex-rust=/[ \t]*type[ \t]+([a-zA-Z0-9_]+)/\1/T,types/
5+
--regex-rust=/[ \t]*tag[ \t]+([a-zA-Z0-9_]+)/\1/T,types/
6+
--regex-rust=/[ \t]*resource[ \t]+([a-zA-Z0-9_]+)/\1/T,types/
7+
--regex-rust=/[ \t]*mod[ \t]+([a-zA-Z0-9_]+)/\1/m,modules/

0 commit comments

Comments
 (0)