Function: tagref-list-goto-tag

tagref-list-goto-tag is an interactive and natively compiled function defined in tagref.el.

Signature

(tagref-list-goto-tag)

Documentation

Go to the tag at point.

Key Bindings

tagref-list-mode-map RET

Source Code

;; Defined in /nix/store/mnch55hf9yszlb4dvfqhbqf0840v41qh-emacs-packages-deps/share/emacs/site-lisp/tagref.el
(defun tagref-list-goto-tag ()
  "Go to the tag at point."
  (interactive)
  (when-let* ((entry (tabulated-list-get-entry))
              (name (aref entry 0))
              (info (assoc name tagref-list--tags))
              (file (cadr info))
              (line (cddr info))
              (root (tagref--project-root))
              (full-path (expand-file-name file root)))
    (find-file full-path)
    (goto-char (point-min))
    (forward-line (1- line))
    ;; Try to position at the tag itself
    (when (re-search-forward (format "\\[tag:%s\\]" (regexp-quote name))
                             (line-end-position) t)
      (goto-char (match-beginning 0)))))