help-gnu-emacs
[Top][All Lists]
Advanced

[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


From: Amos Bird
Subject: Re: How can I force updating mini window's header line when mode line is updated?
Date: Thu, 26 Apr 2018 01:16:57 +0800
User-agent: mu4e 1.0-alpha3; emacs 27.0.50


Thanks!

Um I'm afraid post-command-hook might not help here. Emacs code has deep assumption of mini window having only one line. After I turn on the header line, things become messy. I'll try collecting all the hard-coded logic and see if this route indeed works.

Here is what I've achieved so far https://la.wentropy.com/WYjq.webm

regards,

Stefan Monnier <address@hidden> writes:

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
force-mode-line-update).

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).


        Stefan


--
Amos Bird
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]