diff options
author | Francesco Potortì <pot@gnu.org> | 2006-02-25 01:48:09 +0000 |
---|---|---|
committer | Francesco Potortì <pot@gnu.org> | 2006-02-25 01:48:09 +0000 |
commit | f37de644fdbf7b2b200ae4ca4af3b1496e7b0265 (patch) | |
tree | 73a826aa12bc2538d3069376e48e7c2803b0a99d /lisp | |
parent | 957e399601c86ede619d9bd75ad31aeb328649e3 (diff) | |
download | emacs-f37de644fdbf7b2b200ae4ca4af3b1496e7b0265.tar.gz emacs-f37de644fdbf7b2b200ae4ca4af3b1496e7b0265.tar.bz2 emacs-f37de644fdbf7b2b200ae4ca4af3b1496e7b0265.zip |
(tags-completion-table): Do completion from all the tables in the
current list, as documented in the manual.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/progmodes/etags.el | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 6fe9fec3094..30cfa1b7b21 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -746,27 +746,25 @@ Assumes the tags table is the current buffer." ;; their tags included in the completion table. (defun tags-completion-table () (or tags-completion-table + ;; No cached value for this buffer. (condition-case () - (prog2 - (message "Making tags completion table for %s..." buffer-file-name) - (let ((included (tags-included-tables)) - (table (funcall tags-completion-table-function))) - (save-excursion - ;; Iterate over the list of included tables, and combine each - ;; included table's completion obarray to the parent obarray. - (while included - ;; Visit the buffer. - (let ((tags-file-name (car included))) - (visit-tags-table-buffer 'same)) - ;; Recurse in that buffer to compute its completion table. - (if (tags-completion-table) - ;; Combine the tables. - (mapatoms (lambda (sym) (intern (symbol-name sym) table)) - tags-completion-table)) - (setq included (cdr included)))) - (setq tags-completion-table table)) - (message "Making tags completion table for %s...done" - buffer-file-name)) + (let (current-table combined-table) + (message "Making tags completion table for %s..." buffer-file-name) + (save-excursion + ;; Iterate over the current list of tags tables. + (while (visit-tags-table-buffer (and combined-table t)) + ;; Find possible completions in this table. + (setq current-table (funcall tags-completion-table-function)) + ;; Merge this buffer's completions into the combined table. + (if combined-table + (mapatoms + (lambda (sym) (intern (symbol-name sym) combined-table)) + current-table) + (setq combined-table current-table)))) + (message "Making tags completion table for %s...done" + buffer-file-name) + ;; Cache the result a buffer-local variable. + (setq tags-completion-table combined-table)) (quit (message "Tags completion table construction aborted.") (setq tags-completion-table nil))))) |