aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Gutov2015-05-30 14:35:55 +0300
committerDmitry Gutov2015-05-30 14:35:55 +0300
commit0ac9d09b6dfe47918abe5020a9d7dbc3a625dbac (patch)
tree462e454e09921c29f27ea0721ee2eadd0e190079
parent5e73eab8faaa6c5198d445d8625db53971300777 (diff)
downloademacs-0ac9d09b6dfe47918abe5020a9d7dbc3a625dbac.tar.gz
emacs-0ac9d09b6dfe47918abe5020a9d7dbc3a625dbac.zip
Use list for the tags completion table, not obarray
* lisp/progmodes/etags.el (etags-tags-completion-table): Return a list instead of an obarray (http://lists.gnu.org/archive/html/emacs-devel/2015-05/msg00876.html). (tags-completion-table): Combine those lists. (tags-completion-table): Update the docstring.
-rw-r--r--lisp/progmodes/etags.el22
1 files changed, 9 insertions, 13 deletions
diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 9ff164e15ef..329d899a588 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -204,7 +204,7 @@ nil means it has not yet been computed;
204use function `tags-table-files' to do so.") 204use function `tags-table-files' to do so.")
205 205
206(defvar tags-completion-table nil 206(defvar tags-completion-table nil
207 "Obarray of tag names defined in current tags table.") 207 "List of tag names defined in current tags table.")
208 208
209(defvar tags-included-tables nil 209(defvar tags-included-tables nil
210 "List of tags tables included by the current tags table.") 210 "List of tags tables included by the current tags table.")
@@ -759,23 +759,19 @@ tags table and its (recursively) included tags tables."
759 (or tags-completion-table 759 (or tags-completion-table
760 ;; No cached value for this buffer. 760 ;; No cached value for this buffer.
761 (condition-case () 761 (condition-case ()
762 (let (current-table combined-table) 762 (let (tables cont)
763 (message "Making tags completion table for %s..." buffer-file-name) 763 (message "Making tags completion table for %s..." buffer-file-name)
764 (save-excursion 764 (save-excursion
765 ;; Iterate over the current list of tags tables. 765 ;; Iterate over the current list of tags tables.
766 (while (visit-tags-table-buffer (and combined-table t)) 766 (while (visit-tags-table-buffer cont)
767 ;; Find possible completions in this table. 767 ;; Find possible completions in this table.
768 (setq current-table (funcall tags-completion-table-function)) 768 (push (funcall tags-completion-table-function) tables)
769 ;; Merge this buffer's completions into the combined table. 769 (setq cont t)))
770 (if combined-table
771 (mapatoms
772 (lambda (sym) (intern (symbol-name sym) combined-table))
773 current-table)
774 (setq combined-table current-table))))
775 (message "Making tags completion table for %s...done" 770 (message "Making tags completion table for %s...done"
776 buffer-file-name) 771 buffer-file-name)
777 ;; Cache the result in a buffer-local variable. 772 ;; Cache the result in a buffer-local variable.
778 (setq tags-completion-table combined-table)) 773 (setq tags-completion-table
774 (nreverse (delete-dups (apply #'nconc tables)))))
779 (quit (message "Tags completion table construction aborted.") 775 (quit (message "Tags completion table construction aborted.")
780 (setq tags-completion-table nil))))) 776 (setq tags-completion-table nil)))))
781 777
@@ -1256,7 +1252,7 @@ buffer-local values of tags table format variables."
1256 1252
1257 1253
1258(defun etags-tags-completion-table () ; Doc string? 1254(defun etags-tags-completion-table () ; Doc string?
1259 (let ((table (make-vector 511 0)) 1255 (let (table
1260 (progress-reporter 1256 (progress-reporter
1261 (make-progress-reporter 1257 (make-progress-reporter
1262 (format "Making tags completion table for %s..." buffer-file-name) 1258 (format "Making tags completion table for %s..." buffer-file-name)
@@ -1276,7 +1272,7 @@ buffer-local values of tags table format variables."
1276\\([-a-zA-Z0-9_+*$?:]+\\)[^-a-zA-Z0-9_+*$?:\177]*\\)\177\ 1272\\([-a-zA-Z0-9_+*$?:]+\\)[^-a-zA-Z0-9_+*$?:\177]*\\)\177\
1277\\(\\([^\n\001]+\\)\001\\)?\\([0-9]+\\)?,\\([0-9]+\\)?\n" 1273\\(\\([^\n\001]+\\)\001\\)?\\([0-9]+\\)?,\\([0-9]+\\)?\n"
1278 nil t) 1274 nil t)
1279 (intern (prog1 (if (match-beginning 5) 1275 (push (prog1 (if (match-beginning 5)
1280 ;; There is an explicit tag name. 1276 ;; There is an explicit tag name.
1281 (buffer-substring (match-beginning 5) (match-end 5)) 1277 (buffer-substring (match-beginning 5) (match-end 5))
1282 ;; No explicit tag name. Best guess. 1278 ;; No explicit tag name. Best guess.