bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#62606: [PATCH] function to align mode-line elements to right


From: hugo
Subject: bug#62606: [PATCH] function to align mode-line elements to right
Date: Mon, 19 Jun 2023 20:06:58 +0100
User-agent: Roundcube Webmail/1.6.0

On 2023-06-09 17:03, Stefan Monnier wrote:
Also, the code is fairly simple and self-contained, so I don't see
a good reason not to include that.

Thanks :)

I think symbols like `right-fringe` should be enclosed in `...'
in docstrings.

Fixed in new patch, attached.

Also, I see no reason to encourage the use of an alias,
so I'd drop either `right-margin` or `right` from the doc (especially
since it doesn't really come for free in the code).

Fixed. Dropped `right', as it was the less descriptive version.

As a user I'd wonder if "align to right-fringe" means to align to
the beginning (i.e. left side) or end (i.e. right side) of the
right fringe.

Documented (and included a link to relevant info node).

AFAICT, this function is internal to the implementation of the
`mode-line-format-right-align` mode-line spec.  So maybe it should use
"--" in its name.

You're right -- Done.

This is the ugly part of the implementation

Yes, I agree :(

an alternative is to use

    (..LEFT.. (:eval (mode-line-format-right-align ..RIGHT..)))

I share your technical worries about this. I worry too that this might end
up being more confusing for users, because it invites such constructions
as:

(..LEFT.. (:eval (mode-line-format-right-align ..RIGHT..)) ..WHAT..)

Where the behaviour of ..WHAT.. is at best to be completely hidden, and
at worst undefined. If we use a single symbol, this can't happen.

I also think that, as a user, it's good to have consistent interfaces
for this sort of thing, and my proposed function is intended to work
just like `tab-bar-format-align-right', which is included as a symbol,
not a more complex construction.

should also be usable in `header-line-format` and friends.

This would good though.

Hugo

Attachment: 0001-Support-right-align-in-mode-line.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]