summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/backtrace.el
diff options
context:
space:
mode:
authorGemini Lasswell <gazally@runbox.com>2018-07-18 08:30:45 -0700
committerGemini Lasswell <gazally@runbox.com>2018-08-03 08:54:08 -0700
commit83af893fc0e7cc87c0fb0626fb48ef96e00b3f8b (patch)
treea20e2e5731a619f1268519deb2392d39f5bcfe87 /lisp/emacs-lisp/backtrace.el
parentca98377280005344fb07c816997b9bc2a737056a (diff)
downloademacs-83af893fc0e7cc87c0fb0626fb48ef96e00b3f8b.tar.gz
emacs-83af893fc0e7cc87c0fb0626fb48ef96e00b3f8b.tar.bz2
emacs-83af893fc0e7cc87c0fb0626fb48ef96e00b3f8b.zip
Move 'backtrace' from subr.el to backtrace.el
* lisp/subr.el (backtrace, backtrace--print-frame): Remove functions. * lisp/emacs-lisp/backtrace.el (backtrace-backtrace): Remove function. (backtrace): New function. (backtrace-to-string): Make argument optional. * doc/lispref/debugging.texi (Internals of Debugger): Update description of 'backtrace' function.
Diffstat (limited to 'lisp/emacs-lisp/backtrace.el')
-rw-r--r--lisp/emacs-lisp/backtrace.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el
index 5169c305035..d162983c017 100644
--- a/lisp/emacs-lisp/backtrace.el
+++ b/lisp/emacs-lisp/backtrace.el
@@ -891,14 +891,18 @@ followed by `backtrace-print-frame', once for each stack frame."
;;; Backtrace printing
-(defun backtrace-backtrace ()
+;;;###autoload
+(defun backtrace ()
"Print a trace of Lisp function calls currently active.
Output stream used is value of `standard-output'."
- (princ (backtrace-to-string (backtrace-get-frames 'backtrace-backtrace))))
+ (princ (backtrace-to-string (backtrace-get-frames 'backtrace)))
+ nil)
-(defun backtrace-to-string(frames)
+(defun backtrace-to-string(&optional frames)
"Format FRAMES, a list of `backtrace-frame' objects, for output.
-Return the result as a string."
+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)))
(let ((backtrace-fontify nil))
(with-temp-buffer
(backtrace-mode)