[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)))))
- [nongnu] elpa/buttercup 45d53515da 02/16: Stop adding frames to backtrace once a buttercup wrap func is found, (continued)
- [nongnu] elpa/buttercup 45d53515da 02/16: Stop adding frames to backtrace once a buttercup wrap func is found, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 0444816a60 07/16: tests: Refactor test that no backtraces are collected for skipped specs, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup ee000fabd1 04/16: tests: Cleanup and comments, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 0552fe4d5b 12/16: Add :to-be-close-to docstring, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup c8f34ae3ed 05/16: Limit backtraces for spec exceptions outside expect, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup add32f8cbf 08/16: Collect stacktraces for errors in matchers, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup be72aa872c 06/16: tests: Verify that backtraces are not collected for passed specs, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 8408579758 16/16: Rewrite buttercup-expect with pcase, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 925af155be 15/16: tests: Add backtrace tests for function matchers, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup df7f98e110 03/16: Do not collect backtraces for failed specs, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 4b1682ec98 01/16: Use the base argument of backtrace-frame,
ELPA Syncer <=
- [nongnu] elpa/buttercup a1d0d73999 11/16: Improve docstring of buttercup-define-matcher, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 789570cf7d 10/16: Merge pull request #249 from snogge/fix-247, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup f577efc524 09/16: Remove remaining uses of `buttercup--mark-stackframe', ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 9bb00a269d 13/16: Improve the docstring of the expect macro, ELPA Syncer, 2024/09/04
- [nongnu] elpa/buttercup 19e1a86626 14/16: Clarify that buttercup--wrap-expr is only meant for expect, ELPA Syncer, 2024/09/04