Function: tags-completion-table

tags-completion-table is a byte-compiled function defined in etags.el.gz.

Signature

(tags-completion-table &optional BUF)

Documentation

Build tags-completion-table(var)/tags-completion-table(fun) on demand for a buffer's tags tables.

Optional argument BUF specifies the buffer for which to build tags-completion-table(var)/tags-completion-table(fun), and defaults to the current buffer. The tags included in the completion table are those in the current tags table for BUF and its (recursively) included tags tables.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/etags.el.gz
(defun tags-completion-table (&optional buf)
  "Build `tags-completion-table' on demand for a buffer's tags tables.
Optional argument BUF specifies the buffer for which to build
\`tags-completion-table', and defaults to the current buffer.
The tags included in the completion table are those in the current
tags table for BUF and its (recursively) included tags tables."
  (if (not buf) (setq buf (current-buffer)))
  (with-current-buffer buf
    (or tags-completion-table
        ;; No cached value for this buffer.
        (condition-case ()
            (let (tables cont)
              (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 cont buf)
                  ;; Find possible completions in this table.
                  (push (funcall tags-completion-table-function) tables)
                  (setq cont t)))
              (message "Making tags completion table for %s...done"
                       buffer-file-name)
              ;; Cache the result in a variable.
              (setq tags-completion-table
                    (nreverse (delete-dups (apply #'nconc tables)))))
          (quit (message "Tags completion table construction aborted.")
                (setq tags-completion-table nil))))))