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 #44 received at 62606 <at> debbugs.gnu.org (full text, mbox):

From: hugo <at> heagren.com
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 62606 <at> debbugs.gnu.org
Subject: Re: bug#62606: [PATCH] function to align mode-line elements to right
Date: Mon, 19 Jun 2023 20:06:58 +0100
[Message part 1 (text/plain, inline)]
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
[0001-Support-right-align-in-mode-line.patch (text/x-diff, attachment)]

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.