11

Is it possible to have only one mode line (sometimes referred as "statusbar") for all windows?

I'd like to make this single mode line show information about the currently selected buffer.

rgtk
  • 414
  • 5
  • 9
  • 2
    Perhaps you could borrow the concept in the attached thread and create a dedicated window on the bottom of every frame, which shows only a custom mode-line? http://emacs.stackexchange.com/questions/7697/make-a-new-frame-with-only-mode-line – lawlist Feb 24 '15 at 22:18
  • Surely you mean windows, not frames? – abo-abo Feb 25 '15 at 11:42
  • Good catch. Yes, I mean windows. – rgtk Feb 25 '15 at 13:18

2 Answers2

9

I don't have a solution for a single modeline, but here are two possible alternative solutions:

1. Only render the mode line in the active window:

If you use powerline, you could wrap your mode-line-format in:

((:eval (when (powerline-selected-window-active) ...)))

then change the mode-line-inactive face so blends with your background but still separates buffers with:

(set-face-attribute 'mode-line-inactive nil
                    :underline t
                    :background (face-background 'default))

This will look like this:

enter image description here

2. Use the frame-title-format

Your frame-title-format determines what is show on the top of your frame when running in a gui.

Set the frame-title-format' like you would yourmode-line-format` and them set your mode-line-format to something blank-ish.

Jordon Biondo
  • 12,332
  • 2
  • 41
  • 62
6

I've finally achieved this by hacking emacs. Demo

You can get the source code from https://github.com/amosbird/emacs/tree/onemodeline . Basically it uses mini-window's header line to render current buffer's modeline.

Amos
  • 456
  • 3
  • 11
  • Does this still work/work with emacs 26.1? – rien333 Jul 08 '18 at 17:05
  • @rien333 It should. But this method is indeed very fragile. There are still hardcoded logic that requires mini window being one line. However I couldn't find them all. – Amos Jul 09 '18 at 07:34
  • 1
    There is also [common-header-mode-line](https://github.com/Bad-ptr/common-header-mode-line.el), though I haven't managed to configure it yet. – Marco Craveiro Sep 24 '21 at 17:03