Skip to content

Commit

Permalink
backtrace--print-frame was deleted in emacs 27+, use alternate. (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
lastquestion committed Jul 10, 2020
1 parent 3d33cd3 commit ef0ce46
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
15 changes: 11 additions & 4 deletions explain-pause-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -2407,10 +2407,17 @@ is now _disabled_ so you can continue to hopefully use Emacs. Info follows:\n\n"
(princ arg)
(princ "\n"))
(princ "\nBacktrace:\n")
(mapbacktrace
(lambda (&rest args)
(apply 'backtrace--print-frame args))
#'explain-pause-report-measuring-bug)))
;; emacs 27+, emacs commit 83af893fc0e7cc87c0fb0626fb48ef96e00b3f8b
(if (fboundp 'backtrace--print-frame)
(mapbacktrace
(lambda (&rest args)
(apply 'backtrace--print-frame args))
#'explain-pause-report-measuring-bug)
(require 'backtrace)
(declare-function backtrace-to-string "backtrace")
(declare-function backtrace-get-frames "backtrace")
(princ (backtrace-to-string (backtrace-get-frames
#'explain-pause-report-measuring-bug))))))

(defvar explain-pause--current-command-record nil
"The current command records representing what we are currently
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test-report-bug.el
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"prints the additional args"
(expect
(string-match
"some-record\n(.*)explain-pause-command-record(.*)\nsome-string\na happy string"
"some-record\n.*explain-pause-command-record.*\nsome-string\na happy string"
the-body)
:not :to-be nil)))

Expand Down

0 comments on commit ef0ce46

Please sign in to comment.