Function: backtrace-frame

backtrace-frame is a byte-compiled function defined in subr.el.gz.

Signature

(backtrace-frame NFRAMES &optional BASE)

Documentation

Return the function and arguments NFRAMES up from current execution point.

If non-nil, BASE should be a function, and NFRAMES counts from its nearest activation frame. If the frame has not evaluated the arguments yet (or is a special form), the value is (nil FUNCTION ARG-FORMS...). If the frame has evaluated its arguments and called its function already, the value is (t FUNCTION ARG-VALUES...). A &rest arg is represented as the tail of the list ARG-VALUES. FUNCTION is whatever was supplied as car of evaluated list, or a lambda expression for macro calls. If NFRAMES is more than the number of frames, the value is nil.

View in manual

Source Code

;; Defined in /usr/src/emacs/lisp/subr.el.gz
(defun backtrace-frame (nframes &optional base)
  "Return the function and arguments NFRAMES up from current execution point.
If non-nil, BASE should be a function, and NFRAMES counts from its
nearest activation frame.
If the frame has not evaluated the arguments yet (or is a special form),
the value is (nil FUNCTION ARG-FORMS...).
If the frame has evaluated its arguments and called its function already,
the value is (t FUNCTION ARG-VALUES...).
A &rest arg is represented as the tail of the list ARG-VALUES.
FUNCTION is whatever was supplied as car of evaluated list,
or a lambda expression for macro calls.
If NFRAMES is more than the number of frames, the value is nil."
  (backtrace-frame--internal
   (lambda (evald func args _) `(,evald ,func ,@args))
   nframes (or base 'backtrace-frame)))