Mercurial > emacs
changeset 29080:3b2040b6030a
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.
author | Dave Love <fx@gnu.org> |
---|---|
date | Mon, 22 May 2000 18:03:36 +0000 |
parents | 3313f117f0ed |
children | ac55b16c8782 |
files | lisp/progmodes/etags.el |
diffstat | 1 files changed, 55 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/progmodes/etags.el Mon May 22 17:53:15 2000 +0000 +++ b/lisp/progmodes/etags.el Mon May 22 18:03:36 2000 +0000 @@ -1,5 +1,5 @@ ;;; etags.el --- etags facility for Emacs -;; Copyright (C) 1985, 1986, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1998 +;; Copyright (C) 1985, 86, 88, 89, 92, 93, 94, 95, 96, 98, 2000 ;; Free Software Foundation, Inc. ;; Author: Roland McGrath <roland@gnu.org> @@ -633,6 +633,11 @@ (setq tags-table-set-list (cons tags-table-list tags-table-set-list))) + ;; Clear out buffers holding old tables. + (dolist (table tags-table-list) + (let ((buffer (find-buffer-visiting table))) + (if buffer + (kill-buffer buffer)))) (setq tags-table-list (list local-tags-file-name)))) ;; Recompute tags-table-computed-list. @@ -784,6 +789,11 @@ (defvar find-tag-history nil) +;; Dynamic bondage: +(eval-when-compile + (defvar etags-case-fold-search) + (defvar etags-syntax-table)) + ;;;###autoload (defun find-tag-noselect (tagname &optional next-p regexp-p) "Find tag (in current tags table) whose name contains TAGNAME. @@ -1108,27 +1118,27 @@ ;; It is annoying to flash messages on the screen briefly, ;; and this message is not useful. -- rms ;; (message "%s is an `etags' TAGS file" buffer-file-name) - (mapcar (lambda (elt) (set (make-local-variable (car elt)) (cdr elt))) - '((file-of-tag-function . etags-file-of-tag) - (tags-table-files-function . etags-tags-table-files) - (tags-completion-table-function . etags-tags-completion-table) - (snarf-tag-function . etags-snarf-tag) - (goto-tag-location-function . etags-goto-tag-location) - (find-tag-regexp-search-function . re-search-forward) - (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-file-name-match-p - 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) - (tags-included-tables-function . etags-tags-included-tables) - (verify-tags-table-function . etags-verify-tags-table) - )))) + (mapc (lambda (elt) (set (make-local-variable (car elt)) (cdr elt))) + '((file-of-tag-function . etags-file-of-tag) + (tags-table-files-function . etags-tags-table-files) + (tags-completion-table-function . etags-tags-completion-table) + (snarf-tag-function . etags-snarf-tag) + (goto-tag-location-function . etags-goto-tag-location) + (find-tag-regexp-search-function . re-search-forward) + (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-file-name-match-p + 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) + (tags-included-tables-function . etags-tags-included-tables) + (verify-tags-table-function . etags-verify-tags-table) + )))) ;; Return non-nil iff the current buffer is a valid etags TAGS file. (defun etags-verify-tags-table () @@ -1285,9 +1295,10 @@ (defmacro tags-with-face (face &rest body) "Execute BODY, give output to `standard-output' face FACE." (let ((pp (gensym "twf-"))) - `(let ((,pp (with-current-buffer standard-output (point)))) + `(let ((,old-point (with-current-buffer standard-output (point)))) ,@body - (put-text-property ,pp (with-current-buffer standard-output (point)) + (put-text-property ,old-point (with-current-buffer standard-output + (point)) 'face ,face standard-output)))) (defun etags-tags-apropos-additional (regexp) @@ -1373,13 +1384,13 @@ ;; variables which do nothing. (defun tags-recognize-empty-tags-table () (and (zerop (buffer-size)) - (mapcar (lambda (sym) (set (make-local-variable sym) 'ignore)) - '(tags-table-files-function - tags-completion-table-function - find-tag-regexp-search-function - find-tag-search-function - tags-apropos-function - tags-included-tables-function)) + (mapc (lambda (sym) (set (make-local-variable sym) 'ignore)) + '(tags-table-files-function + tags-completion-table-function + find-tag-regexp-search-function + find-tag-search-function + tags-apropos-function + tags-included-tables-function)) (set (make-local-variable 'verify-tags-table-function) (lambda () (zerop (buffer-size)))))) @@ -1818,6 +1829,19 @@ (display-completion-list (all-completions pattern 'tags-complete-tag nil))) (message "Making completion list...%s" "done"))))) + +(dolist (x '("^No tags table in use; use .* to select one$" + "^There is no default tag$" + "^No previous tag locations$" + "^File .* is not a valid tags table$" + "^No \\(more \\|\\)tags \\(matching\\|containing\\) " + "^Rerun etags: `.*' not found in " + "^All files processed$" + "^No .* or .* in progress$" + "^File .* not in current tags tables$" + "^No tags table loaded" + "^Nothing to complete$")) + (add-to-list 'debug-ignored-errors x)) (provide 'etags)