From: Zach Shaftel Date: Wed, 29 Apr 2020 17:54:29 +0000 (-0400) Subject: Only print offset for byte-compiled functions X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=077acd3a5f9cc49d034c11e048181d12791aa3a7;p=emacs.git Only print offset for byte-compiled functions --- diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index db2943b6e73..1de13ed4c53 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)