From 92ca51cc5e9d30818f5abf60a5a13f08f2ea7e96 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 12 Dec 2017 22:40:27 -0500 Subject: [PATCH] * lisp/subr.el (backtrace--print-frame): Use cl-prin1 * lisp/emacs-lisp/cl-print.el (cl-prin1): Catch errors, since callers generally don't expect errors. --- lisp/emacs-lisp/cl-print.el | 13 +++++++------ lisp/subr.el | 6 +++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lisp/emacs-lisp/cl-print.el b/lisp/emacs-lisp/cl-print.el index 4fc178c29aa..5a26ecf05fe 100644 --- a/lisp/emacs-lisp/cl-print.el +++ b/lisp/emacs-lisp/cl-print.el @@ -269,12 +269,13 @@ Output is further controlled by the variables `cl-print-readably', `cl-print-compiled', along with output variables for the standard printing functions. See Info node `(elisp)Output Variables'." - (cond - (cl-print-readably (prin1 object stream)) - ((not print-circle) (cl-print-object object stream)) - (t - (let ((cl-print--number-table (cl-print--preprocess object))) - (cl-print-object object stream))))) + (if cl-print-readably + (prin1 object stream) + (with-demoted-errors "cl-prin1: %S" + (if (not print-circle) + (cl-print-object object stream) + (let ((cl-print--number-table (cl-print--preprocess object))) + (cl-print-object object stream)))))) ;;;###autoload (defun cl-prin1-to-string (object) diff --git a/lisp/subr.el b/lisp/subr.el index d6dceb79fa1..eca8dfdb857 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -4536,10 +4536,10 @@ EVALD, FUNC, ARGS, FLAGS are as in `mapbacktrace'." (princ (if (plist-get flags :debug-on-exit) "* " " ")) (cond ((and evald (not debugger-stack-frame-as-list)) - (prin1 func) - (if args (prin1 args) (princ "()"))) + (cl-prin1 func) + (if args (cl-prin1 args) (princ "()"))) (t - (prin1 (cons func args)))) + (cl-prin1 (cons func args)))) (princ "\n")) (defun backtrace () -- 2.11.4.GIT