From 5ae8b39f43503cdc2f1c0191c26cb244fd270448 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 12 Oct 2011 12:10:21 -0700 Subject: [PATCH 1/2] new targets, TAGS.emacs and TAGS.vi. they must be manually made. --- Makefile.in | 9 +++++++-- mk/ctags.mk | 12 ++++++++++++ mk/ctags.rust | 7 +++++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 mk/ctags.mk create mode 100644 mk/ctags.rust diff --git a/Makefile.in b/Makefile.in index 4b6c48779eb4d..a2b1a86cef5db 100644 --- a/Makefile.in +++ b/Makefile.in @@ -332,7 +332,6 @@ include $(CFG_SRC_DIR)/mk/autodep.mk include $(CFG_SRC_DIR)/mk/tools.mk include $(CFG_SRC_DIR)/mk/docs.mk - ###################################################################### # Secondary makefiles, conditionalized for speed ###################################################################### @@ -378,4 +377,10 @@ endif ifneq ($(findstring install,$(MAKECMDGOALS)),) CFG_INFO := $(info cfg: including install rules) include $(CFG_SRC_DIR)/mk/install.mk -endif \ No newline at end of file +endif + +ifneq ($(strip $(findstring TAGS.emacs,$(MAKECMDGOALS)) \ + $(findstring TAGS.vi,$(MAKECMDGOALS))),) + CFG_INFO := $(info cfg: including ctags rules) + include $(CFG_SRC_DIR)/mk/ctags.mk +endif diff --git a/mk/ctags.mk b/mk/ctags.mk new file mode 100644 index 0000000000000..8f4aa6bbd142e --- /dev/null +++ b/mk/ctags.mk @@ -0,0 +1,12 @@ +###################################################################### +# TAGS file creation. No dependency tracking, just do it on demand. +# Requires Exuberant Ctags: http://ctags.sourceforge.net/index.html +###################################################################### + +CTAGS_OPTS=--options=${CFG_SRC_DIR}/mk/ctags.rust -R ${CFG_SRC_DIR}/src + +TAGS.emacs: + ctags -e -f $@ ${CTAGS_OPTS} + +TAGS.vi: + ctags -f $@ ${CTAGS_OPTS} diff --git a/mk/ctags.rust b/mk/ctags.rust new file mode 100644 index 0000000000000..3f9bbca469cab --- /dev/null +++ b/mk/ctags.rust @@ -0,0 +1,7 @@ +--langdef=rust +--langmap=rust:.rs +--regex-rust=/[ \t]*fn[ \t]+([a-zA-Z0-9_]+)/\1/f,function/ +--regex-rust=/[ \t]*type[ \t]+([a-zA-Z0-9_]+)/\1/T,types/ +--regex-rust=/[ \t]*tag[ \t]+([a-zA-Z0-9_]+)/\1/T,types/ +--regex-rust=/[ \t]*resource[ \t]+([a-zA-Z0-9_]+)/\1/T,types/ +--regex-rust=/[ \t]*mod[ \t]+([a-zA-Z0-9_]+)/\1/m,modules/ From 00351b2261417d1547f035b6f0f39234d1607fd0 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 12 Oct 2011 13:34:24 -0700 Subject: [PATCH 2/2] move ctags.rust into src/etc --- mk/ctags.mk | 2 +- {mk => src/etc}/ctags.rust | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename {mk => src/etc}/ctags.rust (100%) diff --git a/mk/ctags.mk b/mk/ctags.mk index 8f4aa6bbd142e..b47a6930b2a74 100644 --- a/mk/ctags.mk +++ b/mk/ctags.mk @@ -3,7 +3,7 @@ # Requires Exuberant Ctags: http://ctags.sourceforge.net/index.html ###################################################################### -CTAGS_OPTS=--options=${CFG_SRC_DIR}/mk/ctags.rust -R ${CFG_SRC_DIR}/src +CTAGS_OPTS=--options=${CFG_SRC_DIR}/src/etc/ctags.rust -R ${CFG_SRC_DIR}/src TAGS.emacs: ctags -e -f $@ ${CTAGS_OPTS} diff --git a/mk/ctags.rust b/src/etc/ctags.rust similarity index 100% rename from mk/ctags.rust rename to src/etc/ctags.rust