Avoid recursive error in debug-early in batch mode

* lisp/emacs-lisp/debug-early.el (cl--generic-compiler): Defvar it.
(debug-early-backtrace): Bind it so as to avoid loading
byte-compiler; see the value of the variable in cl-generic.el.
Do not merge to master.  (Bug#80916)
This commit is contained in:
Eli Zaretskii 2026-06-07 13:31:45 +03:00
parent df2508a8f6
commit f653fd9f10

View file

@ -38,6 +38,8 @@
(defvar debugger--last-error nil) (defvar debugger--last-error nil)
(defvar cl--generic-compiler)
(defalias 'debug-early-backtrace (defalias 'debug-early-backtrace
#'(lambda (&optional base) #'(lambda (&optional base)
"Print a trace of Lisp function calls currently active. "Print a trace of Lisp function calls currently active.
@ -50,6 +52,8 @@ of the build process."
(let ((print-escape-newlines t) (let ((print-escape-newlines t)
(print-escape-control-characters t) (print-escape-control-characters t)
(print-escape-nonascii t) (print-escape-nonascii t)
(cl--generic-compiler
(lambda (exp) (eval exp t)))
(prin1 (if (and (fboundp 'cl-prin1) (prin1 (if (and (fboundp 'cl-prin1)
(fboundp 'cl-defmethod) ;Used by `cl-print'. (fboundp 'cl-defmethod) ;Used by `cl-print'.
(condition-case nil (condition-case nil