unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Donald Curtis <d@milkbox.net>
Cc: 16874@debbugs.gnu.org, damien.cassou@gmail.com
Subject: bug#16874: 24.3.50; Regression in active window detection
Date: Fri, 07 Mar 2014 19:25:11 -0500	[thread overview]
Message-ID: <jwvy50lee21.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <CANJd5QvN=4kJkU3LMLz3WJiJ93z27BWDh7wxPYDmDJVwvh2yNA@mail.gmail.com> (Donald Curtis's message of "Thu, 6 Mar 2014 22:31:37 -0800")

> so the code I had written was able to detect whether the mode-line was
> being displayed in the active window or not.

IIUC your old code was not correct in some circumstance (maybe in the
presence of multiple frames, can't remember), but indeed the change in
Emacs-24.4 (which was made to fix another problem) breaks such hacks.

The best I can offer so far goes along the following lines:

1- use post-command-hook (or better yet pre-redisplay-function) to set
   a global variable `my-selected-window'.
2- use that variable instead of (selected-window) in your modeline :eval code.


        Stefan





  reply	other threads:[~2014-03-08  0:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-25  9:06 bug#16874: 24.3.50; Regression in active window detection Damien Cassou
2014-02-25 16:18 ` Eli Zaretskii
2014-02-25 16:28   ` Damien Cassou
2014-02-25 17:47     ` Eli Zaretskii
2014-02-26 10:16 ` martin rudalics
2014-03-07  6:31 ` Donald Curtis
2014-03-08  0:25   ` Stefan Monnier [this message]
2014-03-08  1:53     ` Donald Curtis
2014-03-18 22:18       ` Juanma Barranquero

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvy50lee21.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=16874@debbugs.gnu.org \
    --cc=d@milkbox.net \
    --cc=damien.cassou@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).