emacs-devel
[Top][All Lists]
Advanced

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

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


From: Stefan Monnier
Subject: Re: Let mode-line packages distinguish the selected-window
Date: Sat, 26 Oct 2019 16:36:19 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> That's very promising indeed.  The minibuffer window needs to be handled
> a bit differently, I think:
>
>     (defun moody--set-active-window (_)
>       (let ((win (selected-window)))
>         (unless (minibuffer-window-active-p win)
>           (setq moody--active-window win))))
>
>     (add-hook 'pre-redisplay-functions #'moody--set-active-window)

I don't understand what this is about.  From this all I can see is that
moody--active-window will always be nil, so it's clearly not quite right ;-)

This matters if we want to provide the info from the C code: we'd better
make sure we provide the right info then, but if different packages need
slightly different info we're in trouble.  This said, AFAICT,
minibuffer-window-active-p can be used later on so I get the impression
that the hook I suggested would provide enough info that you can easily
derive moody's specific flavor of that info.

> But even though I suggested something like that, I feel the
> remembered-selected-window approach is a bit hackish.  IMO it would be
> nicer if instead of that variable regular selected-window would return
> "that window" while a new function/variable named something like
> mode-line-window returned the "window whose mode-line is currently being
> updated".

Maybe you're right, tho I'm not sure really which of the two options
would be better in an ideal world.

> But that would be a breaking change, so maybe not.

Indeed, I think this ship has sailed so we don't need to figure out
which option is best.


        Stefan




reply via email to

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