[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/zach-soc-bytecode-in-traceback 077acd3 2/3: Only print offset fo
From: |
Rocky Bernstein |
Subject: |
feature/zach-soc-bytecode-in-traceback 077acd3 2/3: Only print offset for byte-compiled functions |
Date: |
Fri, 26 Jun 2020 11:40:19 -0400 (EDT) |
branch: feature/zach-soc-bytecode-in-traceback
commit 077acd3a5f9cc49d034c11e048181d12791aa3a7
Author: Zach Shaftel <zshaftel@gmail.com>
Commit: Zach Shaftel <zshaftel@gmail.com>
Only print offset for byte-compiled functions
---
lisp/emacs-lisp/debug.el | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el
index db2943b..1de13ed 100644
--- a/lisp/emacs-lisp/debug.el
+++ b/lisp/emacs-lisp/debug.el
@@ -337,7 +337,11 @@ That buffer should be current already and in
debugger-mode."
(setq backtrace-view (plist-put backtrace-view :show-flags t)
backtrace-insert-header-function
(lambda ()
- (insert (format "Byte-code offset of error: %d\n" (car (last args))))
+ (let ((final (car (last args)))
+ (fun (backtrace-frame-fun (car backtrace-frames))))
+ (and (byte-code-function-p (ignore-errors (indirect-function fun)))
+ (integerp final)
+ (insert (format "Byte-code offset of error: %d\n" final))))
(debugger--insert-header args))
backtrace-print-function debugger-print-function)
(backtrace-print)