diff options
| author | Roland McGrath | 1993-09-06 22:15:21 +0000 |
|---|---|---|
| committer | Roland McGrath | 1993-09-06 22:15:21 +0000 |
| commit | add3312f115db81c30b3e1405a5edcb5be8bbda0 (patch) | |
| tree | 28d1964acc8149978d0341b9658dd0fd5102ba21 | |
| parent | 338819bcd0ba2ea3dff2bd9173633338af4bbda1 (diff) | |
| download | emacs-add3312f115db81c30b3e1405a5edcb5be8bbda0.tar.gz emacs-add3312f115db81c30b3e1405a5edcb5be8bbda0.zip | |
(tag-exact-match-p): Return true if TAG is the explicit tag name.
| -rw-r--r-- | lisp/progmodes/etags.el | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 452d9adfd0d..93fa039c505 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el | |||
| @@ -1070,10 +1070,14 @@ See documentation of variable `tags-file-name'." | |||
| 1070 | ;; t if point is at a tag line that matches TAG "exactly". | 1070 | ;; t if point is at a tag line that matches TAG "exactly". |
| 1071 | ;; point should be just after a string that matches TAG. | 1071 | ;; point should be just after a string that matches TAG. |
| 1072 | (defun tag-exact-match-p (tag) | 1072 | (defun tag-exact-match-p (tag) |
| 1073 | (and (looking-at "\\Sw.*\177") (looking-at "\\S_.*\177") ;not a symbol char | 1073 | ;; The match is really exact if there is an explicit tag name. |
| 1074 | (save-excursion | 1074 | (or (looking-at (concat "[^\177]*\177" (regexp-quote tag) "\001")) |
| 1075 | (backward-char (1+ (length tag))) | 1075 | ;; We also call it "exact" if it is surrounded by symbol boundaries. |
| 1076 | (and (looking-at "\\Sw") (looking-at "\\S_"))))) | 1076 | ;; This is needed because etags does not always generate explicit names. |
| 1077 | (and (looking-at "\\Sw.*\177") (looking-at "\\S_.*\177") | ||
| 1078 | (save-excursion | ||
| 1079 | (backward-char (1+ (length tag))) | ||
| 1080 | (and (looking-at "\\Sw") (looking-at "\\S_")))))) | ||
| 1077 | 1081 | ||
| 1078 | ;; t if point is at a tag line that matches TAG as a word. | 1082 | ;; t if point is at a tag line that matches TAG as a word. |
| 1079 | ;; point should be just after a string that matches TAG. | 1083 | ;; point should be just after a string that matches TAG. |