Function: xref-goto-xref

xref-goto-xref is an interactive and byte-compiled function defined in xref.el.gz.

Signature

(xref-goto-xref &optional QUIT)

Documentation

Jump to the xref on the current line and select its window.

If QUIT is non-nil (interactively, with prefix argument), also quit the *xref* buffer.

Probably introduced at or before Emacs version 28.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/xref.el.gz
(defun xref-goto-xref (&optional quit)
  "Jump to the xref on the current line and select its window.
If QUIT is non-nil (interactively, with prefix argument), also
quit the *xref* buffer."
  (interactive "P")
  (let* ((buffer (current-buffer))
         (xref (or (xref--item-at-point)
                   (user-error "Choose a reference to visit")))
         (xref-current-item xref))
    (xref--set-arrow)
    (xref--show-location (xref-item-location xref) (if quit 'quit t))
    (if (fboundp 'next-error-found)
        (next-error-found buffer (current-buffer))
      ;; Emacs < 27
      (setq next-error-last-buffer buffer))))