]> git.eshelyaron.com Git - emacs.git/commitdiff
(tag-implicit-name-match-p): New function.
authorFrancesco Potortì <pot@gnu.org>
Thu, 20 Jun 2002 11:27:01 +0000 (11:27 +0000)
committerFrancesco Potortì <pot@gnu.org>
Thu, 20 Jun 2002 11:27:01 +0000 (11:27 +0000)
(etags-recognize-tags-table): Use it for implicit tag names.

lisp/progmodes/etags.el

index a4aeaa2e3fe00add3357b826de9ed6fecb0cc39a..ed9959a1c02bc106c79b0dfc4c9c1e20ace36848 100644 (file)
@@ -1196,6 +1196,7 @@ where they were found."
               (find-tag-tag-order . (tag-exact-file-name-match-p
                                       tag-file-name-match-p
                                      tag-exact-match-p
+                                     tag-implicit-name-match-p
                                      tag-symbol-match-p
                                      tag-word-match-p
                                      tag-partial-file-name-match-p
@@ -1505,6 +1506,17 @@ where they were found."
       ;; We are not on the explicit tag name, but perhaps it follows.
       (looking-at (concat "[^\177\n]*\177" (regexp-quote tag) "\001"))))
 
+;; t if point is at a tag line that has an implicit name.
+;; point should be just after a string that matches TAG.
+(defun tag-implicit-name-match-p (tag)
+  ;; Look at the comment of the make_tag function in lib-src/etags.c for
+  ;; a textual description of the four rules.
+  (and (string-match "^[^ \t()=,;]+$" tag) ;rule #1
+       (looking-at "[ \t()=,;]?\177")  ;rules #2 and #4
+       (save-excursion
+        (backward-char (1+ (length tag)))
+        (looking-at "[\n \t()=,;]")))) ;rule #3
+
 ;; 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)