[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 044e11641b: Fix string padding in gdb-mi
From: |
Lars Ingebrigtsen |
Subject: |
master 044e11641b: Fix string padding in gdb-mi |
Date: |
Wed, 24 Aug 2022 07:55:34 -0400 (EDT) |
branch: master
commit 044e11641bc0bfaf0d735bd57f04333f9616cfc7
Author: Santiago Calandrino <san@disroot.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Fix string padding in gdb-mi
* lisp/progmodes/gdb-mi.el (gdb-table): Fix string padding in
gdb-mi (bug#57362).
(gdb-pad-string): Unobsolete.
(gdb-table-string): Re-fix string padding.
Copyright-paperwork-exempt: yes
---
lisp/progmodes/gdb-mi.el | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index c256198b3c..bab80719db 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -2943,8 +2943,7 @@ Return position where LINE begins."
start-posn)))
(defun gdb-pad-string (string padding)
- (declare (obsolete string-pad "29.1"))
- (string-pad string padding nil t))
+ (string-pad string (abs padding) nil (natnump padding)))
;; gdb-table struct is a way to programmatically construct simple
;; tables. It help to reliably align columns of data in GDB buffers
@@ -2962,8 +2961,7 @@ When non-nil, PROPERTIES will be added to the whole row
when
calling `gdb-table-string'."
(let ((rows (gdb-table-rows table))
(row-properties (gdb-table-row-properties table))
- (column-sizes (gdb-table-column-sizes table))
- (right-align (gdb-table-right-align table)))
+ (column-sizes (gdb-table-column-sizes table)))
(when (not column-sizes)
(setf (gdb-table-column-sizes table)
(make-list (length row) 0)))
@@ -2973,9 +2971,7 @@ calling `gdb-table-string'."
(append row-properties (list properties)))
(setf (gdb-table-column-sizes table)
(cl-mapcar (lambda (x s)
- (let ((new-x
- (max (abs x) (string-width (or s "")))))
- (if right-align new-x (- new-x))))
+ (max (abs x) (string-width (or s ""))))
(gdb-table-column-sizes table)
row))
;; Avoid trailing whitespace at eol
@@ -2991,7 +2987,10 @@ calling `gdb-table-string'."
(lambda (row properties)
(apply #'propertize
(mapconcat #'identity
- (cl-mapcar (lambda (s x) (string-pad s x nil t))
+ (cl-mapcar (lambda (s x)
+ (string-pad
+ s x nil
+ (not (gdb-table-right-align table))))
row column-sizes)
sep)
properties))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 044e11641b: Fix string padding in gdb-mi,
Lars Ingebrigtsen <=