GNU bug report logs - #68374
min-width is not correctly treated by buffer-text-pixel-size

Previous Next

Package: emacs;

Reported by: JD Smith <jdtsmith <at> gmail.com>

Date: Wed, 10 Jan 2024 22:24:01 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: JD Smith <jdtsmith <at> gmail.com>
Subject: bug#68374: closed (Re: bug#68374: min-width is not correctly
 treated by buffer-text-pixel-size)
Date: Sun, 11 Feb 2024 13:24:01 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#68374: min-width is not correctly treated by buffer-text-pixel-size

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 68374 <at> debbugs.gnu.org.

-- 
68374: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68374
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: JD Smith <jdtsmith <at> gmail.com>
Cc: 68374-done <at> debbugs.gnu.org
Subject: Re: bug#68374: min-width is not correctly treated by
 buffer-text-pixel-size
Date: Sun, 11 Feb 2024 15:22:57 +0200
> From: JD Smith <jdtsmith <at> gmail.com>
> Date: Sun, 11 Feb 2024 07:20:21 -0500
> Cc: 68374 <at> debbugs.gnu.org
> 
> I haven't noticed anything unusual in a couple weeks of use, so please do.  Thanks.

Thanks, installed on master, and closing the bug.

[Message part 3 (message/rfc822, inline)]
From: JD Smith <jdtsmith <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: min-width is not correctly treated by buffer-text-pixel-size
Date: Wed, 10 Jan 2024 17:22:53 -0500
When the ‘display min-width property is used on characters in a buffer, window/buffer-text-pixel-size does not include this min-width padding in its calculation of the text's pixel width.  

This can be seen by using a range of minimum character widths and noticing that the width is identical; see below.  Other ‘display properties like space :width and space :align-to do seem to be correctly handled by pixel size calculations. 

This is relevant because various elements on the mode-line use ‘display min-width, so performing pixel alignment on the mode-line text is impacted.

+++

(eval-when-compile 'cl-lib)
(cl-loop
 for w from 0. to 100. by 20. 
 collect
 (with-current-buffer (get-buffer-create "*pixel-sizes*")
   (erase-buffer)
   (insert ">>>" (propertize " " 'display `(min-width (,w))) "<<<")
   (cons w (buffer-text-pixel-size))))
  
;; ((0 49 . 14) (20 49 . 14) (40 49 . 14) (60 49 . 14) (80 49 . 14) (100 49 . 14))


This bug report was last modified 1 year and 101 days ago.

Previous Next


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