| ;; NOTE 2024-02-16: when `tab-bar-mode' is enabled & `tab-bar-format-global'
|
| ;; is part of `tab-bar-format', the `my/mode-line-misc-info' construct
|
| ;; omits the `global-mode-string'.
|
| (defvar-local my/modeline-misc-info
|
| '(:eval
|
| (and (mode-line-window-selected-p)
|
| (append
|
| (butlast mode-line-misc-info)
|
| '(" ")
|
| (unless (and tab-bar-mode
|
| (length> (frame-parameter (window-frame) 'tabs)
|
| tab-bar-show)
|
| (memq 'tab-bar-format-global tab-bar-format))
|
| '((global-mode-string ("" global-mode-string " ")))))))
|
| "Display `mode-line-misc-info' only in selected window.")
|
|
|
| (put 'my/modeline-misc-info 'risky-local-variable t)
|