aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancesco Potortì2006-02-25 01:48:09 +0000
committerFrancesco Potortì2006-02-25 01:48:09 +0000
commitf37de644fdbf7b2b200ae4ca4af3b1496e7b0265 (patch)
tree73a826aa12bc2538d3069376e48e7c2803b0a99d
parent957e399601c86ede619d9bd75ad31aeb328649e3 (diff)
downloademacs-f37de644fdbf7b2b200ae4ca4af3b1496e7b0265.tar.gz
emacs-f37de644fdbf7b2b200ae4ca4af3b1496e7b0265.zip
(tags-completion-table): Do completion from all the tables in the
current list, as documented in the manual.
-rw-r--r--lisp/progmodes/etags.el38
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."
746;; their tags included in the completion table. 746;; their tags included in the completion table.
747(defun tags-completion-table () 747(defun tags-completion-table ()
748 (or tags-completion-table 748 (or tags-completion-table
749 ;; No cached value for this buffer.
749 (condition-case () 750 (condition-case ()
750 (prog2 751 (let (current-table combined-table)
751 (message "Making tags completion table for %s..." buffer-file-name) 752 (message "Making tags completion table for %s..." buffer-file-name)
752 (let ((included (tags-included-tables)) 753 (save-excursion
753 (table (funcall tags-completion-table-function))) 754 ;; Iterate over the current list of tags tables.
754 (save-excursion 755 (while (visit-tags-table-buffer (and combined-table t))
755 ;; Iterate over the list of included tables, and combine each 756 ;; Find possible completions in this table.
756 ;; included table's completion obarray to the parent obarray. 757 (setq current-table (funcall tags-completion-table-function))
757 (while included 758 ;; Merge this buffer's completions into the combined table.
758 ;; Visit the buffer. 759 (if combined-table
759 (let ((tags-file-name (car included))) 760 (mapatoms
760 (visit-tags-table-buffer 'same)) 761 (lambda (sym) (intern (symbol-name sym) combined-table))
761 ;; Recurse in that buffer to compute its completion table. 762 current-table)
762 (if (tags-completion-table) 763 (setq combined-table current-table))))
763 ;; Combine the tables. 764 (message "Making tags completion table for %s...done"
764 (mapatoms (lambda (sym) (intern (symbol-name sym) table)) 765 buffer-file-name)
765 tags-completion-table)) 766 ;; Cache the result a buffer-local variable.
766 (setq included (cdr included)))) 767 (setq tags-completion-table combined-table))
767 (setq tags-completion-table table))
768 (message "Making tags completion table for %s...done"
769 buffer-file-name))
770 (quit (message "Tags completion table construction aborted.") 768 (quit (message "Tags completion table construction aborted.")
771 (setq tags-completion-table nil))))) 769 (setq tags-completion-table nil)))))
772 770