1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-09 07:40:39 -08:00

Restore some public debugging functions removed in Emacs 27

* lisp/emacs-lisp/backtrace.el (backtrace--to-string): New function.
(backtrace-to-string): Use it.  Fix whitespace (bug#40728).
* lisp/emacs-lisp/debug.el (debugger-insert-backtrace): New function.
Mark it as obsolete.
(debugger-toggle-locals, debug-help-follow): New aliases.
This commit is contained in:
Gemini Lasswell 2020-10-01 19:59:58 +02:00 committed by Lars Ingebrigtsen
parent 08bda922b4
commit 4997032c05
2 changed files with 22 additions and 4 deletions

View file

@ -320,6 +320,17 @@ the debugger will not be entered."
(message "Error in debug printer: %S" err)
(prin1 obj stream))))
(make-obsolete 'debugger-insert-backtrace
"use a `backtrace-mode' buffer or `backtrace-to-string'."
"Emacs 27.1")
(defun debugger-insert-backtrace (frames do-xrefs)
"Format and insert the backtrace FRAMES at point.
Make functions into cross-reference buttons if DO-XREFS is non-nil."
(insert (if do-xrefs
(backtrace--to-string frames)
(backtrace-to-string frames))))
(defun debugger-setup-buffer (args)
"Initialize the `*Backtrace*' buffer for entry to the debugger.
That buffer should be current already and in debugger-mode."
@ -527,6 +538,8 @@ The environment used is the one when entering the activation frame at point."
(let ((str (eval-expression-print-format val)))
(if str (princ str t))))))))
(defalias 'debugger-toggle-locals 'backtrace-toggle-locals)
(defvar debugger-mode-map
(let ((map (make-keymap)))
@ -621,6 +634,8 @@ Complete list of commands:
(buffer-substring (line-beginning-position 0)
(line-end-position 0)))))
(defalias 'debug-help-follow 'backtrace-help-follow-symbol)
;; When you change this, you may also need to change the number of
;; frames that the debugger skips.