comparison lisp/progmodes/etags.el @ 34190:e624fa36b252

(tag-partial-file-name-match-p): New function. (etags-recognize-tags-table, find-tag-in-order): New functionality: interpret file names as tags.
author Gerd Moellmann <gerd@gnu.org>
date Mon, 04 Dec 2000 21:20:57 +0000
parents 5908c0927a3e
children 62f469e476eb
comparison
equal deleted inserted replaced
34189:772e00ca5861 34190:e624fa36b252
1096 ;; Found a tag; extract location info. 1096 ;; Found a tag; extract location info.
1097 (beginning-of-line) 1097 (beginning-of-line)
1098 (setq tag-lines-already-matched (cons match-marker 1098 (setq tag-lines-already-matched (cons match-marker
1099 tag-lines-already-matched)) 1099 tag-lines-already-matched))
1100 ;; Expand the filename, using the tags table buffer's default-directory. 1100 ;; Expand the filename, using the tags table buffer's default-directory.
1101 (setq file (expand-file-name (file-of-tag)) 1101 ;; We should be able to search for file-name backwards in file-of-tag:
1102 ;; the beginning-of-line is ok except when positionned on a "file-name" tag.
1103 (setq file (expand-file-name
1104 (if (or (eq (car order) 'tag-exact-file-name-match-p)
1105 (eq (car order) 'tag-partial-file-name-match-p))
1106 (save-excursion (next-line 1)
1107 (file-of-tag))
1108 (file-of-tag)))
1102 tag-info (funcall snarf-tag-function)) 1109 tag-info (funcall snarf-tag-function))
1103 1110
1104 ;; Get the local value in the tags table buffer before switching buffers. 1111 ;; Get the local value in the tags table buffer before switching buffers.
1105 (setq goto-func goto-tag-location-function) 1112 (setq goto-func goto-tag-location-function)
1106 1113
1134 (find-tag-search-function . search-forward) 1141 (find-tag-search-function . search-forward)
1135 (find-tag-tag-order . (tag-exact-file-name-match-p 1142 (find-tag-tag-order . (tag-exact-file-name-match-p
1136 tag-exact-match-p 1143 tag-exact-match-p
1137 tag-symbol-match-p 1144 tag-symbol-match-p
1138 tag-word-match-p 1145 tag-word-match-p
1146 tag-partial-file-name-match-p
1139 tag-any-match-p)) 1147 tag-any-match-p))
1140 (find-tag-next-line-after-failure-p . nil) 1148 (find-tag-next-line-after-failure-p . nil)
1141 (list-tags-function . etags-list-tags) 1149 (list-tags-function . etags-list-tags)
1142 (tags-apropos-function . etags-tags-apropos) 1150 (tags-apropos-function . etags-tags-apropos)
1143 (tags-included-tables-function . etags-tags-included-tables) 1151 (tags-included-tables-function . etags-tags-included-tables)
1440 (save-excursion (backward-char (length tag)) 1448 (save-excursion (backward-char (length tag))
1441 (looking-at "\\b")))) 1449 (looking-at "\\b"))))
1442 1450
1443 (defun tag-exact-file-name-match-p (tag) 1451 (defun tag-exact-file-name-match-p (tag)
1444 (and (looking-at ",") 1452 (and (looking-at ",")
1445 (save-excursion (backward-char (length tag)) 1453 (save-excursion (backward-char (+ 2 (length tag)))
1446 (looking-at "\f\n")))) 1454 (looking-at "\f\n"))))
1455 (defun tag-partial-file-name-match-p (tag)
1456 (and (looking-at ".*,")
1457 (save-excursion (beginning-of-line)
1458 (backward-char 2)
1459 (looking-at "\f\n"))))
1447 1460
1448 ;; t if point is in a tag line with a tag containing TAG as a substring. 1461 ;; t if point is in a tag line with a tag containing TAG as a substring.
1449 (defun tag-any-match-p (tag) 1462 (defun tag-any-match-p (tag)
1450 (looking-at ".*\177")) 1463 (looking-at ".*\177"))
1451 1464