diff options
author | Andrea Corallo <akrl@sdf.org> | 2020-10-04 19:45:05 +0200 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2020-10-04 19:45:05 +0200 |
commit | 44ef24342fd8a2ac876212124ebf38673acda35a (patch) | |
tree | 793dc4ba4197559b4bc65339d713c0807a7b2ca9 /lisp/emacs-lisp/backtrace.el | |
parent | afb765ab3cab7b6582d0def543b23603cd076445 (diff) | |
parent | d8665e6d3473403c90a0831e83439a013d0012d3 (diff) | |
download | emacs-44ef24342fd8a2ac876212124ebf38673acda35a.tar.gz emacs-44ef24342fd8a2ac876212124ebf38673acda35a.tar.bz2 emacs-44ef24342fd8a2ac876212124ebf38673acda35a.zip |
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'lisp/emacs-lisp/backtrace.el')
-rw-r--r-- | lisp/emacs-lisp/backtrace.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el index 37dad8db162..5874ba72fcd 100644 --- a/lisp/emacs-lisp/backtrace.el +++ b/lisp/emacs-lisp/backtrace.el @@ -922,11 +922,15 @@ Output stream used is value of `standard-output'." (princ (backtrace-to-string (backtrace-get-frames 'backtrace))) nil) -(defun backtrace-to-string(&optional frames) +(defun backtrace-to-string (&optional frames) "Format FRAMES, a list of `backtrace-frame' objects, for output. Return the result as a string. If FRAMES is nil, use all function calls currently active." - (unless frames (setq frames (backtrace-get-frames 'backtrace-to-string))) + (substring-no-properties + (backtrace--to-string + (or frames (backtrace-get-frames 'backtrace-to-string))))) + +(defun backtrace--to-string (frames) (let ((backtrace-fontify nil)) (with-temp-buffer (backtrace-mode) @@ -934,8 +938,7 @@ function calls currently active." backtrace-frames frames backtrace-print-function #'cl-prin1) (backtrace-print) - (substring-no-properties (filter-buffer-substring (point-min) - (point-max)))))) + (filter-buffer-substring (point-min) (point-max))))) (provide 'backtrace) |