[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Let mode-line packages distinguish the selected-window

From: Eli Zaretskii
Subject: Re: Let mode-line packages distinguish the selected-window
Date: Sat, 26 Oct 2019 17:01:28 +0300

> From: Jonas Bernoulli <address@hidden>
> Date: Sat, 26 Oct 2019 15:38:19 +0200
> It would be nice if Emacs could instead bind a variable that is
> accessible from lisp to the window that will be the selected window
> again once we are done updating the mode-line of this and other windows.
> This should probably happen in display_mode_lines().  Actually this
> function does already save the selected-window in another variable
> before it changes the value of this variable, but it only does so for
> its own use.
>   Lisp_Object old_selected_window = selected_window;
>   ...
>   struct window *sel_w = XWINDOW (old_selected_window);
> Later this function decides what face to use like so:
>       /* Select mode line face based on the real selected window.  */
>       display_mode_line (w, CURRENT_MODE_LINE_FACE_ID_3 (sel_w, sel_w, w),
>                        NILP (window_mode_line_format)
>                        ? BVAR (current_buffer, mode_line_format)
>                        : window_mode_line_format);
> The result of this decision unfortunately also isn't accessible from
> lisp.
> In summary, please add a way for functions that format elements of the
> mode-line to determine whether these elements are going to be used in
> the selected or some other window.  Maybe there is a better way to do
> that than what I suggested above.

Do you have a patch that works for you?  If so, could you show it?

I understand the general idea, but in the display code the devil is in
the details, and this particular place is tricky already.  One issue
that bothers me is what happens when we are in the minibuffer window.
So a working patch, which was tested with the packages you mention,
would go a long way towards resolving the issue.


reply via email to

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