unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Pedro Andres Aranda Gutierrez <paaguti@gmail.com>
Cc: 52447@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	[thread overview]
Message-ID: <83bl1mp549.fsf@gnu.org> (raw)
In-Reply-To: <CAO48Bk-YF9-K9Rr-5S17rN6U2ALPW1YtWzeH0D_0hi8ngRAqBg@mail.gmail.com> (message from Pedro Andres Aranda Gutierrez on Sun, 12 Dec 2021 08:17:28 +0100)

> From: Pedro Andres Aranda Gutierrez <paaguti@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.





  reply	other threads:[~2021-12-12  9:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-12  7:17 bug#52447: 29.0.50; New mode-line breaks calculations for last element in my mode-line Pedro Andres Aranda Gutierrez
2021-12-12  9:03 ` Eli Zaretskii [this message]
2021-12-12 17:58   ` Pedro Andres Aranda Gutierrez
2021-12-12 18:24     ` Eli Zaretskii
2021-12-13  6:06       ` Pedro Andres Aranda Gutierrez
2021-12-13 12:54         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83bl1mp549.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=52447@debbugs.gnu.org \
    --cc=paaguti@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).