From eb21e7ae84f306dacda799b4f87bc8d4c6e37e0d Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 23 Sep 1994 17:44:56 +0000 Subject: [PATCH] (tag-symbol-match-p): New function. (etags-recognize-tags-table): Add that second in find-tag-tag-order, after tag-exact-match-p. --- lisp/progmodes/etags.el | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 1a5802c8214..144e143090e 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -950,8 +950,10 @@ See documentation of variable `tags-file-name'." (find-tag-regexp-tag-order . (tag-re-match-p)) (find-tag-regexp-next-line-after-failure-p . t) (find-tag-search-function . search-forward) - (find-tag-tag-order . (tag-exact-match-p tag-word-match-p - tag-any-match-p)) + (find-tag-tag-order . (tag-exact-match-p + tag-symbol-match-p + tag-word-match-p + tag-any-match-p)) (find-tag-next-line-after-failure-p . nil) (list-tags-function . etags-list-tags) (tags-apropos-function . etags-tags-apropos) @@ -1156,20 +1158,22 @@ See documentation of variable `tags-file-name'." ;; (set-syntax-table otable))))) ;;(put 'tags-with-syntax 'edebug-form-spec '(&rest form)) -;; t if point is at a tag line that matches TAG "exactly". +;; t if point is at a tag line that matches TAG exactly. ;; point should be just after a string that matches TAG. (defun tag-exact-match-p (tag) ;; The match is really exact if there is an explicit tag name. (or (and (eq (char-after (point)) ?\001) (eq (char-after (- (point) (length tag) 1)) ?\177)) ;; We are not on the explicit tag name, but perhaps it follows. - (looking-at (concat "[^\177\n]*\177" (regexp-quote tag) "\001")) - ;; We also call it "exact" if it is surrounded by symbol boundaries. - ;; This is needed because etags does not always generate explicit names. - (and (looking-at "\\Sw.*\177") (looking-at "\\S_.*\177") - (save-excursion - (backward-char (1+ (length tag))) - (and (looking-at "\\Sw") (looking-at "\\S_")))))) + (looking-at (concat "[^\177\n]*\177" (regexp-quote tag) "\001")))) + +;; 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) + (and (looking-at "\\Sw.*\177") (looking-at "\\S_.*\177") + (save-excursion + (backward-char (1+ (length tag))) + (and (looking-at "\\Sw") (looking-at "\\S_"))))) ;; t if point is at a tag line that matches TAG as a word. ;; point should be just after a string that matches TAG. -- 2.39.5