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.

3
  • 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? emacs.stackexchange.com/questions/7697/…
    – lawlist
    Feb 24, 2015 at 22:18
  • Surely you mean windows, not frames?
    – abo-abo
    Feb 25, 2015 at 11:42
  • Good catch. Yes, I mean windows.
    – rgtk
    Feb 25, 2015 at 13:18

2 Answers 2

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.

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.

3
  • Does this still work/work with emacs 26.1?
    – rien333
    Jul 8, 2018 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 9, 2018 at 7:34
  • 1
    There is also common-header-mode-line, though I haven't managed to configure it yet. Sep 24, 2021 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.