Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
etags-tags-completion-table
should return an obarray on Emacs 24.
PR #946 copied the implementation from Emacs 25. However, Emacs 25 expects the function to return a list (see Emacs commit 0ac9d09b6dfe479), whereas Emacs 24 expects an obarray: Debugger entered--Lisp error: (wrong-type-argument vectorp ("BUILD_DIR" "CFLAGS" ...)) mapatoms((closure ((combined-table "Environment" "items" ...) (current-table "BUILD_DIR" "CFLAGS" ...) t) (sym) (intern (symbol-name sym) combined-table)) ("BUILD_DIR" "CFLAGS" ...)) (if combined-table (mapatoms (function (lambda (sym) (intern (symbol-name sym) combined-table))) current-table) (setq combined-table current-table)) (while (visit-tags-table-buffer (and combined-table t)) (setq current-table (funcall tags-completion-table-function)) (if combined-table (mapatoms (function (lambda (sym) (intern (symbol-name sym) combined-table))) current-table) (setq combined-table current-table))) (save-excursion (while (visit-tags-table-buffer (and combined-table t)) (setq current-table (funcall tags-completion-table-function)) (if combined-table (mapatoms (function (lambda (sym) (intern (symbol-name sym) combined-table))) current-table) (setq combined-table current-table)))) (let (current-table combined-table) (message "Making tags completion table for %s..." buffer-file-name) (save-excursion (while (visit-tags-table-buffer (and combined-table t)) (setq current-table (funcall tags-completion-table-function)) (if combined-table (mapatoms (function (lambda (sym) (intern ... combined-table))) current-table) (setq combined-table current-table)))) (message "Making tags completion table for %s...done" buffer-file-name) (setq tags-completion-table combined-table)) (condition-case nil (let (current-table combined-table) (message "Making tags completion table for %s..." buffer-file-name) (save-excursion (while (visit-tags-table-buffer (and combined-table t)) (setq current-table (funcall tags-completion-table-function)) (if combined-table (mapatoms (function (lambda ... ...)) current-table) (setq combined-table current-table)))) (message "Making tags completion table for %s...done" buffer-file-name) (setq tags-completion-table combined-table)) (quit (message "Tags completion table construction aborted.") (setq tags-completion-table nil))) (or tags-completion-table (condition-case nil (let (current-table combined-table) (message "Making tags completion table for %s..." buffer-file-name) (save-excursion (while (visit-tags-table-buffer (and combined-table t)) (setq current-table (funcall tags-completion-table-function)) (if combined-table (mapatoms (function ...) current-table) (setq combined-table current-table)))) (message "Making tags completion table for %s...done" buffer-file-name) (setq tags-completion-table combined-table)) (quit (message "Tags completion table construction aborted.") (setq tags-completion-table nil)))) tags-completion-table() If there are multiple entries in `tags-table-list`, and the variable `tags-completion-table` is nil (no cached value), then the function `tags-completion-table` combines all the tags tables in `tags-table-list`. However, the function `tags-completion-table` uses `mapatoms` because it expects `tags-completion-table-function` to return an obarray. Insted, it dies with the above error. Several useful commands end up calling `tags-completion-table`, my favourite is `company-capf`, which dies with "Company: An error occurred in auto-begin" due to this issue.
- Loading branch information