emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 223de5f 3/6: Merge from origin/emacs-27


From: Glenn Morris
Subject: master 223de5f 3/6: Merge from origin/emacs-27
Date: Fri, 2 Oct 2020 12:38:35 -0400 (EDT)

branch: master
commit 223de5f2f56ed31dc6a7a5380d8a901c3baa6926
Merge: 81ea24f 41dcbec
Author: Glenn Morris <rgm@gnu.org>
Commit: Glenn Morris <rgm@gnu.org>

    Merge from origin/emacs-27
    
    41dcbeccf3 Make aliases introduced in previous patch obsolete
    4997032c05 Restore some public debugging functions removed in Emacs 27
---
 lisp/emacs-lisp/backtrace.el | 11 +++++++----
 lisp/emacs-lisp/debug.el     | 17 +++++++++++++++++
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el
index 37dad8d..5874ba7 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)
 
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index 1bdb2a3..0e4135b 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -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,9 @@ 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))))))))
 
+(define-obsolete-function-alias 'debugger-toggle-locals
+  'backtrace-toggle-locals "28.1")
+
 
 (defvar debugger-mode-map
   (let ((map (make-keymap)))
@@ -621,6 +635,9 @@ Complete list of commands:
             (buffer-substring (line-beginning-position 0)
                               (line-end-position 0)))))
 
+(define-obsolete-function-alias 'debug-help-follow
+  'backtrace-help-follow-symbol "28.1")
+
 
 ;; When you change this, you may also need to change the number of
 ;; frames that the debugger skips.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]