* bug#18233: 24.3.92; Use of (frame-selected-window) in mode-line-format
@ 2014-08-09 21:18 Christopher Schmidt
2014-08-09 22:07 ` Stefan Monnier
0 siblings, 1 reply; 3+ messages in thread
From: Christopher Schmidt @ 2014-08-09 21:18 UTC (permalink / raw)
To: 18233
severity: wishlist
emacs -q
C-x 2
M-: (push '(:eval (if (eq (frame-selected-window)
(selected-window))
"A" "B"))
mode-line-format) RET
Both mode-lines expose an 'A'-Marker.
In Emacs 24.3 the mode-line of the window that is not the user selected
one is marked with 'B'.
I realise this subtle change is not exactly a bug. The old behaviour is
useful and used already, though.[1]
[1] https://github.com/milkypostman/highline/blob/1621662e886afa5948e8fccf0037d6c2a718e9a0/highline.el#L326
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#18233: 24.3.92; Use of (frame-selected-window) in mode-line-format
2014-08-09 21:18 bug#18233: 24.3.92; Use of (frame-selected-window) in mode-line-format Christopher Schmidt
@ 2014-08-09 22:07 ` Stefan Monnier
2014-08-09 22:22 ` Christopher Schmidt
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2014-08-09 22:07 UTC (permalink / raw)
To: 18233
> I realise this subtle change is not exactly a bug. The old behaviour is
> useful and used already, though.[1]
Yes, the old behavior was useful but was fundamentally problematic (by
breaking the equivalence between (selected-window) and
(frame-selected-window), which is otherwise always true).
Also it let you distinguish the one window that's the
frame-selected-window from the other windows in the same frame, but it
did not let you distinguish "the one and only selected-window".
For single-frame configs, there's no difference, but for multi-frame
configs, this usually isn't what was desired.
So we won't go back to the old behavior. Instead we should provide
a new feature for that. IIRC you can currently do it by hand with
something like:
(add-function :before pre-redisplay-function
(lambda (_) (setq my-selected-window (selected-window))))
and then compare (deleted-window) to my-selected-window in your
mode-line-format.
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#18233: 24.3.92; Use of (frame-selected-window) in mode-line-format
2014-08-09 22:07 ` Stefan Monnier
@ 2014-08-09 22:22 ` Christopher Schmidt
0 siblings, 0 replies; 3+ messages in thread
From: Christopher Schmidt @ 2014-08-09 22:22 UTC (permalink / raw)
To: 18233-done
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> So we won't go back to the old behavior. Instead we should provide
> a new feature for that. IIRC you can currently do it by hand with
> something like:
>
> (add-function :before pre-redisplay-function
> (lambda (_) (setq my-selected-window (selected-window))))
>
> and then compare (deleted-window) to my-selected-window in your
> mode-line-format.
Works great. Thanks a lot!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-09 22:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-09 21:18 bug#18233: 24.3.92; Use of (frame-selected-window) in mode-line-format Christopher Schmidt
2014-08-09 22:07 ` Stefan Monnier
2014-08-09 22:22 ` Christopher Schmidt
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.