emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/buttercup 4b1682ec98 01/16: Use the base argument of backt


From: ELPA Syncer
Subject: [nongnu] elpa/buttercup 4b1682ec98 01/16: Use the base argument of backtrace-frame
Date: Wed, 4 Sep 2024 18:59:22 -0400 (EDT)

branch: elpa/buttercup
commit 4b1682ec98a1c0303736feb4e003848a368293d1
Author: Ola Nilsson <ola.nilsson@gmail.com>
Commit: Ola Nilsson <ola.nilsson@gmail.com>

    Use the base argument of backtrace-frame
    
    Instead of discarding all frames before `buttercup--debugger', use the
    base argument of `backtrace-frame' to start at the frame after
    `buttercup--debugger'.
---
 buttercup.el | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index cf6019d65f..7e562aebf4 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -2116,19 +2116,13 @@ ARGS according to `debugger'."
 
 (defun buttercup--backtrace ()
   "Create a backtrace, a list of frames returned from `backtrace-frame'."
-  ;; Read the backtrace frames from 0 (the closest) upward.
-  (cl-do* ((n 0 (1+ n))
-           (frame (backtrace-frame n) (backtrace-frame n))
-           (frame-list nil)
-           (in-program-stack nil))
+  ;; Read the backtrace frames from `buttercup--debugger' + 1  upward.
+  (cl-do* ((n 1 (1+ n))
+           (frame (backtrace-frame n #'buttercup--debugger)
+                  (backtrace-frame n #'buttercup--debugger))
+           (frame-list nil))
       ((not frame) frame-list)
-      ;; discard frames until (and including) `buttercup--debugger', they
-      ;; only contain buttercup code
-      (when in-program-stack
-        (push frame frame-list))
-      (when (eq (elt frame 1)
-                'buttercup--debugger)
-        (setq in-program-stack t))
+    (push frame frame-list)
       ;; keep frames until one of the known functions are found, after
       ;; this is just the buttercup framework and not interesting for
       ;; users (incorrect for testing buttercup). Some frames before the
@@ -2149,7 +2143,7 @@ ARGS according to `debugger'."
         ;;       The buttercup--mark-stackframe should only be in wrapped 
expressions,
         ;;       optimize by checking if it is a wrapped expression?
         ;;       Will we even need the marker if we can check that?
-        (when (and in-program-stack (tree-find 'buttercup--mark-stackframe 
frame))
+        (when (tree-find 'buttercup--mark-stackframe frame)
           (pop frame-list)
           (cl-return frame-list)))))
 



reply via email to

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