all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Amos Bird <amosbird@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: help-gnu-emacs@gnu.org
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	[thread overview]
Message-ID: <87fu3jqk8m.fsf@gmail.com> (raw)
In-Reply-To: <jwvh8nzfeni.fsf-monnier+gmane.emacs.help@gnu.org>


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 <monnier@iro.umontreal.ca> 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
amosbird@gmail.com



  reply	other threads:[~2018-04-25 17:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-25 12:41 How can I force updating mini window's header line when mode line is updated? Amos Bird
2018-04-25 16:10 ` Eli Zaretskii
2018-04-25 17:12   ` Amos Bird
2018-04-25 16:20 ` Stefan Monnier
2018-04-25 17:16   ` Amos Bird [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-04-26  7:04 martin rudalics
2018-04-27  2:52 ` Amos Bird
2018-06-27 15:14 ` John Yates
2018-06-28  7:37   ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fu3jqk8m.fsf@gmail.com \
    --to=amosbird@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.