aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-12-04 21:20:57 +0000
committerGerd Moellmann2000-12-04 21:20:57 +0000
commitfb7775eb569812d8fe8854afca09172204fa5dc6 (patch)
treef0d2553fbb5b8f0254e7b170dc8333b0c9c28dba
parentd895297e8bc1cae818e26279df19473c61f2a84f (diff)
downloademacs-fb7775eb569812d8fe8854afca09172204fa5dc6.tar.gz
emacs-fb7775eb569812d8fe8854afca09172204fa5dc6.zip
(tag-partial-file-name-match-p): New function.
(etags-recognize-tags-table, find-tag-in-order): New functionality: interpret file names as tags.
-rw-r--r--lisp/progmodes/etags.el17
1 files changed, 15 insertions, 2 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 539e4ae57d5..93322d0002a 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -1098,7 +1098,14 @@ where they were found."
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.
@@ -1136,6 +1143,7 @@ where they were found."
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)
@@ -1442,8 +1450,13 @@ where they were found."
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)