diff options
| author | Dave Love | 2000-05-22 18:03:36 +0000 |
|---|---|---|
| committer | Dave Love | 2000-05-22 18:03:36 +0000 |
| commit | dd2cedb97c45b57c26883bfac4d5205cb977c8d6 (patch) | |
| tree | ebf95ee35447eba72c41c503d14b41aaf5a5dc4e | |
| parent | d2c49fd8d7e2525fcc67687d49fcf77f137c6419 (diff) | |
| download | emacs-dd2cedb97c45b57c26883bfac4d5205cb977c8d6.tar.gz emacs-dd2cedb97c45b57c26883bfac4d5205cb977c8d6.zip | |
Add to debug-ignored-errors.
(visit-tags-table-buffer): Clear out buffers holding old tables when
making a new list.
(etags-recognize-tags-table, tags-recognize-empty-tags-table): Use mapc.
(tags-with-face): Use make-symbol, not gensym.
| -rw-r--r-- | lisp/progmodes/etags.el | 86 |
1 files changed, 55 insertions, 31 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 29cac6ee1c2..7469308a781 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; etags.el --- etags facility for Emacs | 1 | ;;; etags.el --- etags facility for Emacs |
| 2 | ;; Copyright (C) 1985, 1986, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1998 | 2 | ;; Copyright (C) 1985, 86, 88, 89, 92, 93, 94, 95, 96, 98, 2000 |
| 3 | ;; Free Software Foundation, Inc. | 3 | ;; Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Roland McGrath <roland@gnu.org> | 5 | ;; Author: Roland McGrath <roland@gnu.org> |
| @@ -633,6 +633,11 @@ Returns t if it visits a tags table, or nil if there are no more in the list." | |||
| 633 | (setq tags-table-set-list | 633 | (setq tags-table-set-list |
| 634 | (cons tags-table-list | 634 | (cons tags-table-list |
| 635 | tags-table-set-list))) | 635 | tags-table-set-list))) |
| 636 | ;; Clear out buffers holding old tables. | ||
| 637 | (dolist (table tags-table-list) | ||
| 638 | (let ((buffer (find-buffer-visiting table))) | ||
| 639 | (if buffer | ||
| 640 | (kill-buffer buffer)))) | ||
| 636 | (setq tags-table-list (list local-tags-file-name)))) | 641 | (setq tags-table-list (list local-tags-file-name)))) |
| 637 | 642 | ||
| 638 | ;; Recompute tags-table-computed-list. | 643 | ;; Recompute tags-table-computed-list. |
| @@ -784,6 +789,11 @@ Assumes the tags table is the current buffer." | |||
| 784 | 789 | ||
| 785 | (defvar find-tag-history nil) | 790 | (defvar find-tag-history nil) |
| 786 | 791 | ||
| 792 | ;; Dynamic bondage: | ||
| 793 | (eval-when-compile | ||
| 794 | (defvar etags-case-fold-search) | ||
| 795 | (defvar etags-syntax-table)) | ||
| 796 | |||
| 787 | ;;;###autoload | 797 | ;;;###autoload |
| 788 | (defun find-tag-noselect (tagname &optional next-p regexp-p) | 798 | (defun find-tag-noselect (tagname &optional next-p regexp-p) |
| 789 | "Find tag (in current tags table) whose name contains TAGNAME. | 799 | "Find tag (in current tags table) whose name contains TAGNAME. |
| @@ -1108,27 +1118,27 @@ where they were found." | |||
| 1108 | ;; It is annoying to flash messages on the screen briefly, | 1118 | ;; It is annoying to flash messages on the screen briefly, |
| 1109 | ;; and this message is not useful. -- rms | 1119 | ;; and this message is not useful. -- rms |
| 1110 | ;; (message "%s is an `etags' TAGS file" buffer-file-name) | 1120 | ;; (message "%s is an `etags' TAGS file" buffer-file-name) |
| 1111 | (mapcar (lambda (elt) (set (make-local-variable (car elt)) (cdr elt))) | 1121 | (mapc (lambda (elt) (set (make-local-variable (car elt)) (cdr elt))) |
| 1112 | '((file-of-tag-function . etags-file-of-tag) | 1122 | '((file-of-tag-function . etags-file-of-tag) |
| 1113 | (tags-table-files-function . etags-tags-table-files) | 1123 | (tags-table-files-function . etags-tags-table-files) |
| 1114 | (tags-completion-table-function . etags-tags-completion-table) | 1124 | (tags-completion-table-function . etags-tags-completion-table) |
| 1115 | (snarf-tag-function . etags-snarf-tag) | 1125 | (snarf-tag-function . etags-snarf-tag) |
| 1116 | (goto-tag-location-function . etags-goto-tag-location) | 1126 | (goto-tag-location-function . etags-goto-tag-location) |
| 1117 | (find-tag-regexp-search-function . re-search-forward) | 1127 | (find-tag-regexp-search-function . re-search-forward) |
| 1118 | (find-tag-regexp-tag-order . (tag-re-match-p)) | 1128 | (find-tag-regexp-tag-order . (tag-re-match-p)) |
| 1119 | (find-tag-regexp-next-line-after-failure-p . t) | 1129 | (find-tag-regexp-next-line-after-failure-p . t) |
| 1120 | (find-tag-search-function . search-forward) | 1130 | (find-tag-search-function . search-forward) |
| 1121 | (find-tag-tag-order . (tag-exact-file-name-match-p | 1131 | (find-tag-tag-order . (tag-exact-file-name-match-p |
| 1122 | tag-exact-match-p | 1132 | tag-exact-match-p |
| 1123 | tag-symbol-match-p | 1133 | tag-symbol-match-p |
| 1124 | tag-word-match-p | 1134 | tag-word-match-p |
| 1125 | tag-any-match-p)) | 1135 | tag-any-match-p)) |
| 1126 | (find-tag-next-line-after-failure-p . nil) | 1136 | (find-tag-next-line-after-failure-p . nil) |
| 1127 | (list-tags-function . etags-list-tags) | 1137 | (list-tags-function . etags-list-tags) |
| 1128 | (tags-apropos-function . etags-tags-apropos) | 1138 | (tags-apropos-function . etags-tags-apropos) |
| 1129 | (tags-included-tables-function . etags-tags-included-tables) | 1139 | (tags-included-tables-function . etags-tags-included-tables) |
| 1130 | (verify-tags-table-function . etags-verify-tags-table) | 1140 | (verify-tags-table-function . etags-verify-tags-table) |
| 1131 | )))) | 1141 | )))) |
| 1132 | 1142 | ||
| 1133 | ;; Return non-nil iff the current buffer is a valid etags TAGS file. | 1143 | ;; Return non-nil iff the current buffer is a valid etags TAGS file. |
| 1134 | (defun etags-verify-tags-table () | 1144 | (defun etags-verify-tags-table () |
| @@ -1285,9 +1295,10 @@ where they were found." | |||
| 1285 | (defmacro tags-with-face (face &rest body) | 1295 | (defmacro tags-with-face (face &rest body) |
| 1286 | "Execute BODY, give output to `standard-output' face FACE." | 1296 | "Execute BODY, give output to `standard-output' face FACE." |
| 1287 | (let ((pp (gensym "twf-"))) | 1297 | (let ((pp (gensym "twf-"))) |
| 1288 | `(let ((,pp (with-current-buffer standard-output (point)))) | 1298 | `(let ((,old-point (with-current-buffer standard-output (point)))) |
| 1289 | ,@body | 1299 | ,@body |
| 1290 | (put-text-property ,pp (with-current-buffer standard-output (point)) | 1300 | (put-text-property ,old-point (with-current-buffer standard-output |
| 1301 | (point)) | ||
| 1291 | 'face ,face standard-output)))) | 1302 | 'face ,face standard-output)))) |
| 1292 | 1303 | ||
| 1293 | (defun etags-tags-apropos-additional (regexp) | 1304 | (defun etags-tags-apropos-additional (regexp) |
| @@ -1373,13 +1384,13 @@ where they were found." | |||
| 1373 | ;; variables which do nothing. | 1384 | ;; variables which do nothing. |
| 1374 | (defun tags-recognize-empty-tags-table () | 1385 | (defun tags-recognize-empty-tags-table () |
| 1375 | (and (zerop (buffer-size)) | 1386 | (and (zerop (buffer-size)) |
| 1376 | (mapcar (lambda (sym) (set (make-local-variable sym) 'ignore)) | 1387 | (mapc (lambda (sym) (set (make-local-variable sym) 'ignore)) |
| 1377 | '(tags-table-files-function | 1388 | '(tags-table-files-function |
| 1378 | tags-completion-table-function | 1389 | tags-completion-table-function |
| 1379 | find-tag-regexp-search-function | 1390 | find-tag-regexp-search-function |
| 1380 | find-tag-search-function | 1391 | find-tag-search-function |
| 1381 | tags-apropos-function | 1392 | tags-apropos-function |
| 1382 | tags-included-tables-function)) | 1393 | tags-included-tables-function)) |
| 1383 | (set (make-local-variable 'verify-tags-table-function) | 1394 | (set (make-local-variable 'verify-tags-table-function) |
| 1384 | (lambda () (zerop (buffer-size)))))) | 1395 | (lambda () (zerop (buffer-size)))))) |
| 1385 | 1396 | ||
| @@ -1818,6 +1829,19 @@ for \\[find-tag] (which see)." | |||
| 1818 | (display-completion-list | 1829 | (display-completion-list |
| 1819 | (all-completions pattern 'tags-complete-tag nil))) | 1830 | (all-completions pattern 'tags-complete-tag nil))) |
| 1820 | (message "Making completion list...%s" "done"))))) | 1831 | (message "Making completion list...%s" "done"))))) |
| 1832 | |||
| 1833 | (dolist (x '("^No tags table in use; use .* to select one$" | ||
| 1834 | "^There is no default tag$" | ||
| 1835 | "^No previous tag locations$" | ||
| 1836 | "^File .* is not a valid tags table$" | ||
| 1837 | "^No \\(more \\|\\)tags \\(matching\\|containing\\) " | ||
| 1838 | "^Rerun etags: `.*' not found in " | ||
| 1839 | "^All files processed$" | ||
| 1840 | "^No .* or .* in progress$" | ||
| 1841 | "^File .* not in current tags tables$" | ||
| 1842 | "^No tags table loaded" | ||
| 1843 | "^Nothing to complete$")) | ||
| 1844 | (add-to-list 'debug-ignored-errors x)) | ||
| 1821 | 1845 | ||
| 1822 | (provide 'etags) | 1846 | (provide 'etags) |
| 1823 | 1847 | ||