[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#48257: [kisara.moe] Re: [kisara.moe] Re: [kisara.moe] Re: [kisara.mo
From: |
Mohsin Kaleem |
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 |
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.