]> git.eshelyaron.com Git - emacs.git/commitdiff
(tag-symbol-match-p): New function.
authorRoland McGrath <roland@gnu.org>
Fri, 23 Sep 1994 17:44:56 +0000 (17:44 +0000)
committerRoland McGrath <roland@gnu.org>
Fri, 23 Sep 1994 17:44:56 +0000 (17:44 +0000)
(etags-recognize-tags-table): Add that second in find-tag-tag-order,
after tag-exact-match-p.

lisp/progmodes/etags.el

index 1a5802c8214ee03e59438d1128475b7a8ed78e14..144e143090e8f957bbd17aa4f02f9d282f151700 100644 (file)
@@ -950,8 +950,10 @@ See documentation of variable `tags-file-name'."
                 (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 @@ See documentation of variable `tags-file-name'."
 ;;      (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.