changeset 9021:e0709ca0418a

(tag-symbol-match-p): New function. (etags-recognize-tags-table): Add that second in find-tag-tag-order, after tag-exact-match-p.
author Roland McGrath <roland@gnu.org>
date Fri, 23 Sep 1994 17:44:56 +0000
parents 857ced7767c0
children 10fa443c671a
files lisp/progmodes/etags.el
diffstat 1 files changed, 14 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/etags.el	Fri Sep 23 17:29:55 1994 +0000
+++ b/lisp/progmodes/etags.el	Fri Sep 23 17:44:56 1994 +0000
@@ -950,8 +950,10 @@
 		 (find-tag-regexp-tag-order . (tag-re-match-p))
 		 (find-tag-regexp-next-line-after-failure-p . t)
 		 (find-tag-search-function . search-forward)
-		 (find-tag-tag-order . (tag-exact-match-p tag-word-match-p
-							  tag-any-match-p))
+		 (find-tag-tag-order . (tag-exact-match-p
+					tag-symbol-match-p
+					tag-word-match-p
+					tag-any-match-p))
 		 (find-tag-next-line-after-failure-p . nil)
 		 (list-tags-function . etags-list-tags)
 		 (tags-apropos-function . etags-tags-apropos)
@@ -1156,20 +1158,22 @@
 ;;	 (set-syntax-table otable)))))
 ;;(put 'tags-with-syntax 'edebug-form-spec '(&rest form))
 
-;; t if point is at a tag line that matches TAG "exactly".
+;; t if point is at a tag line that matches TAG exactly.
 ;; point should be just after a string that matches TAG.
 (defun tag-exact-match-p (tag)
   ;; The match is really exact if there is an explicit tag name.
   (or (and (eq (char-after (point)) ?\001)
 	   (eq (char-after (- (point) (length tag) 1)) ?\177))
       ;; We are not on the explicit tag name, but perhaps it follows.
-      (looking-at (concat "[^\177\n]*\177" (regexp-quote tag) "\001"))
-      ;; We also call it "exact" if it is surrounded by symbol boundaries.
-      ;; This is needed because etags does not always generate explicit names.
-      (and (looking-at "\\Sw.*\177") (looking-at "\\S_.*\177")
-	   (save-excursion
-	     (backward-char (1+ (length tag)))
-	     (and (looking-at "\\Sw") (looking-at "\\S_"))))))
+      (looking-at (concat "[^\177\n]*\177" (regexp-quote tag) "\001"))))
+
+;; t if point is at a tag line that matches TAG as a symbol.
+;; point should be just after a string that matches TAG.
+(defun tag-symbol-match-p (tag)
+  (and (looking-at "\\Sw.*\177") (looking-at "\\S_.*\177")
+       (save-excursion
+	 (backward-char (1+ (length tag)))
+	 (and (looking-at "\\Sw") (looking-at "\\S_")))))
 
 ;; t if point is at a tag line that matches TAG as a word.
 ;; point should be just after a string that matches TAG.