Function: treemacs--imenu-tag-noselect

treemacs--imenu-tag-noselect is a byte-compiled function defined in treemacs-mouse-interface.el.

Signature

(treemacs--imenu-tag-noselect FILE TAG-PATH)

Documentation

Return a list of the source buffer for FILE and the tag's from TAG-PATH.

Source Code

;; Defined in ~/.emacs.d/elpa/treemacs-20251226.1307/treemacs-mouse-interface.el
(defun treemacs--imenu-tag-noselect (file tag-path)
  "Return a list of the source buffer for FILE and the tag's from TAG-PATH."
  (let ((tag (-last-item tag-path))
        (path (-butlast tag-path)))
    (condition-case e
        (progn
          (find-file-noselect file)
          (let ((index (treemacs--get-imenu-index file)))
            (dolist (path-item path)
              (setq index (cdr (assoc path-item index))))
            (-let [(buf . pos)
                   (treemacs--extract-position (cdr (--first (equal (car it) tag) index)) path)]
              ;; some imenu implementations, like markdown, will only provide
              ;; a raw buffer position (an int) to move to
	      (list (or buf (get-file-buffer file)) pos))))
      (error
       (treemacs-log-err "Something went wrong when finding tag '%s': %s"
                      (propertize tag 'face 'treemacs-tags-face)
                      e)))))