[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How can I force updating mini window's header line when mode line is
Re: How can I force updating mini window's header line when mode line is updated?
Wed, 25 Apr 2018 12:20:44 -0400
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
> 3. (setq-default header-line-format mode-line-format)
Hmm... this would put a header-line on all windows, whereas IIUC you
want a header-line only for the mini-window, right?
> However the header line doesn't get updated at all.
A window's header-line (and mode-line) will normally only be
updated if something happens in this window that would require
updating it. Part of this detection of when update is needed is
automatic, tho not all of it (so Elisp code sometimes has to call
In your case, the header-line belongs to the mini-window, so this
detection (and most of existing Elisp code calling
force-mode-line-update) won't help because it will only detect a need
for update when the *mini-window* is affected, whereas you most likely
want to update it in many other cases.
So you'll probably want to add some `post-command-hook` (and/or other
related hooks) to try and detect when an update is needed, at which
point you'll need to do
(with-current-buffer <mini-window-buffer> (force-mode-line-update))
> It seems xdisp.c only
> provides ways to update mode line, and I've reached the limit of my
> emacs-fu. How can I achieve this without hacking tons of the display logic?
AFAIK the redisplay doesn't really distinguish the mode-line from the
header-line in this respect (e.g. force-mode-line-update will cause both
the mode-line and the header-line to be refreshed).