From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: E Sabof <esabof@gmail.com>
Cc: 14604@debbugs.gnu.org
Subject: bug#14604: 24.3.50.1; Possibly incorrect behaviour of frame-selected-window
Date: Wed, 30 Oct 2013 13:50:20 -0400 [thread overview]
Message-ID: <jwvfvri3b2p.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <CAEp6DyZKNPM2U37Zgy3LdkhVtypJwv6WpyObuLpmR8Zg+kgYmA@mail.gmail.com> (E. Sabof's message of "Thu, 13 Jun 2013 15:59:11 +0100")
> (defvar user-selected-window nil)
> (defun register-user-location ()
> (setq user-selected-window (selected-window)))
> (add-hook 'post-command-hook 'register-user-location)
> (setq-default
> mode-line-format
> '(:eval (if (eq user-selected-window (selected-window))
> "selected"
> "not-selected")))
That will usually work, except for corner-cases where redisplay happens
in the middle of a command, or when the selected window is modified
between commands (e.g. from a process sentinel).
You can make it reliable with the use of the new
`pre-redisplay-function' hook (instead of post-command-hook), which
I just added yesterday.
Of course, making it reliable doesn't mean it's not an omission.
I tend to agree that it would be good to provide access to that info
more directly.
Stefan
next prev parent reply other threads:[~2013-10-30 17:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-13 11:45 bug#14604: 24.3.50.1; Possibly incorrect behaviour of frame-selected-window E Sabof
2013-06-13 13:02 ` Eli Zaretskii
2013-06-13 13:47 ` E Sabof
2013-06-13 14:35 ` Stefan Monnier
2013-06-13 14:59 ` E Sabof
2013-06-13 16:04 ` Eli Zaretskii
2013-06-13 16:16 ` E Sabof
2013-10-30 17:50 ` Stefan Monnier [this message]
2013-10-30 19:23 ` E Sabof
2013-10-30 22:40 ` E Sabof
2013-10-30 23:30 ` Stefan Monnier
2013-11-01 21:13 ` E Sabof
2022-02-13 9:21 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwvfvri3b2p.fsf-monnier+emacsbugs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=14604@debbugs.gnu.org \
--cc=esabof@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.