Function: smart-tags-file-list

smart-tags-file-list is an autoloaded and byte-compiled function defined in hmouse-tag.el.

Signature

(smart-tags-file-list &optional CURR-DIRS-OR-FILENAME NAME-OF-TAGS-FILE)

Documentation

Return tag files list for optional CURR-DIRS-OR-FILENAME or default-directory.

CURR-DIRS-OR-FILENAME may also be a list of directories in which to find tags files. Tag files returned may not yet exist.

Optional NAME-OF-TAGS-FILE is the literal filename (no directory) for which to look; when null, use "TAGS". If the list returned is empty, signal an error.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hmouse-tag.el
;;;###autoload
(defun smart-tags-file-list (&optional curr-dirs-or-filename name-of-tags-file)
  "Return tag files list for optional CURR-DIRS-OR-FILENAME or `default-directory'.
CURR-DIRS-OR-FILENAME may also be a list of directories in which to
find tags files.  Tag files returned may not yet exist.

Optional NAME-OF-TAGS-FILE is the literal filename (no directory) for
which to look; when null, use \"TAGS\".  If the list returned is empty,
signal an error."
  (let* ((dirs (or (and (smart-tags-org-src-block-p) (hsys-org-get-value :dir))
		   curr-dirs-or-filename default-directory))
	 (tags-table-list (smart-ancestor-tag-files dirs name-of-tags-file)))
    ;; If no tags files were found and the current buffer may contain
    ;; Emacs Lisp identifiers and is in a 'load-path' directory, then
    ;; use the default Emacs Lisp tag table.
    (unless tags-table-list
      (cond ((and (stringp curr-dirs-or-filename)
		  smart-emacs-tags-file
		  (smart-emacs-lisp-mode-p)
		  (let ((dir (file-name-directory curr-dirs-or-filename)))
		    (when dir
		      (delq nil (mapcar
				 (lambda (p)
				   (when p
				     (equal (file-name-as-directory p) dir)))
				 load-path)))))
	     (setq tags-table-list (list smart-emacs-tags-file)))
	    ((and curr-dirs-or-filename (listp curr-dirs-or-filename))
	     (setq tags-table-list
		   (delq nil (mapcar
			      (lambda (p)
				(when (stringp p)
				  (expand-file-name "TAGS" p)))
			      curr-dirs-or-filename))))))
    ;; Return the appropriate tags file list.
    (cond (tags-table-list
	   ;; GNU Emacs when tags tables are found or provided by the user
	   (nreverse tags-table-list))
	  ((fboundp 'tags-table-check-computed-list)
	   ;; GNU Emacs in other cases
	   (tags-table-check-computed-list)
	   tags-table-computed-list)
	  ((when (boundp 'tags-file-name) tags-file-name)
	   (list tags-file-name))
	  (t (error "(smart-tags-file-list): Needed tags file not found; see `man etags' for how to build one")))))