emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Keep global-mode-string on its own "modeline"?


From: Manuel Giraud
Subject: Re: Keep global-mode-string on its own "modeline"?
Date: Sun, 30 Oct 2022 09:01:21 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]