[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: |
Sun, 27 Oct 2019 17:55:10 -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 ;-)
>
> You are mistaken. moody--active-window is NEVER set to nil.
Duh! I read nil instead of `win`!
Stefan