[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/zach-soc-funcall-from-bytecode 629d179 3/6: Properly align offse
From: |
Rocky Bernstein |
Subject: |
feature/zach-soc-funcall-from-bytecode 629d179 3/6: Properly align offset in backtrace |
Date: |
Fri, 26 Jun 2020 11:54:47 -0400 (EDT) |
branch: feature/zach-soc-funcall-from-bytecode
commit 629d1790ede73d859c503354f2beb1316cf7df8f
Author: Zach Shaftel <zshaftel@gmail.com>
Commit: Zach Shaftel <zshaftel@gmail.com>
Properly align offset in backtrace
* lisp/emacs-lisp/backtrace.el (backtrace--print-flags): Use format
width specifier to line up the flags and offset nicely.
---
lisp/emacs-lisp/backtrace.el | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/lisp/emacs-lisp/backtrace.el b/lisp/emacs-lisp/backtrace.el
index ac6b649..c3f2ff0 100644
--- a/lisp/emacs-lisp/backtrace.el
+++ b/lisp/emacs-lisp/backtrace.el
@@ -257,7 +257,7 @@ frames where the source code location is known.")
map)
"Local keymap for `backtrace-mode' buffers.")
-(defconst backtrace--flags-width 6
+(defconst backtrace--flags-width 7
"Width in characters of the flags for a backtrace frame.")
;;; Navigation and Text Properties
@@ -747,12 +747,13 @@ property for use by navigation."
(let ((beg (point))
(flag (plist-get (backtrace-frame-flags frame) :debug-on-exit))
(source (plist-get (backtrace-frame-flags frame) :source-available))
- (off (plist-get (backtrace-frame-flags frame) :bytecode-offset)))
+ (offset (plist-get (backtrace-frame-flags frame) :bytecode-offset))
+ ;; right justify and pad the offset (or the empty string)
+ (offset-format (format "%%%ds " (- backtrace--flags-width 3))))
(when (plist-get view :show-flags)
- (when source (insert ">"))
- (when flag (insert "*"))
- (when off (insert (number-to-string off))))
- (insert (make-string (- backtrace--flags-width (- (point) beg)) ?\s))
+ (insert (if source ">" " "))
+ (insert (if flag "*" " "))
+ (insert (format offset-format (or offset ""))))
(put-text-property beg (point) 'backtrace-section 'func)))
(defun backtrace--print-func-and-args (frame _view)
- branch feature/zach-soc-funcall-from-bytecode created (now e1aee0f), Rocky Bernstein, 2020/06/26
- feature/zach-soc-funcall-from-bytecode b417cf0 1/6: Merge branch 'master' into feature/soc-bytecode-in-traceback-specbinding, Rocky Bernstein, 2020/06/26
- feature/zach-soc-funcall-from-bytecode f6ec28d 4/6: Store bytecode offset within exec_byte_code, Rocky Bernstein, 2020/06/26
- feature/zach-soc-funcall-from-bytecode 3d5ac37 5/6: Revert "Store bytecode offset within exec_byte_code", Rocky Bernstein, 2020/06/26
- feature/zach-soc-funcall-from-bytecode 629d179 3/6: Properly align offset in backtrace,
Rocky Bernstein <=
- feature/zach-soc-funcall-from-bytecode e1aee0f 6/6: Don't call Ffuncall directly from exec_byte_code, Rocky Bernstein, 2020/06/26
- feature/zach-soc-funcall-from-bytecode 0c45e51 2/6: Merge branch 'master' into feature/soc-bytecode-in-traceback-specbinding, Rocky Bernstein, 2020/06/26