all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: hugo@heagren.com
Cc: 62606@debbugs.gnu.org
Subject: bug#62606: [PATCH] function to align mode-line elements to right
Date: Tue, 06 Jun 2023 14:24:11 +0300	[thread overview]
Message-ID: <83zg5c3kbo.fsf@gnu.org> (raw)
In-Reply-To: <4b872ecc12e3995d5b7dfffa580e297d@heagren.com> (hugo@heagren.com)

> Date: Mon, 05 Jun 2023 21:45:17 +0100
> From: hugo@heagren.com
> Cc: 62606@debbugs.gnu.org
> 
> On 2023-05-06 15:39, Eli Zaretskii wrote:
> > > > 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.
> 
> I confess I am very confused. Let's say we have a modeline like this,
> with parts L (left-aligned), M (middle - displays as empty space) and R
> (right-aligned):
> 
> |--L--|-------M-------|-R-|
> Foo bar                 X
> 
> If L gets longer then:
> - M will get shorter
> - R will stay the same
> 
> So we get:
> |--L-----|----M-------|-R-|
> Foo barrrr              X
> 
> Is this what you're worried about? If so, I don't think it's much of a
> cause for concern.

No, I was talking about the case where the R part becomes longer.

> I modelled my function on
> `tab-bar-format-align-right', which works in a very similar way.

IMNSHO, that mopdel is not the ideal one.

> It also
> strikes me that something like this happens anyway already: if we have a
> mode-line with just a left-aligned lighter, and the lighter gets longer 
> (or
> shorter), then the space between the end of the lighter and the edge of
> the screen (i.e. M+R) gets smaller (or bigger). Isn't this to be 
> expected?

Yes.  But with left alignment the beginning of the text never moves,
only the end.  With right alignment, the beginning moves.  It's
jarring, IMO.





  reply	other threads:[~2023-06-06 11:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-01 22:27 bug#62606: [PATCH] function to align mode-line elements to right hugo
2023-04-02  5:47 ` Eli Zaretskii
2023-05-06 14:14   ` hugo
2023-05-06 14:39     ` Eli Zaretskii
2023-06-05 20:45       ` hugo
2023-06-06 11:24         ` Eli Zaretskii [this message]
2023-06-09 12:47           ` hugo
2023-06-09 13:13             ` Eli Zaretskii
     [not found]               ` <f60acc21a937b413f6528264f233ebfe@heagren.com>
2023-06-09 14:52                 ` Eli Zaretskii
2023-04-02 16:19 ` Juri Linkov
2023-06-09 16:03 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-09 16:17   ` Eli Zaretskii
2023-06-09 16:52     ` bug#62606: R2L modelines (was: bug#62606: [PATCH] function to align mode-line elements to right) Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-19 19:06   ` bug#62606: [PATCH] function to align mode-line elements to right hugo
2023-06-24 12:05     ` Eli Zaretskii
2023-06-26 10:06       ` hugo
2023-06-26 11:55         ` Eli Zaretskii
2023-07-02 12:43           ` hugo
2023-07-06  7:35             ` Eli Zaretskii
     [not found] ` <handler.62606.D62606.168862894016990.notifdone@debbugs.gnu.org>
2023-07-14 16:37   ` Juri Linkov
2023-07-17 17:56     ` Juri Linkov
     [not found]       ` <CALDnm53v4O9cYcYwcqGpYVb4xVOw6t+FM1xX21k7HFxWyuiSaQ@mail.gmail.com>
     [not found]         ` <83fryrs1l8.fsf@gnu.org>
     [not found]           ` <87edebjcku.fsf@gmail.com>
     [not found]             ` <835xznro5i.fsf@gnu.org>
2024-01-21 10:20               ` João Távora
2024-01-21 10:27                 ` Eli Zaretskii
2024-01-21 10:39                   ` João Távora

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

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

  git send-email \
    --in-reply-to=83zg5c3kbo.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=62606@debbugs.gnu.org \
    --cc=hugo@heagren.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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.