Function: backtrace-goto-source

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

Signature

(backtrace-goto-source)

Documentation

If its location is known, jump to the source code for the frame at point.

Probably introduced at or before Emacs version 27.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/backtrace.el.gz
(defun backtrace-goto-source ()
  "If its location is known, jump to the source code for the frame at point."
  (interactive)
  (let* ((index (or (backtrace-get-index) (user-error "Not in a stack frame")))
         (frame (nth index backtrace-frames))
         (source-available (plist-get (backtrace-frame-flags frame)
                                      :source-available)))
    (unless (and source-available
                 (run-hook-with-args-until-success
                  'backtrace-goto-source-functions))
      (user-error "Source code location not known"))))