Function: xref-go-forward

xref-go-forward is an autoloaded, interactive and byte-compiled function defined in xref.el.gz.

Signature

(xref-go-forward)

Documentation

Go to the point where a previous M-, (xref-go-back) was invoked.

View in manual

Probably introduced at or before Emacs version 29.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/xref.el.gz
;;;###autoload
(defun xref-go-forward ()
  "Go to the point where a previous \\[xref-go-back] was invoked."
  (interactive)
  (let ((history (xref--get-history)))
    (if (null (cdr history))
        (user-error "At end of xref history")
      (let ((marker (pop (cdr history))))
        (xref--push-backward (point-marker))
        (switch-to-buffer (or (marker-buffer marker)
                              (user-error "The marked buffer has been deleted")))
        (goto-char (marker-position marker))
        (set-marker marker nil nil)
        (run-hooks 'xref-after-return-hook)))))