Function: debug-early-backtrace

debug-early-backtrace is a byte-compiled function defined in debug-early.el.gz.

Signature

(debug-early-backtrace &optional BASE)

Documentation

Print a trace of Lisp function calls currently active.

The output stream used is the value of standard-output.

This is a simplified version of the standard backtrace function, intended for use in debugging the early parts of the build process.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/debug-early.el.gz
(defalias 'debug-early-backtrace
  #'(lambda (&optional base)
      "Print a trace of Lisp function calls currently active.
The output stream used is the value of `standard-output'.

This is a simplified version of the standard `backtrace'
function, intended for use in debugging the early parts
of the build process."
      (princ "\n")
      (let ((print-escape-newlines t)
            (print-escape-control-characters t)
            (print-escape-nonascii t)
            (cl--generic-compiler
             (lambda (exp) (eval exp t)))
            (prin1 (if (and (fboundp 'cl-prin1)
                            (fboundp 'cl-defmethod) ;Used by `cl-print'.
                            (condition-case nil
                                (require 'cl-print)
                              (error nil)))
                       #'cl-prin1
                     #'prin1))
            (first t))
        (mapbacktrace
         #'(lambda (evald func args _flags)
            (if first
                ;; The first is the debug-early entry point itself.
                (setq first nil)
               (let ((args args))
                 (if evald
                     (progn
                       (princ "  ")
                       (funcall prin1 func)
                       (princ "("))
                   (progn
                     (princ "  (")
                     (setq args (cons func args))))
                 (if args
                     (while (progn
                              (funcall prin1 (car args))
                              (setq args (cdr args)))
                       (princ " ")))
                 (princ ")\n"))))
	 base))
      (message "debug-early-backtrace...done")))