[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#53498: [PATCH] Fix tabulated-list-widen-current-column not working f
From: |
Thuna |
Subject: |
bug#53498: [PATCH] Fix tabulated-list-widen-current-column not working for non-strings |
Date: |
Mon, 24 Jan 2022 13:55:26 +0300 |
Previously tabulted-list-widen-current-column failed to work when point
was at or ahead of a button or an image. It now checks for image width
and button width. Button width calculation doesn't account for the
properties of the button, however, so that is left there as a FIXME.
>From c5d6b80867f7f02b8ecbc5ed7dc8009c570831ac Mon Sep 17 00:00:00 2001
From: Thuna <thuna.cing@gmail.com>
Date: Mon, 24 Jan 2022 12:40:13 +0300
Subject: [PATCH] Fix tabulated-list-widen-current-column not working for
non-strings
* tabulated-list.el (tabulated-list-widen-current-column): Consider
buttons and images when calculating the width of the contents of a
cell.
---
lisp/emacs-lisp/tabulated-list.el | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/lisp/emacs-lisp/tabulated-list.el
b/lisp/emacs-lisp/tabulated-list.el
index 7ad4f7f863..2ace7ebb35 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -734,7 +734,16 @@ tabulated-list-widen-current-column
(max (setq col-width
(cadr (aref tabulated-list-format
col-nb)))
- (string-width (aref entry col-nb)))
+ (let ((desc (aref entry col-nb)))
+ (cond
+ ((stringp desc)
+ (string-width desc))
+ ((eq (car desc) 'image)
+ (car (image-size desc)))
+ (t (string-width (car desc))
+ ;; FIXME: Take into consideration the
properties
+ ;; of the button when calculating
width
+ ))))
(or (plist-get (nthcdr 3 (aref tabulated-list-format
col-nb))
:pad-right)
--
2.25.1
- bug#53498: [PATCH] Fix tabulated-list-widen-current-column not working for non-strings,
Thuna <=