aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland McGrath1994-09-23 17:44:56 +0000
committerRoland McGrath1994-09-23 17:44:56 +0000
commiteb21e7ae84f306dacda799b4f87bc8d4c6e37e0d (patch)
tree1f9aa867ad71eb21f4fe3f48a9a2e8926cd406ae
parentc49a777a3668c96728fdf48e190c3c3a9de3d68c (diff)
downloademacs-eb21e7ae84f306dacda799b4f87bc8d4c6e37e0d.tar.gz
emacs-eb21e7ae84f306dacda799b4f87bc8d4c6e37e0d.zip
(tag-symbol-match-p): New function.
(etags-recognize-tags-table): Add that second in find-tag-tag-order, after tag-exact-match-p.
-rw-r--r--lisp/progmodes/etags.el24
1 files changed, 14 insertions, 10 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 1a5802c8214..144e143090e 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -950,8 +950,10 @@ See documentation of variable `tags-file-name'."
950 (find-tag-regexp-tag-order . (tag-re-match-p)) 950 (find-tag-regexp-tag-order . (tag-re-match-p))
951 (find-tag-regexp-next-line-after-failure-p . t) 951 (find-tag-regexp-next-line-after-failure-p . t)
952 (find-tag-search-function . search-forward) 952 (find-tag-search-function . search-forward)
953 (find-tag-tag-order . (tag-exact-match-p tag-word-match-p 953 (find-tag-tag-order . (tag-exact-match-p
954 tag-any-match-p)) 954 tag-symbol-match-p
955 tag-word-match-p
956 tag-any-match-p))
955 (find-tag-next-line-after-failure-p . nil) 957 (find-tag-next-line-after-failure-p . nil)
956 (list-tags-function . etags-list-tags) 958 (list-tags-function . etags-list-tags)
957 (tags-apropos-function . etags-tags-apropos) 959 (tags-apropos-function . etags-tags-apropos)
@@ -1156,20 +1158,22 @@ See documentation of variable `tags-file-name'."
1156;; (set-syntax-table otable))))) 1158;; (set-syntax-table otable)))))
1157;;(put 'tags-with-syntax 'edebug-form-spec '(&rest form)) 1159;;(put 'tags-with-syntax 'edebug-form-spec '(&rest form))
1158 1160
1159;; t if point is at a tag line that matches TAG "exactly". 1161;; t if point is at a tag line that matches TAG exactly.
1160;; point should be just after a string that matches TAG. 1162;; point should be just after a string that matches TAG.
1161(defun tag-exact-match-p (tag) 1163(defun tag-exact-match-p (tag)
1162 ;; The match is really exact if there is an explicit tag name. 1164 ;; The match is really exact if there is an explicit tag name.
1163 (or (and (eq (char-after (point)) ?\001) 1165 (or (and (eq (char-after (point)) ?\001)
1164 (eq (char-after (- (point) (length tag) 1)) ?\177)) 1166 (eq (char-after (- (point) (length tag) 1)) ?\177))
1165 ;; We are not on the explicit tag name, but perhaps it follows. 1167 ;; We are not on the explicit tag name, but perhaps it follows.
1166 (looking-at (concat "[^\177\n]*\177" (regexp-quote tag) "\001")) 1168 (looking-at (concat "[^\177\n]*\177" (regexp-quote tag) "\001"))))
1167 ;; We also call it "exact" if it is surrounded by symbol boundaries. 1169
1168 ;; This is needed because etags does not always generate explicit names. 1170;; t if point is at a tag line that matches TAG as a symbol.
1169 (and (looking-at "\\Sw.*\177") (looking-at "\\S_.*\177") 1171;; point should be just after a string that matches TAG.
1170 (save-excursion 1172(defun tag-symbol-match-p (tag)
1171 (backward-char (1+ (length tag))) 1173 (and (looking-at "\\Sw.*\177") (looking-at "\\S_.*\177")
1172 (and (looking-at "\\Sw") (looking-at "\\S_")))))) 1174 (save-excursion
1175 (backward-char (1+ (length tag)))
1176 (and (looking-at "\\Sw") (looking-at "\\S_")))))
1173 1177
1174;; t if point is at a tag line that matches TAG as a word. 1178;; t if point is at a tag line that matches TAG as a word.
1175;; point should be just after a string that matches TAG. 1179;; point should be just after a string that matches TAG.