GNU bug report logs - #62606
[PATCH] function to align mode-line elements to right

Previous Next

Package: emacs;

Reported by: hugo <at> heagren.com

Date: Sun, 2 Apr 2023 04:48:03 UTC

Severity: normal

Tags: patch

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

Bug is archived. No further changes may be made.

Full log


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

From: Eli Zaretskii <eliz <at> gnu.org>
To: hugo <at> heagren.com
Cc: 62606 <at> debbugs.gnu.org
Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right
Date: Sat, 06 May 2023 17:39:59 +0300
> Date: Sat, 06 May 2023 15:14:24 +0100
> From: hugo <at> heagren.com
> Cc: 62606 <at> debbugs.gnu.org
> 
> > One possible issue with right alignment is that when the total size of
> > the mode-line text changes (e.g., the mode lighter changes), the
> > leftmost part of it will move horizontally, something that could be
> > unpleasant and even annoying.
> 
> This doesn't happen with my proposed setup (though I agree it would be
> annoying if it did!). The user includes the symbol
> `mode-line-format-right-align' in their mode line format. This is a
> variable which holds a mode-line construct `(:eval
> (mode-line-format-right-align))'. So whenever the mode-line is reloaded
> (and therefore, whenever the length could change), the space used to pad
> the right-aligned part to the right is recalculated.

That recalculation is what I alluded to: the space will be different
depending on the size of the mode-line text.

> > Also, what happens if the mode-line text is longer than the window
> > width.  What are user expectations in that case, and does :align-to
> > meet those expectations?
> 
> Then the text overflows to the right.

I'm not sure everyone will agree with your expectations.

> > This should use display-graphic-p, not window-system.
> 
> Fixed.
> 
> > Did you test this in a session which has both GUI and TTY frames?
> 
> Yes, it behaves correctly (i.e. right-aligns in both, even when the
> same buffer is simultaneously displayed in both).

And if then you delete all the GUI frames and only the TTY frames
remain?




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

Previous Next


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