From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Donald Curtis Newsgroups: gmane.emacs.bugs Subject: bug#16874: 24.3.50; Regression in active window detection Date: Fri, 7 Mar 2014 17:53:39 -0800 Message-ID: References: <87eh2rftna.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0158b8eaa746aa04f40ea373 X-Trace: ger.gmane.org 1394243648 31303 80.91.229.3 (8 Mar 2014 01:54:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Mar 2014 01:54:08 +0000 (UTC) Cc: 16874@debbugs.gnu.org, damien.cassou@gmail.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 08 02:54:16 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WM6Su-0002UX-5T for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Mar 2014 02:54:16 +0100 Original-Received: from localhost ([::1]:39036 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WM6St-0004WO-Rb for geb-bug-gnu-emacs@m.gmane.org; Fri, 07 Mar 2014 20:54:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WM6Sm-0004WI-Ep for bug-gnu-emacs@gnu.org; Fri, 07 Mar 2014 20:54:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WM6Sh-0005gL-4B for bug-gnu-emacs@gnu.org; Fri, 07 Mar 2014 20:54:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54209) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WM6Sg-0005gH-To for bug-gnu-emacs@gnu.org; Fri, 07 Mar 2014 20:54:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WM6Sg-0004pY-CY for bug-gnu-emacs@gnu.org; Fri, 07 Mar 2014 20:54:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Donald Curtis Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Mar 2014 01:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16874 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16874-submit@debbugs.gnu.org id=B16874.139424362318526 (code B ref 16874); Sat, 08 Mar 2014 01:54:02 +0000 Original-Received: (at 16874) by debbugs.gnu.org; 8 Mar 2014 01:53:43 +0000 Original-Received: from localhost ([127.0.0.1]:55391 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WM6SN-0004ok-3b for submit@debbugs.gnu.org; Fri, 07 Mar 2014 20:53:43 -0500 Original-Received: from mail-la0-f43.google.com ([209.85.215.43]:45176) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WM6SK-0004oa-F9 for 16874@debbugs.gnu.org; Fri, 07 Mar 2014 20:53:41 -0500 Original-Received: by mail-la0-f43.google.com with SMTP id e16so3307827lan.16 for <16874@debbugs.gnu.org>; Fri, 07 Mar 2014 17:53:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=5fq4P4UzlltbmuiSjJQaWWup10KKVkj3lwc0CvC/rwM=; b=suJp+XMb3JneqzFP3BSx0TkpQzczuQT0DObFEaRr4rzEpSAcgDxG5XlNqbhRD9eJnv a26/9r1N+r9fw5oGE++hfLp6c7gzQsNnc1xvvqqkxmj4oAfcXzsR1iE7NtfEsV5PMIK/ aeFc0cQvxTKR3Bd8y6bJsGyW/L14IRAruPw4/VHQxMWUocgEpkiaKqhVE8kiM8HERKXq LGEFJKz8fbQ+dKO0i1ynYVUI+FSJHoOTgNPe1D9x9siUruoKnlAchAdSKlTzEleip9KH aLg/7O6pGTEFAHBOQNJlLesqODIkVXdMTShicz/RJz/lz4tFQh9gLB70dAktEy0U0IY2 F9sg== X-Received: by 10.152.9.65 with SMTP id x1mr13912440laa.6.1394243619209; Fri, 07 Mar 2014 17:53:39 -0800 (PST) Original-Received: by 10.112.33.47 with HTTP; Fri, 7 Mar 2014 17:53:39 -0800 (PST) Original-Received: by 10.112.33.47 with HTTP; Fri, 7 Mar 2014 17:53:39 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: cgfh9cAwFY80udIGHzIoiqIihPk X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:86649 Archived-At: --089e0158b8eaa746aa04f40ea373 Content-Type: text/plain; charset=UTF-8 Cool thanks for the pre redisplay suggestion. On Mar 7, 2014 4:26 PM, "Stefan Monnier" wrote: > > 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 > --089e0158b8eaa746aa04f40ea373 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Cool thanks for the pre redisplay suggestion.

On Mar 7, 2014 4:26 PM, "Stefan Monnier&quo= t; <monnier@iro.umontreal.ca= > wrote:
> 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<= br> 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
=C2=A0 =C2=A0a global variable `my-selected-window'.
2- use that variable instead of (selected-window) in your modeline :eval co= de.


=C2=A0 =C2=A0 =C2=A0 =C2=A0 Stefan
--089e0158b8eaa746aa04f40ea373--