unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Mohsin Kaleem <mohkale@kisara.moe>
Cc: 48257@debbugs.gnu.org
Subject: bug#48257: [kisara.moe] Re: [kisara.moe] Re: bug#48257: [kisara.moe] 28.0.50; Align to right doesn't account for window separator in terminal frames
Date: Tue, 11 May 2021 20:19:49 +0300	[thread overview]
Message-ID: <83tun9428a.fsf@gnu.org> (raw)
In-Reply-To: <877dk55h90.fsf@kisara.moe> (message from Mohsin Kaleem on Tue, 11 May 2021 18:10:03 +0100)

[Please use Reply All to keep the bug address on the CC list.]

> From: Mohsin Kaleem <mohkale@kisara.moe>
> Date: Tue, 11 May 2021 18:10:03 +0100
> 
> So what would be the recommended approach for mode-line developers
> detect that their not on a rightmost window and then add the extra space
> to prevent the mode-line being truncated?

We have the window-at-side-p function; is that what you want?

> Personally I still think this is a bug because the mode-line doesn't
> control whether the window-separator glyph is shown or not.

It is controlled by the current display-table.

> If the
> mode-line intends to right-align some text it should be right-aligned
> without having to consider corner-cases such as the window position.
> Especially seeing as this isn't an issue on GUI frames, only terminal
> frames. I'd suggest adding a right-separator alongside right-fringe and
> right-margin so that mode-line developers don't have to concern
> themselves with this.
> 
> Alternatively it'd be nice if emacs just took care of spacing and
> alignment itself. With so many mode-lines re-implementing the same
> general logic to right align a segment, a built-in construct might be
> more general and avoid the issue of alignment here. It'll also avoid the
> need to evaluate the right-segment twice (first to get it's width and
> then to actually render it).
> 
> For example vim has a status-line construct (I believe %=) which is
> replaced with the appropriate number of spaces to separate two or more
> groups.
> For example with a window width of 12 and a status-line format of
> "foo%=bar", we'd get a rendered status-line of "foo      bar".
> Similarly with a format of "foo%=bar%=baz" we'd get "foo bar baz".

If someone wants to work on providing patches to support any of your
suggestions, I'm sure it will be welcome, at least as an optional
feature.  TIA.





  parent reply	other threads:[~2021-05-11 17:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06 15:16 bug#48257: [kisara.moe] 28.0.50; Align to right doesn't account for window separator in terminal frames mohkale
2021-05-06 15:48 ` Eli Zaretskii
2021-05-06 16:05   ` bug#48257: [kisara.moe] Re: [kisara.moe] " mohkale
2021-05-06 16:43     ` Eli Zaretskii
2021-05-11 16:44 ` Eli Zaretskii
     [not found]   ` <877dk55h90.fsf@kisara.moe>
2021-05-11 17:19     ` Eli Zaretskii [this message]
2021-05-11 17:26       ` bug#48257: [kisara.moe] Re: [kisara.moe] " Eli Zaretskii
2021-05-11 17:40       ` bug#48257: [kisara.moe] Re: [kisara.moe] " Mohsin Kaleem
2021-07-05 21:04 ` bug#48257: " Kevin Boulain
2021-07-06 12:49   ` Eli Zaretskii
2021-07-06 17:13     ` Eli Zaretskii
     [not found]       ` <CABaj1X9fTfYcZ8bcLHvLtmseyQeVspL3-wF2pN6DC_uLgMny4A@mail.gmail.com>
2021-07-08  6:24         ` 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=83tun9428a.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=48257@debbugs.gnu.org \
    --cc=mohkale@kisara.moe \
    /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).