GNU bug report logs - #53520
[PATCH] tabulated-list gradually truncate image

Previous Next

Package: emacs;

Reported by: Thuna <thuna.cing <at> gmail.com>

Date: Tue, 25 Jan 2022 09:09:02 UTC

Severity: normal

Tags: patch, wontfix

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Thuna <thuna.cing <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] tabulated-list gradually truncate image
Date: Tue, 25 Jan 2022 12:08:18 +0300
[Message part 1 (text/plain, inline)]
Previously images were displayed as is which would potentially cause
misalignment if the column width were less than the image width.  Image
is now cropped width-wise to fit the column width.  This patch, however,
does not affect the height of the image.

[0001-tabulated-list-gradually-collapse-images.patch (text/x-diff, inline)]
diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el
index 2ace7ebb35..b964dd56e9 100644
--- a/lisp/emacs-lisp/tabulated-list.el
+++ b/lisp/emacs-lisp/tabulated-list.el
@@ -577,7 +577,11 @@ tabulated-list-print-col
                      (propertize label 'help-echo help-echo))))
           ((eq (car col-desc) 'image)
            (insert (propertize " "
-                               'display col-desc
+                               'display `(,col-desc
+                                          (slice 0.0 0.0
+                                                 ,(* (frame-char-width)
+                                                     available-space)
+                                                 1.0))
                                'help-echo help-echo)))
           ((apply 'insert-text-button label (cdr col-desc))))
     (let ((next-x (+ x pad-right width)))

This bug report was last modified 2 years and 255 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.