unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Mohsin Kaleem <mohkale@kisara.moe>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 48257@debbugs.gnu.org
Subject: bug#48257: [kisara.moe] Re: [kisara.moe] Re: [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 18:40:19 +0100	[thread overview]
Message-ID: <87y2cl41a4.fsf@kisara.moe> (raw)
In-Reply-To: <83tun9428a.fsf@gnu.org>

Eli Zaretskii <eliz@gnu.org> writes:

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

Oooh, sorry, I recently started managing email from within emacs (good
excuse to report to the developer mailing list) and I'm still kind of
rusty with all the stuff I used to rely on a dedicated program for.

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

Oh, yep, that should work. Not the nicest solution because you're
mode-line will be inconsistent if you open the same window in both a
terminal and then a GUI frame but for most use-cases it should be fine.

I believe I tried this back when I first raised the issue with
doom-modeline and ran into some performance issues but it seems to be
working fine now (might've been some other problem in this case).

```lisp
(defun +mode-line-align (left right)
  "Return a string of `window-width' length containing LEFT and RIGHT, aligned respectively."
  (list left
        (propertize " "
                    'display `((space
                                :align-to
                                (- (+ right right-fringe right-margin)
                                   ,(if (and (not (display-graphic-p))
                                             (window-at-side-p nil 'right))
                                        0
                                      1)
                                   ;; WARN: Requires double evaluation of RHS forms for spacing.
                                   ,(string-width (format-mode-line (cons "" right)))))))
        right))

(setq-default mode-line-format `((:eval (+mode-line-align '("foo") '("bar")))))
(setq mode-line-format (default-value 'mode-line-format))
```

Thank you for the suggestion. :-)

>
> It is controlled by the current display-table.
>
>
> 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.

Nice. I'm not experienced enough to delve into this yet, but I will when I
get a chance.

Thank you for your time and patience :-).

Yours sincerely,
Mohsin K.





  parent reply	other threads:[~2021-05-11 17:40 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     ` bug#48257: [kisara.moe] Re: [kisara.moe] " Eli Zaretskii
2021-05-11 17:26       ` Eli Zaretskii
2021-05-11 17:40       ` Mohsin Kaleem [this message]
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=87y2cl41a4.fsf@kisara.moe \
    --to=mohkale@kisara.moe \
    --cc=48257@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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).