* Re: Keep global-mode-string on its own "modeline"?
2022-10-28 20:58 Keep global-mode-string on its own "modeline"? Thuna
@ 2022-10-29 6:59 ` Eli Zaretskii
2022-10-29 11:08 ` Thuna
2022-10-29 7:04 ` Akib Azmain Turja
` (3 subsequent siblings)
4 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2022-10-29 6:59 UTC (permalink / raw)
To: Thuna; +Cc: emacs-devel
> From: Thuna <thuna.cing@gmail.com>
> Date: Fri, 28 Oct 2022 22:58:59 +0200
>
> There is no good reason for `global-mode-string' to be displayed in
> every single window's modeline separately, it takes a lot of space, and
> it usually ends up not completely showing when the window is split more
> than once. Would it not be better to keep it in a different location?
> It makes sense (to me) to have it at the top of each Emacs frame,
> although I'm open to suggestions.
We have frame-title-format, which can be customized in the same manner
as mode-line-format. So you could already do this in your sessions,
if that is what you like.
Or are you saying that you already tried to use frame-title-format and
it didn't work? In that case, please tell the details.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Keep global-mode-string on its own "modeline"?
2022-10-29 6:59 ` Eli Zaretskii
@ 2022-10-29 11:08 ` Thuna
2022-10-29 12:38 ` Eli Zaretskii
0 siblings, 1 reply; 20+ messages in thread
From: Thuna @ 2022-10-29 11:08 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
> We have frame-title-format, which can be customized in the same manner
> as mode-line-format. So you could already do this in your sessions,
> if that is what you like.
>
> Or are you saying that you already tried to use frame-title-format and
> it didn't work? In that case, please tell the details.
Not all window managers, mine included, have title bars so frame titles
aren't a universal solution. At the same time, I don't think
frame-title-format is an appropriate place to keep global-mode-string,
since it can be used outside the title bar, and having its value be
global-mode-string will be a large hindrance.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Keep global-mode-string on its own "modeline"?
2022-10-29 11:08 ` Thuna
@ 2022-10-29 12:38 ` Eli Zaretskii
2022-10-29 13:05 ` Thuna
0 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2022-10-29 12:38 UTC (permalink / raw)
To: Thuna; +Cc: emacs-devel
> From: Thuna <thuna.cing@gmail.com>
> Cc: emacs-devel@gnu.org
> Date: Sat, 29 Oct 2022 13:08:01 +0200
>
>
> > We have frame-title-format, which can be customized in the same manner
> > as mode-line-format. So you could already do this in your sessions,
> > if that is what you like.
> >
> > Or are you saying that you already tried to use frame-title-format and
> > it didn't work? In that case, please tell the details.
>
> Not all window managers, mine included, have title bars so frame titles
> aren't a universal solution. At the same time, I don't think
> frame-title-format is an appropriate place to keep global-mode-string,
> since it can be used outside the title bar, and having its value be
> global-mode-string will be a large hindrance.
Sorry, I don't follow: it was your suggestion to display the mode "at
the top of each Emacs frame". If by that you didn't mean the frame's
title, then what did you mean?
You can also arrange for a window to have a header-line, and display
the mode there, of course.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Keep global-mode-string on its own "modeline"?
2022-10-29 12:38 ` Eli Zaretskii
@ 2022-10-29 13:05 ` Thuna
2022-10-29 13:40 ` Eli Zaretskii
0 siblings, 1 reply; 20+ messages in thread
From: Thuna @ 2022-10-29 13:05 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
> Sorry, I don't follow: it was your suggestion to display the mode "at
> the top of each Emacs frame". If by that you didn't mean the frame's
> title, then what did you mean?
Well, location-wise, it would be best to keep the frameline (that's what
I'll call it) away from the modeline, so the most natural place for it
is at the top. The frame's title is also at the top, but it (besides
not always being a thing, as I mentioned before) serves a different and
important purpose, so I'm not very keen on repurposing it. I think you
should be able to see roughly what I want if you switch on tab-bar-mode
with tab-bar-format set to `(tab-bar-format-global)' (as I mentioned
before). I would provide a screenshot if I could, sorry about that.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Keep global-mode-string on its own "modeline"?
2022-10-29 13:05 ` Thuna
@ 2022-10-29 13:40 ` Eli Zaretskii
2022-10-29 13:55 ` Thuna
0 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2022-10-29 13:40 UTC (permalink / raw)
To: Thuna; +Cc: emacs-devel
> From: Thuna <thuna.cing@gmail.com>
> Cc: emacs-devel@gnu.org
> Date: Sat, 29 Oct 2022 15:05:42 +0200
>
>
> > Sorry, I don't follow: it was your suggestion to display the mode "at
> > the top of each Emacs frame". If by that you didn't mean the frame's
> > title, then what did you mean?
>
> Well, location-wise, it would be best to keep the frameline (that's what
> I'll call it) away from the modeline, so the most natural place for it
> is at the top. The frame's title is also at the top, but it (besides
> not always being a thing, as I mentioned before) serves a different and
> important purpose, so I'm not very keen on repurposing it. I think you
> should be able to see roughly what I want if you switch on tab-bar-mode
> with tab-bar-format set to `(tab-bar-format-global)' (as I mentioned
> before). I would provide a screenshot if I could, sorry about that.
So will doing this with header-line fit the bill? If not, why not?
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Keep global-mode-string on its own "modeline"?
2022-10-29 13:40 ` Eli Zaretskii
@ 2022-10-29 13:55 ` Thuna
2022-10-29 15:13 ` Eli Zaretskii
0 siblings, 1 reply; 20+ messages in thread
From: Thuna @ 2022-10-29 13:55 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
> So will doing this with header-line fit the bill? If not, why not?
No, it will still display global-mode-string in every window seperately,
and it will still not fit when the windows are split.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Keep global-mode-string on its own "modeline"?
2022-10-29 13:55 ` Thuna
@ 2022-10-29 15:13 ` Eli Zaretskii
2022-10-29 15:20 ` Thuna
0 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2022-10-29 15:13 UTC (permalink / raw)
To: Thuna; +Cc: emacs-devel
> From: Thuna <thuna.cing@gmail.com>
> Cc: emacs-devel@gnu.org
> Date: Sat, 29 Oct 2022 15:55:54 +0200
>
> > So will doing this with header-line fit the bill? If not, why not?
>
> No, it will still display global-mode-string in every window seperately,
> and it will still not fit when the windows are split.
Then what do you propose to do? AFAIK, Emacs doesn't have any way of
showing something like that, except via the methods I mentioned?
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Keep global-mode-string on its own "modeline"?
2022-10-29 15:13 ` Eli Zaretskii
@ 2022-10-29 15:20 ` Thuna
2022-10-29 15:22 ` Eli Zaretskii
0 siblings, 1 reply; 20+ messages in thread
From: Thuna @ 2022-10-29 15:20 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
> Then what do you propose to do? AFAIK, Emacs doesn't have any way of
> showing something like that, except via the methods I mentioned?
I mean, I don't know how Emacs' internals work so I can't suggest
anything concrete. tab-bar-mode manages to display stuff above the
frame, so maybe whatever it's doing can be repurposed?
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Keep global-mode-string on its own "modeline"?
2022-10-29 15:20 ` Thuna
@ 2022-10-29 15:22 ` Eli Zaretskii
2022-10-29 15:26 ` Thuna
0 siblings, 1 reply; 20+ messages in thread
From: Eli Zaretskii @ 2022-10-29 15:22 UTC (permalink / raw)
To: Thuna; +Cc: emacs-devel
> From: Thuna <thuna.cing@gmail.com>
> Cc: emacs-devel@gnu.org
> Date: Sat, 29 Oct 2022 17:20:09 +0200
>
>
> > Then what do you propose to do? AFAIK, Emacs doesn't have any way of
> > showing something like that, except via the methods I mentioned?
>
> I mean, I don't know how Emacs' internals work so I can't suggest
> anything concrete. tab-bar-mode manages to display stuff above the
> frame, so maybe whatever it's doing can be repurposed?
You can display the mode on the mode line, on the header line, on the
tab bar, or on the tab line. That is what is available in Emacs now.
If any of these possibilities are acceptable to you, you can use it.
If not, then currently Emacs is unable to do what you want, sorry.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Keep global-mode-string on its own "modeline"?
2022-10-29 15:22 ` Eli Zaretskii
@ 2022-10-29 15:26 ` Thuna
2022-10-29 16:07 ` John Yates
2022-10-29 17:49 ` Óscar Fuentes
0 siblings, 2 replies; 20+ messages in thread
From: Thuna @ 2022-10-29 15:26 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
> You can display the mode on the mode line, on the header line, on the
> tab bar, or on the tab line. That is what is available in Emacs now.
> If any of these possibilities are acceptable to you, you can use it.
> If not, then currently Emacs is unable to do what you want, sorry.
Well, yeah, I am aware that Emacs is unable to do that. That's what the
original mail was about.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Keep global-mode-string on its own "modeline"?
2022-10-29 15:26 ` Thuna
@ 2022-10-29 16:07 ` John Yates
2022-10-29 17:49 ` Óscar Fuentes
1 sibling, 0 replies; 20+ messages in thread
From: John Yates @ 2022-10-29 16:07 UTC (permalink / raw)
To: Thuna; +Cc: Eli Zaretskii, emacs-devel
Not a fully general solution, but...
On increasingly common, large, hi-res, hi-dpi screens I can imagine
having tabs and global mode info share space:
* tabs to the left
* global mode info to the left
If the tabs run into the global mode info, the standard UI convention
seems to be to shrink the size of the tabs (possibly truncating title
text).
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Keep global-mode-string on its own "modeline"?
2022-10-29 15:26 ` Thuna
2022-10-29 16:07 ` John Yates
@ 2022-10-29 17:49 ` Óscar Fuentes
1 sibling, 0 replies; 20+ messages in thread
From: Óscar Fuentes @ 2022-10-29 17:49 UTC (permalink / raw)
To: emacs-devel
Thuna <thuna.cing@gmail.com> writes:
>> You can display the mode on the mode line, on the header line, on the
>> tab bar, or on the tab line. That is what is available in Emacs now.
>> If any of these possibilities are acceptable to you, you can use it.
>> If not, then currently Emacs is unable to do what you want, sorry.
>
> Well, yeah, I am aware that Emacs is unable to do that. That's what the
> original mail was about.
I'm not sure of getting the full picture of your request, but maybe this
helps: https://github.com/kiennq/emacs-mini-modeline
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Keep global-mode-string on its own "modeline"?
2022-10-28 20:58 Keep global-mode-string on its own "modeline"? Thuna
2022-10-29 6:59 ` Eli Zaretskii
@ 2022-10-29 7:04 ` Akib Azmain Turja
2022-10-29 15:20 ` Stefan Monnier
` (2 subsequent siblings)
4 siblings, 0 replies; 20+ messages in thread
From: Akib Azmain Turja @ 2022-10-29 7:04 UTC (permalink / raw)
To: Thuna; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1431 bytes --]
Thuna <thuna.cing@gmail.com> writes:
> There is no good reason for `global-mode-string' to be displayed in
> every single window's modeline separately, it takes a lot of space, and
> it usually ends up not completely showing when the window is split more
> than once. Would it not be better to keep it in a different location?
> It makes sense (to me) to have it at the top of each Emacs frame,
> although I'm open to suggestions.
>
> Currently, I get something to that effect with tab-bar-mode by setting
> `tab-bar-format' to `(tab-bar-format-global)', which does roughly what I
> want it to do, but it looks visibly different from the rest of Emacs to
> the point where it's rather off-putting.
>
> I don't know what it would take to implement it (if it's even a good
> idea), but I just wanted to throw it out there.
>
IIUC, that intended to be just that. You set global-mode-string to some
mode line construct (to display the project name of the buffer, for
example), and it'll show the appropriate thing on each window (project
name, for example). You don't need to modify mode line on each and
every buffer to do this, just set the global-mode-string variable.
--
Akib Azmain Turja
Find me on Mastodon at @akib@hostux.social, and on Codeberg (user
"akib").
This message is signed by me with my GnuPG key. Its fingerprint is:
7001 8CE5 819F 17A3 BBA6 66AF E74F 0EFA 922A E7F5
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Keep global-mode-string on its own "modeline"?
2022-10-28 20:58 Keep global-mode-string on its own "modeline"? Thuna
2022-10-29 6:59 ` Eli Zaretskii
2022-10-29 7:04 ` Akib Azmain Turja
@ 2022-10-29 15:20 ` Stefan Monnier
2022-10-30 5:47 ` Akib Azmain Turja
2022-10-29 15:43 ` Philip Kaludercic
2022-10-29 16:27 ` Visuwesh
4 siblings, 1 reply; 20+ messages in thread
From: Stefan Monnier @ 2022-10-29 15:20 UTC (permalink / raw)
To: Thuna; +Cc: emacs-devel
> There is no good reason for `global-mode-string' to be displayed in
> every single window's modeline separately, it takes a lot of space, and
> it usually ends up not completely showing when the window is split more
> than once.
Indeed, we moved it to the end of the mode-line because it ended up
hiding more important info :-)
As to where to put it, it's kind of tricky since Emacs doesn't have much
single place where to put such a thing.
https://elpa.gnu.org/packages/minibuffer-line.html is an attempt to use
the echo area for that.
It has many shortcomings, IIRC, and would probably benefit from some
love, but you might want to try it out, both to discover its limits and
to see whether it hypothetically could be a good approach if we could
fix some of its shortcomings.
Stefan
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Keep global-mode-string on its own "modeline"?
2022-10-29 15:20 ` Stefan Monnier
@ 2022-10-30 5:47 ` Akib Azmain Turja
0 siblings, 0 replies; 20+ messages in thread
From: Akib Azmain Turja @ 2022-10-30 5:47 UTC (permalink / raw)
To: Stefan Monnier; +Cc: Thuna, emacs-devel
[-- Attachment #1: Type: text/plain, Size: 1556 bytes --]
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> There is no good reason for `global-mode-string' to be displayed in
>> every single window's modeline separately, it takes a lot of space, and
>> it usually ends up not completely showing when the window is split more
>> than once.
>
> Indeed, we moved it to the end of the mode-line because it ended up
> hiding more important info :-)
>
> As to where to put it, it's kind of tricky since Emacs doesn't have much
> single place where to put such a thing.
> https://elpa.gnu.org/packages/minibuffer-line.html is an attempt to use
> the echo area for that.
>
> It has many shortcomings, IIRC, and would probably benefit from some
> love, but you might want to try it out, both to discover its limits and
> to see whether it hypothetically could be a good approach if we could
> fix some of its shortcomings.
>
>
> Stefan
>
>
Yeah, minibuffer-line has indeed many shortcomings, so I ended up
writing up my own echo area status line package, Minibar[1], (I need a
status bar because I use EXWM and the external status bar don't suit for
me) and I moved many things from my mode line to that status bar, and
I'm pretty happy last six month with it.
Footnotes:
[1] https://codeberg.org/akib/emacs-minibar (not in any archive)
--
Akib Azmain Turja
Find me on Mastodon at @akib@hostux.social, and on Codeberg (user
"akib").
This message is signed by me with my GnuPG key. Its fingerprint is:
7001 8CE5 819F 17A3 BBA6 66AF E74F 0EFA 922A E7F5
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Keep global-mode-string on its own "modeline"?
2022-10-28 20:58 Keep global-mode-string on its own "modeline"? Thuna
` (2 preceding siblings ...)
2022-10-29 15:20 ` Stefan Monnier
@ 2022-10-29 15:43 ` Philip Kaludercic
[not found] ` <87leoya8xw.fsf@gmail.com>
2022-10-29 16:27 ` Visuwesh
4 siblings, 1 reply; 20+ messages in thread
From: Philip Kaludercic @ 2022-10-29 15:43 UTC (permalink / raw)
To: Thuna; +Cc: emacs-devel
Thuna <thuna.cing@gmail.com> writes:
> There is no good reason for `global-mode-string' to be displayed in
> every single window's modeline separately, it takes a lot of space, and
> it usually ends up not completely showing when the window is split more
> than once. Would it not be better to keep it in a different location?
> It makes sense (to me) to have it at the top of each Emacs frame,
> although I'm open to suggestions.
>
> Currently, I get something to that effect with tab-bar-mode by setting
> `tab-bar-format' to `(tab-bar-format-global)', which does roughly what I
> want it to do, but it looks visibly different from the rest of Emacs to
> the point where it's rather off-putting.
How is it off-putting? You can always customise the `tab-bar' face to
make it appear however you prefer.
I have been doing this for a while now and it works well (except that
mouse clicks aren't handled the same way as they are in the regular mode
line).
> I don't know what it would take to implement it (if it's even a good
> idea), but I just wanted to throw it out there.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Keep global-mode-string on its own "modeline"?
2022-10-28 20:58 Keep global-mode-string on its own "modeline"? Thuna
` (3 preceding siblings ...)
2022-10-29 15:43 ` Philip Kaludercic
@ 2022-10-29 16:27 ` Visuwesh
2022-10-30 8:01 ` Manuel Giraud
4 siblings, 1 reply; 20+ messages in thread
From: Visuwesh @ 2022-10-29 16:27 UTC (permalink / raw)
To: Thuna; +Cc: emacs-devel
[வெள்ளி அக்டோபர் 28, 2022] Thuna wrote:
> There is no good reason for `global-mode-string' to be displayed in
> every single window's modeline separately, it takes a lot of space, and
> it usually ends up not completely showing when the window is split more
> than once. Would it not be better to keep it in a different location?
> It makes sense (to me) to have it at the top of each Emacs frame,
> although I'm open to suggestions.
At some point in my Emacs life, I put the global-mode-string stuff in
the bottom right window only using an :eval construct. I don't have it
anymore but looking at the logs, it looks I used something like
(:eval (and (window-at-side-p nil 'right) (window-at-side-p nil 'bottom)
stuff...))
HTH.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Keep global-mode-string on its own "modeline"?
2022-10-29 16:27 ` Visuwesh
@ 2022-10-30 8:01 ` Manuel Giraud
0 siblings, 0 replies; 20+ messages in thread
From: Manuel Giraud @ 2022-10-30 8:01 UTC (permalink / raw)
To: Visuwesh; +Cc: Thuna, emacs-devel
Visuwesh <visuweshm@gmail.com> writes:
> [வெள்ளி அக்டோபர் 28, 2022] Thuna wrote:
>
>> There is no good reason for `global-mode-string' to be displayed in
>> every single window's modeline separately, it takes a lot of space, and
>> it usually ends up not completely showing when the window is split more
>> than once. Would it not be better to keep it in a different location?
>> It makes sense (to me) to have it at the top of each Emacs frame,
>> although I'm open to suggestions.
>
> At some point in my Emacs life, I put the global-mode-string stuff in
> the bottom right window only using an :eval construct. I don't have it
> anymore but looking at the logs, it looks I used something like
>
> (:eval (and (window-at-side-p nil 'right) (window-at-side-p nil 'bottom)
> stuff...))
Yes I'm currently using this too:
--8<---------------cut here---------------start------------->8---
(defun display-time-bottom-right ()
(when (equal (cddr (window-pixel-edges))
(cddr (window-pixel-edges (frame-root-window))))
(let ((len (+ (length battery-mode-line-string)
(length display-time-string)
2))
(blank " "))
(put-text-property 0 1 'display `(space :align-to (- right ,len)) blank)
`(,blank
battery-mode-line-string
display-time-string))))
(setq global-mode-string '(:eval (display-time-bottom-right)))
--8<---------------cut here---------------end--------------->8---
--
Manuel Giraud
^ permalink raw reply [flat|nested] 20+ messages in thread