diff options
| author | Roland McGrath | 1992-07-27 02:14:20 +0000 |
|---|---|---|
| committer | Roland McGrath | 1992-07-27 02:14:20 +0000 |
| commit | 8a4c10dcc63f575b0a5e20b50757640c0a158ee7 (patch) | |
| tree | 85e8639f7692c310f54dd84fe5f6b08a130e31ff | |
| parent | 8e5056e553512682908a705c28993acfee5bd010 (diff) | |
| download | emacs-8a4c10dcc63f575b0a5e20b50757640c0a158ee7.tar.gz emacs-8a4c10dcc63f575b0a5e20b50757640c0a158ee7.zip | |
*** empty log message ***
| -rw-r--r-- | lisp/progmodes/etags.el | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 28e7f8412c6..0bd50a424f2 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el | |||
| @@ -807,12 +807,29 @@ See documentation of variable `tags-file-name'." | |||
| 807 | 807 | ||
| 808 | ;;; Match qualifier functions for tagnames. | 808 | ;;; Match qualifier functions for tagnames. |
| 809 | 809 | ||
| 810 | (defmacro tags-with-syntax (&rest body) | ||
| 811 | (` (let ((current (current-buffer)) | ||
| 812 | (otable (syntax-table)) | ||
| 813 | (buffer (find-file-noselect (file-of-tag))) | ||
| 814 | table) | ||
| 815 | (unwind-protect | ||
| 816 | (progn | ||
| 817 | (set-buffer buffer) | ||
| 818 | (setq table (syntax-table)) | ||
| 819 | (set-buffer current) | ||
| 820 | (set-syntax-table table) | ||
| 821 | (,@ body)) | ||
| 822 | (set-syntax-table otable))))) | ||
| 823 | |||
| 810 | ;; t if point is at a tag line that matches TAG "exactly". | 824 | ;; t if point is at a tag line that matches TAG "exactly". |
| 811 | ;; point should be just after a string that matches TAG. | 825 | ;; point should be just after a string that matches TAG. |
| 812 | (defun tag-exact-match-p (tag) | 826 | (defun tags-exact-match-p (tag) |
| 813 | (and (looking-at "[ \t();,]?.*\177") | 827 | (tags-with-syntax |
| 814 | (let ((c (char-after (- (point) (length tag))))) | 828 | (let ((end (point))) |
| 815 | (or (= c ?\n) (= c ?\ ) (= c ?\t))))) | 829 | (unwind-protect |
| 830 | (= (match-beginning 0) | ||
| 831 | (re-search-backward "\\(\\sw\\|\\s_\\)+" end t)) | ||
| 832 | (goto-char end))))) | ||
| 816 | 833 | ||
| 817 | ;; t if point is at a tag line that matches TAG as a word. | 834 | ;; t if point is at a tag line that matches TAG as a word. |
| 818 | ;; point should be just after a string that matches TAG. | 835 | ;; point should be just after a string that matches TAG. |