Subject: Re: bug#16874: 24.3.50; Regression in active window detection

From: martin rudalics <[email-masked]>
Date: Wed, 26 Feb 2014 11:16:39 +0100

Damien Cassou schrieb:
 > The following piece of code, from the milkypostman/powerline github
 > repository, used to detect if the current window is active or not:
 >
 >     (defun powerline-selected-window-active ()
 >       "Return whether the current window is active."
 >       (or (eq (frame-selected-window)
 >               (selected-window))
 >           (and (minibuffer-window-active-p
 >                 (frame-selected-window))
 >                (eq (pl/minibuffer-selected-window)
 >                    (selected-window)))))
 >
 > This works fine in released Emacs 24 but does not work anymore in
 > emacs-snapshot (see below for details about the version I used to test).
 > Is this an Emacs regression or a problem in the implementation of this
 > function that is revealed by some recent changes in Emacs?
 >
 >
 > More about this issue: https://github.com/milkypostman/powerline/issues/37

 From the discussion in that thread I wasn't able to understand what that
function is needed for.  Could you describe that?  For example, why is

 >       (or (eq (frame-selected-window)
 >               (selected-window))

needed?  What does `pl/minibuffer-selected-window' return?  And why does

 >           (and (minibuffer-window-active-p
 >                 (frame-selected-window))
 >                (eq (pl/minibuffer-selected-window)
 >                    (selected-window)))))

one time call `frame-selected-window' and one time `selected-window'?

martin