Function: list-tags

list-tags is an autoloaded, interactive and byte-compiled function defined in etags.el.gz.

Signature

(list-tags FILE &optional NEXT-MATCH)

Documentation

Display list of tags in file FILE.

This searches only the first table in the list, and no included tables. FILE should be as it appeared in the etags command, usually without a directory specification. If called interactively, FILE defaults to the file name of the current buffer.

View in manual

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/etags.el.gz
;;;###autoload
(defun list-tags (file &optional _next-match)
  "Display list of tags in file FILE.
This searches only the first table in the list, and no included
tables.  FILE should be as it appeared in the `etags' command,
usually without a directory specification.  If called
interactively, FILE defaults to the file name of the current
buffer."
  (interactive (list (completing-read
                      "List tags in file: "
                      'tags-complete-tags-table-file
                      nil t
                      ;; Default FILE to the current buffer.
                      (tags--get-current-buffer-name-in-tags-file))))
  (with-output-to-temp-buffer "*Tags List*"
    (princ (substitute-command-keys "Tags in file `"))
    (tags-with-face 'highlight (princ file))
    (princ (substitute-command-keys "':\n\n"))
    (save-excursion
      (let ((first-time t)
	    (gotany nil)
            (cbuf (current-buffer)))
	(while (visit-tags-table-buffer (not first-time) cbuf)
	  (setq first-time nil)
	  (if (funcall list-tags-function file)
	      (setq gotany t)))
	(or gotany
	    (user-error "File %s not in current tags tables" file)))))
  (with-current-buffer "*Tags List*"
    (require 'apropos)
    (with-no-warnings
      (apropos-mode))
    (setq buffer-read-only t)))