Subject: bug#75662: 30.0.93; FR: customization to move mode-line to the top

From: Eli Zaretskii <[email-masked]>
Date: Sun, 19 Jan 2025 08:03:24 +0200

> Date: Sun, 19 Jan 2025 01:45:59 +0100
> From:  Daniel Mendler via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> I have seen many experiments where people try to use the header-line as
> mode-line and vice versa. However most packages assume that the
> mode-line/header-line is in fact a mode-line/header-line and do not
> handle such manual modification of the
> mode-line-format/header-line-format well. This is the main motivation
> for this feature request.
> 
> Furthermore conventional tiling window managers draw the window title
> bars at the top of the windows. Therefore when using Emacs as window
> manager via EXWM, people may prefer to have the mode-line at the top,
> since it acts as window title bar.

The header-line format already supports almost everything a mode-line
format does, and frame-title-format supports a subset of them.  So
people can already have at least some of that by tweaking these
formats.

> I propose to add a customization option `mode-line-at' which can be set
> to `top' or `bottom'. When set to `top` the mode-line will be moved to
> the top. For the other lines such an option could be offered too,
> `header-line-at`, `tab-bar-at`, `tab-line-at`, etc.
> 
> How difficult would it be to implement this feature?

The assumption that the mode line, if it exists, is at the bottom of a
window is hard-coded into the display engine in many places.  Changing
that would require discovering all those places and modifying them in
some way as needed.  If someone wants to work on that, please do, but
it's a significant job.

> In Emacs 30, the variable `tool-bar-position' has been added which
> makes it possible to customize the tool bar position in a similar
> way. In this case the change might have been simpler given that the
> toolbar is a graphical element only, while the mode line may affect
> the display subsystem more deeply?

Tool bar is either implemented by the toolkit (in which case it isn't
our problem to support its various positions), or it is a special kind
of window.  By contrast, the mode line is a special kind of screen
line, so each window redisplay must know about its existence and
actively redraw it as needed.  So yes, the job of adding support for
other positions of the mode line is harder.