comparison lisp/progmodes/etags.el @ 45923:fe953746c5e8

(tag-implicit-name-match-p): New function. (etags-recognize-tags-table): Use it for implicit tag names.
author Francesco Potortì <pot@gnu.org>
date Thu, 20 Jun 2002 11:27:01 +0000
parents d10f7a8678bc
children eb2e18d1144b
comparison
equal deleted inserted replaced
45922:8ad2c225979d 45923:fe953746c5e8
1194 (find-tag-regexp-next-line-after-failure-p . t) 1194 (find-tag-regexp-next-line-after-failure-p . t)
1195 (find-tag-search-function . search-forward) 1195 (find-tag-search-function . search-forward)
1196 (find-tag-tag-order . (tag-exact-file-name-match-p 1196 (find-tag-tag-order . (tag-exact-file-name-match-p
1197 tag-file-name-match-p 1197 tag-file-name-match-p
1198 tag-exact-match-p 1198 tag-exact-match-p
1199 tag-implicit-name-match-p
1199 tag-symbol-match-p 1200 tag-symbol-match-p
1200 tag-word-match-p 1201 tag-word-match-p
1201 tag-partial-file-name-match-p 1202 tag-partial-file-name-match-p
1202 tag-any-match-p)) 1203 tag-any-match-p))
1203 (find-tag-next-line-after-failure-p . nil) 1204 (find-tag-next-line-after-failure-p . nil)
1502 ;; The match is really exact if there is an explicit tag name. 1503 ;; The match is really exact if there is an explicit tag name.
1503 (or (and (eq (char-after (point)) ?\001) 1504 (or (and (eq (char-after (point)) ?\001)
1504 (eq (char-after (- (point) (length tag) 1)) ?\177)) 1505 (eq (char-after (- (point) (length tag) 1)) ?\177))
1505 ;; We are not on the explicit tag name, but perhaps it follows. 1506 ;; We are not on the explicit tag name, but perhaps it follows.
1506 (looking-at (concat "[^\177\n]*\177" (regexp-quote tag) "\001")))) 1507 (looking-at (concat "[^\177\n]*\177" (regexp-quote tag) "\001"))))
1508
1509 ;; t if point is at a tag line that has an implicit name.
1510 ;; point should be just after a string that matches TAG.
1511 (defun tag-implicit-name-match-p (tag)
1512 ;; Look at the comment of the make_tag function in lib-src/etags.c for
1513 ;; a textual description of the four rules.
1514 (and (string-match "^[^ \t()=,;]+$" tag) ;rule #1
1515 (looking-at "[ \t()=,;]?\177") ;rules #2 and #4
1516 (save-excursion
1517 (backward-char (1+ (length tag)))
1518 (looking-at "[\n \t()=,;]")))) ;rule #3
1507 1519
1508 ;; t if point is at a tag line that matches TAG as a symbol. 1520 ;; t if point is at a tag line that matches TAG as a symbol.
1509 ;; point should be just after a string that matches TAG. 1521 ;; point should be just after a string that matches TAG.
1510 (defun tag-symbol-match-p (tag) 1522 (defun tag-symbol-match-p (tag)
1511 (and (looking-at "\\Sw.*\177") (looking-at "\\S_.*\177") 1523 (and (looking-at "\\Sw.*\177") (looking-at "\\S_.*\177")