GNU bug report logs - #52447
29.0.50; New mode-line breaks calculations for last element in my mode-line

Previous Next

Package: emacs;

Reported by: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>

Date: Sun, 12 Dec 2021 07:19:01 UTC

Severity: normal

Found in version 29.0.50

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: Eli Zaretskii <eliz <at> gnu.org>
To: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
Cc: 52447 <at> debbugs.gnu.org
Subject: bug#52447: 29.0.50; New mode-line breaks calculations for last element in my mode-line
Date: Sun, 12 Dec 2021 11:03:18 +0200
> From: Pedro Andres Aranda Gutierrez <paaguti <at> gmail.com>
> Date: Sun, 12 Dec 2021 08:17:28 +0100
> 
> I'm using the attached code for my mode-line. It's inspired by the doom mode-line. My last element is
> right-aligned and shows GIT information when relevant. On emacs < 29, the calculation for the free space
> avoids overlapping with the fringe:
> emacs28-modeline.png
> 
> On emacs29, with fixed font using the fix from etc/NEWS, the fringe overlaps with the vc information. 
> emacs29-broken-modeline.png

Your code says:

  (defun fill-spaces (len)
    `((space :align-to (- (+ right right-fringe right-margin) ,len))))

This tells Emacs to right-align the string to the place _after_ the
margin and the fringe.  If I remove the addition of right-fringe and
right-margin from the :align-to expression, the effect is like you
want.

So it sounds like Emacs 28 and before had some bug in this area which
was fixed in Emacs 29, and your code needs to adapt by removing the
"fix" you had in previous Emacs versions.

> Not to speak variable pitch, where I only see the first 1.5 letters or so (depending on the branch I'm in)

For variable-pitch font, you need to calculate this in pixels, not in
columns.




This bug report was last modified 3 years and 217 days ago.

Previous Next


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