all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Amos Bird <amosbird@gmail.com>
To: martin rudalics <rudalics@gmx.at>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How can I force updating mini window's header line when mode line is updated?
Date: Fri, 27 Apr 2018 10:52:55 +0800	[thread overview]
Message-ID: <87r2n1743c.fsf@gmail.com> (raw)
In-Reply-To: <5AE17A16.7060906@gmx.at>


Yeah, I think using mini window's header line is indeed a nasty 
idea,
but it somehow fits my need (both in GUI and terminal emacs).

I've hacked some xdisp code and it works now.

https://github.com/amosbird/emacs/tree/onemodeline

Here is what I've done.

1. turn on the head line of mini window by tweaking 
window_wants_header_line.
2. change a bunch of functions that initialize mini-window size to 
2 instead of 1.
3. hide normal window's mode line if it's at bottom
4. always use inactive mode line format and empty string content 
for normal window
(used to build horizontal divider in terminal)
5. refresh mini window's header line on every window's redisplay 
action.
6. make sure mode line format uses previous-window if mini window 
is selected

It seems to cover all the corner cases I can reach in both GUI and 
terminal.
(minibuffer resizing, frame/window switching, frame 
creation/deletion...)

Here is a demo screencast in terminal emacs.

https://youtu.be/OSv5JCIlPZA

regards,

martin rudalics <rudalics@gmx.at> writes:

>> Emacs code has deep assumption of mini window having only one 
>> line.
>
> This is not entirely correct.  As long as other windows on the 
> same
> frame fit, a minibuffer window can get quite large (see
> 'max-mini-window-height').  But in some parts of the window and
> redisplay code we assume that minibuffer windows behave like 
> pseudo
> windows (those used for displaying the tool bar or the menu bar 
> on
> some platforms) or internal windows - they can't have dividers, 
> a mode
> or a header line because these are simply not counted when 
> displaying
> the window or calculating its height.  That's why you observe 
> that
>
>> After I turn on the header line, things become messy.
>
> For example, 'window_wants_header_line' in window.c cannot deal 
> with
> that.
>
>> I'll try
>> collecting all the hard-coded logic and see if this route 
>> indeed
>> works.
>
> Good idea.  Note that I'm currently changing a number of things
> related to minibuffer windows which, among others, should allow 
> them
> to appear anywhere on a frame or even not being displayed at 
> all.  So
> I do not think that displaying the mode line of a frame within 
> the
> minibuffer window is a good idea in the first place.  Even 
> presently,
> people who use standalone minibuffer frames might not be very
> enthralled by the idea that they have to look on their 
> minibuffer
> frame for consulting the mode line contents.
>
> I think that if we want frame-local modelines which, IIUC should
> display the mode line contents of the frame's selected window, 
> it
> might be a better idea to add a new kind of pseudo window on top 
> or
> bottom of a frame for that.
>
> martin


--
Amos Bird
amosbird@gmail.com



  reply	other threads:[~2018-04-27  2:52 UTC|newest]

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

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=87r2n1743c.fsf@gmail.com \
    --to=amosbird@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=rudalics@gmx.at \
    /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.