GNU bug report logs - #14604
24.3.50.1; Possibly incorrect behaviour of frame-selected-window

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: E Sabof <esabof@HIDDEN>; dated Thu, 13 Jun 2013 11:47:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 14604 <at> debbugs.gnu.org:


Received: (at 14604) by debbugs.gnu.org; 1 Nov 2013 21:13:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 01 17:13:51 2013
Received: from localhost ([127.0.0.1]:58154 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VcM2R-0003fN-AP
	for submit <at> debbugs.gnu.org; Fri, 01 Nov 2013 17:13:51 -0400
Received: from mail-wi0-f176.google.com ([209.85.212.176]:50891)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <esabof@HIDDEN>) id 1VcM2O-0003fA-Rh
 for 14604 <at> debbugs.gnu.org; Fri, 01 Nov 2013 17:13:49 -0400
Received: by mail-wi0-f176.google.com with SMTP id ex4so1651969wid.3
 for <14604 <at> debbugs.gnu.org>; Fri, 01 Nov 2013 14:13:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=RjyJvwKa9tJTsgyRTLcjkAU3mUSTnnrycA/jd4roxBk=;
 b=BmNLmX3vWJThtKKqQCe0OpCv8mS1gfncJMRYTIBYOAumVX5Sq6uFTpwzbNAIlnJJ9G
 IdoxYkbzPN+xGAqrq8EUO5g9eyrHUHOzh0GGZx7vX4D4UfDymDEGv69yrbmz0cO3lWvU
 hiOBKnW7KYU6safjf+4mB+2rkV1SaUqdvGIsMuiOEokBdPqz2t3GQQrBy09LG2wtzHWe
 mya/jKvLeyuDgNBUrBmz1JMrdYitV2magp2rIWN+zf0jdWHrNT7PjKUQ7wvQquLzYyZp
 AwppwIRRozdyiCYUxs/dx8kMbqElyd9nSNiWxsaVgNdfNh33vSGDXrY12cI75ibGon3r
 6Dcw==
MIME-Version: 1.0
X-Received: by 10.180.72.195 with SMTP id f3mr3666628wiv.51.1383340422896;
 Fri, 01 Nov 2013 14:13:42 -0700 (PDT)
Received: by 10.217.45.197 with HTTP; Fri, 1 Nov 2013 14:13:42 -0700 (PDT)
In-Reply-To: <jwvhabytk04.fsf-monnier+emacsbugs@HIDDEN>
References: <CAEp6DyZCmQsH4CQAmiJNDUbpaKVX_RBtm=zWKP7Xarwsb8e_ig@HIDDEN>
 <jwvd2rqf5nq.fsf-monnier+emacs@HIDDEN>
 <CAEp6DyZKNPM2U37Zgy3LdkhVtypJwv6WpyObuLpmR8Zg+kgYmA@HIDDEN>
 <jwvfvri3b2p.fsf-monnier+emacsbugs@HIDDEN>
 <CAEp6DyYSkZHjhY1ZJi3cgivmrj_Mo38KWiXDQEk0Ls=Nknp53A@HIDDEN>
 <CAEp6DybnND+k=8qSqJjOkyPgg1ia5RRAM+HctQrLjrTmHshA5w@HIDDEN>
 <jwvhabytk04.fsf-monnier+emacsbugs@HIDDEN>
Date: Fri, 1 Nov 2013 21:13:42 +0000
Message-ID: <CAEp6DybNf-HDu-5Ry5VRtG36o6wvEN3wr9FTCbtZxKSq+YYayQ@HIDDEN>
Subject: Re: bug#14604: 24.3.50.1;
 Possibly incorrect behaviour of frame-selected-window
From: E Sabof <esabof@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Content-Type: multipart/alternative; boundary=f46d043c7b8c82a4b004ea240a26
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 14604
Cc: 14604 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--f46d043c7b8c82a4b004ea240a26
Content-Type: text/plain; charset=ISO-8859-1

FWIW, I do like the new mechnsim. At the same time I think it offers little
utility for of 90% cases, while introducing complexity and opaqueness. I
wouldn't want it to become default for hooks.

Evgeni


On Wed, Oct 30, 2013 at 11:30 PM, Stefan Monnier
<monnier@HIDDEN>wrote:

> > Seemed to work during my brief test. Am I right in assuming that it's
> going
> > to become `pre-redisplay-functions' if it goes into production?
>
> No: use add-function to modify it.
>
>
>         Stefan
>

--f46d043c7b8c82a4b004ea240a26
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">FWIW, I do like the new mechnsim. At the same time I think=
 it offers little utility for of 90% cases, while introducing complexity an=
d opaqueness. I wouldn&#39;t want it to become default for hooks.<div><br>
</div><div>Evgeni</div></div><div class=3D"gmail_extra"><br><br><div class=
=3D"gmail_quote">On Wed, Oct 30, 2013 at 11:30 PM, Stefan Monnier <span dir=
=3D"ltr">&lt;<a href=3D"mailto:monnier@HIDDEN" target=3D"_blank">=
monnier@HIDDEN</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"im">&gt; Seemed to work during=
 my brief test. Am I right in assuming that it&#39;s going<br>
&gt; to become `pre-redisplay-functions&#39; if it goes into production?<br=
>
<br>
</div>No: use add-function to modify it.<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
<br>
=A0 =A0 =A0 =A0 Stefan<br>
</font></span></blockquote></div><br></div>

--f46d043c7b8c82a4b004ea240a26--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14604; Package emacs. Full text available.

Message received at 14604 <at> debbugs.gnu.org:


Received: (at 14604) by debbugs.gnu.org; 30 Oct 2013 23:30:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 30 19:30:51 2013
Received: from localhost ([127.0.0.1]:53722 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VbfDu-0002b4-T2
	for submit <at> debbugs.gnu.org; Wed, 30 Oct 2013 19:30:51 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.182]:25913)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <monnier@HIDDEN>) id 1VbfDs-0002ap-56
 for 14604 <at> debbugs.gnu.org; Wed, 30 Oct 2013 19:30:48 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Av8EABK/CFFsoXfp/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA6R6gV6DEw
X-IPAS-Result: Av8EABK/CFFsoXfp/2dsb2JhbABEuzWDWRdzgh4BAQQBViMFCws0EhQYDSSIHgbBLZEKA6R6gV6DEw
X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="36721559"
Received: from 108-161-119-233.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net)
 ([108.161.119.233])
 by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA;
 30 Oct 2013 19:30:42 -0400
Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848)
 id E5903AE1C4; Wed, 30 Oct 2013 19:30:43 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: E Sabof <esabof@HIDDEN>
Subject: Re: bug#14604: 24.3.50.1;
 Possibly incorrect behaviour of frame-selected-window
Message-ID: <jwvhabytk04.fsf-monnier+emacsbugs@HIDDEN>
References: <CAEp6DyZCmQsH4CQAmiJNDUbpaKVX_RBtm=zWKP7Xarwsb8e_ig@HIDDEN>
 <jwvd2rqf5nq.fsf-monnier+emacs@HIDDEN>
 <CAEp6DyZKNPM2U37Zgy3LdkhVtypJwv6WpyObuLpmR8Zg+kgYmA@HIDDEN>
 <jwvfvri3b2p.fsf-monnier+emacsbugs@HIDDEN>
 <CAEp6DyYSkZHjhY1ZJi3cgivmrj_Mo38KWiXDQEk0Ls=Nknp53A@HIDDEN>
 <CAEp6DybnND+k=8qSqJjOkyPgg1ia5RRAM+HctQrLjrTmHshA5w@HIDDEN>
Date: Wed, 30 Oct 2013 19:30:43 -0400
In-Reply-To: <CAEp6DybnND+k=8qSqJjOkyPgg1ia5RRAM+HctQrLjrTmHshA5w@HIDDEN>
 (E. Sabof's message of "Wed, 30 Oct 2013 22:40:31 +0000")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 14604
Cc: 14604 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)

> Seemed to work during my brief test. Am I right in assuming that it's going
> to become `pre-redisplay-functions' if it goes into production?

No: use add-function to modify it.


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14604; Package emacs. Full text available.

Message received at 14604 <at> debbugs.gnu.org:


Received: (at 14604) by debbugs.gnu.org; 30 Oct 2013 22:40:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 30 18:40:48 2013
Received: from localhost ([127.0.0.1]:53683 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VbeRT-0001R5-1W
	for submit <at> debbugs.gnu.org; Wed, 30 Oct 2013 18:40:47 -0400
Received: from mail-wg0-f46.google.com ([74.125.82.46]:45010)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <esabof@HIDDEN>) id 1VbeRJ-0001Qk-Jm
 for 14604 <at> debbugs.gnu.org; Wed, 30 Oct 2013 18:40:38 -0400
Received: by mail-wg0-f46.google.com with SMTP id m15so1975108wgh.25
 for <14604 <at> debbugs.gnu.org>; Wed, 30 Oct 2013 15:40:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=beebQyGxZcY1Kqsc4envs7LInKM5GvjbmPr4IpQK608=;
 b=rNEEq1OLI1FLGMzd+hcgjcnplQXuYN5JORETnhmVgansfNm2OJOk1ko5M+gTZy+Mlm
 uhPJ6SgMEuL63zLDsRr2oQBVlaRa5XgYy7MWAoPgRojbedgRxi1kpqLgSfjs+L2rn2Xj
 mhwQ+B531ERrSarHQPt/Y61NNm11zEu/DYg344e4DZuOO+3oH1QxTMaK2e48STGmSf7a
 XornmeaXp3ypvknVLcrkdL1FxVAfJpTIYwAiH+mFYPcKcvsfpjmCZPrM3AgUSZZ6b3m5
 FMCIIAOEJFs9NOxW2h5jOVRX+6TBeLGYKxBWQTZ1NWBfnArSu/+Sq7rgQIbwu/Zle7gs
 G+FA==
MIME-Version: 1.0
X-Received: by 10.181.12.75 with SMTP id eo11mr4126216wid.24.1383172831765;
 Wed, 30 Oct 2013 15:40:31 -0700 (PDT)
Received: by 10.217.45.197 with HTTP; Wed, 30 Oct 2013 15:40:31 -0700 (PDT)
In-Reply-To: <CAEp6DyYSkZHjhY1ZJi3cgivmrj_Mo38KWiXDQEk0Ls=Nknp53A@HIDDEN>
References: <CAEp6DyZCmQsH4CQAmiJNDUbpaKVX_RBtm=zWKP7Xarwsb8e_ig@HIDDEN>
 <jwvd2rqf5nq.fsf-monnier+emacs@HIDDEN>
 <CAEp6DyZKNPM2U37Zgy3LdkhVtypJwv6WpyObuLpmR8Zg+kgYmA@HIDDEN>
 <jwvfvri3b2p.fsf-monnier+emacsbugs@HIDDEN>
 <CAEp6DyYSkZHjhY1ZJi3cgivmrj_Mo38KWiXDQEk0Ls=Nknp53A@HIDDEN>
Date: Wed, 30 Oct 2013 22:40:31 +0000
Message-ID: <CAEp6DybnND+k=8qSqJjOkyPgg1ia5RRAM+HctQrLjrTmHshA5w@HIDDEN>
Subject: Re: bug#14604: 24.3.50.1;
 Possibly incorrect behaviour of frame-selected-window
From: E Sabof <esabof@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Content-Type: multipart/alternative; boundary=f46d043c7c564ceafb04e9fd0516
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 14604
Cc: 14604 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--f46d043c7c564ceafb04e9fd0516
Content-Type: text/plain; charset=ISO-8859-1

Seemed to work during my brief test. Am I right in assuming that it's going
to become `pre-redisplay-functions' if it goes into production?

Evgeni


On Wed, Oct 30, 2013 at 7:23 PM, E Sabof <esabof@HIDDEN> wrote:

> Thanks!
>
> Evgeni
>
>
> On Wed, Oct 30, 2013 at 5:50 PM, Stefan Monnier <monnier@HIDDEN>wrote:
>
>> > (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
>>
>
>

--f46d043c7c564ceafb04e9fd0516
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Seemed to work during my brief test. Am I right in assumin=
g that it&#39;s going to become `<span style=3D"font-family:arial,sans-seri=
f;font-size:13px">pre-redisplay-functions&#39;</span>=A0if it goes into pro=
duction?<div>
<br></div><div>Evgeni</div></div><div class=3D"gmail_extra"><br><br><div cl=
ass=3D"gmail_quote">On Wed, Oct 30, 2013 at 7:23 PM, E Sabof <span dir=3D"l=
tr">&lt;<a href=3D"mailto:esabof@HIDDEN" target=3D"_blank">esabof@gmail.=
com</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">Thanks!<div><br></div><div>=
Evgeni</div></div><div class=3D"HOEnZb"><div class=3D"h5"><div class=3D"gma=
il_extra">
<br><br><div class=3D"gmail_quote">On Wed, Oct 30, 2013 at 5:50 PM, Stefan =
Monnier <span dir=3D"ltr">&lt;<a href=3D"mailto:monnier@HIDDEN" t=
arget=3D"_blank">monnier@HIDDEN</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div>&gt; (defvar user-selected-window nil)<=
br>
&gt; (defun register-user-location ()<br>
&gt; =A0 (setq user-selected-window (selected-window)))<br>
&gt; (add-hook &#39;post-command-hook &#39;register-user-location)<br>
<br>
&gt; (setq-default<br>
&gt; =A0 mode-line-format<br>
&gt; =A0 &#39;(:eval (if (eq user-selected-window (selected-window))<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 &quot;selected&quot;<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 &quot;not-selected&quot;)))<br>
<br>
</div>That will usually work, except for corner-cases where redisplay happe=
ns<br>
in the middle of a command, or when the selected window is modified<br>
between commands (e.g. from a process sentinel).<br>
<br>
You can make it reliable with the use of the new<br>
`pre-redisplay-function&#39; hook (instead of post-command-hook), which<br>
I just added yesterday.<br>
<br>
Of course, making it reliable doesn&#39;t mean it&#39;s not an omission.<br=
>
I tend to agree that it would be good to provide access to that info<br>
more directly.<br>
<span><font color=3D"#888888"><br>
<br>
=A0 =A0 =A0 =A0 Stefan<br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>

--f46d043c7c564ceafb04e9fd0516--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14604; Package emacs. Full text available.

Message received at 14604 <at> debbugs.gnu.org:


Received: (at 14604) by debbugs.gnu.org; 30 Oct 2013 19:23:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 30 15:23:32 2013
Received: from localhost ([127.0.0.1]:53334 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VbbMY-0001mu-US
	for submit <at> debbugs.gnu.org; Wed, 30 Oct 2013 15:23:31 -0400
Received: from mail-wi0-f174.google.com ([209.85.212.174]:50649)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <esabof@HIDDEN>) id 1VbbMW-0001me-44
 for 14604 <at> debbugs.gnu.org; Wed, 30 Oct 2013 15:23:29 -0400
Received: by mail-wi0-f174.google.com with SMTP id cb5so7327960wib.13
 for <14604 <at> debbugs.gnu.org>; Wed, 30 Oct 2013 12:23:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=LloeiA3EvLqoL10+JC55y/wDad+/EEfbiLCahLxq5TQ=;
 b=Yphrmjg0t6x9J75qQ44glTKlkrSIXCiXF28X1Eq+JSzcXYhIeDMMi9izdAorBTs65h
 FV6nFSPLpPQ5VpLohkBJmztm6a7V5EhXajN/GIhlozbv4XGvWsQK5T4gP6/gOJzuOFqF
 qpRuMnUVQ3rovtJ3KnjUrzI1Z3G7PP5uw8MZzUqfKGsjB4Z13JDJ5AVKNtd9Jo7TnVHo
 wxyl4ILCj2/iofEG2eoutawZwQcPPpRWE/6oX5tEA12UGfRTOHheY6FFOPTI/h5yWQJ0
 6b0MaB3X/2INs9jt7g4D4iQEPaoUiK+9HK3lyo16USYAftM6/wuWRHWEU1LTlU+HAqEK
 FjAg==
MIME-Version: 1.0
X-Received: by 10.180.185.101 with SMTP id fb5mr3564400wic.11.1383161001936;
 Wed, 30 Oct 2013 12:23:21 -0700 (PDT)
Received: by 10.217.45.197 with HTTP; Wed, 30 Oct 2013 12:23:21 -0700 (PDT)
In-Reply-To: <jwvfvri3b2p.fsf-monnier+emacsbugs@HIDDEN>
References: <CAEp6DyZCmQsH4CQAmiJNDUbpaKVX_RBtm=zWKP7Xarwsb8e_ig@HIDDEN>
 <jwvd2rqf5nq.fsf-monnier+emacs@HIDDEN>
 <CAEp6DyZKNPM2U37Zgy3LdkhVtypJwv6WpyObuLpmR8Zg+kgYmA@HIDDEN>
 <jwvfvri3b2p.fsf-monnier+emacsbugs@HIDDEN>
Date: Wed, 30 Oct 2013 19:23:21 +0000
Message-ID: <CAEp6DyYSkZHjhY1ZJi3cgivmrj_Mo38KWiXDQEk0Ls=Nknp53A@HIDDEN>
Subject: Re: bug#14604: 24.3.50.1;
 Possibly incorrect behaviour of frame-selected-window
From: E Sabof <esabof@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Content-Type: multipart/alternative; boundary=001a11c2448e300f8b04e9fa4439
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 14604
Cc: 14604 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--001a11c2448e300f8b04e9fa4439
Content-Type: text/plain; charset=ISO-8859-1

Thanks!

Evgeni


On Wed, Oct 30, 2013 at 5:50 PM, Stefan Monnier <monnier@HIDDEN>wrote:

> > (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
>

--001a11c2448e300f8b04e9fa4439
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Thanks!<div><br></div><div>Evgeni</div></div><div class=3D=
"gmail_extra"><br><br><div class=3D"gmail_quote">On Wed, Oct 30, 2013 at 5:=
50 PM, Stefan Monnier <span dir=3D"ltr">&lt;<a href=3D"mailto:monnier@HIDDEN=
montreal.ca" target=3D"_blank">monnier@HIDDEN</a>&gt;</span> wrot=
e:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div class=3D"im">&gt; (defvar user-selected=
-window nil)<br>
&gt; (defun register-user-location ()<br>
&gt; =A0 (setq user-selected-window (selected-window)))<br>
&gt; (add-hook &#39;post-command-hook &#39;register-user-location)<br>
<br>
&gt; (setq-default<br>
&gt; =A0 mode-line-format<br>
&gt; =A0 &#39;(:eval (if (eq user-selected-window (selected-window))<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 &quot;selected&quot;<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 &quot;not-selected&quot;)))<br>
<br>
</div>That will usually work, except for corner-cases where redisplay happe=
ns<br>
in the middle of a command, or when the selected window is modified<br>
between commands (e.g. from a process sentinel).<br>
<br>
You can make it reliable with the use of the new<br>
`pre-redisplay-function&#39; hook (instead of post-command-hook), which<br>
I just added yesterday.<br>
<br>
Of course, making it reliable doesn&#39;t mean it&#39;s not an omission.<br=
>
I tend to agree that it would be good to provide access to that info<br>
more directly.<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
<br>
=A0 =A0 =A0 =A0 Stefan<br>
</font></span></blockquote></div><br></div>

--001a11c2448e300f8b04e9fa4439--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14604; Package emacs. Full text available.

Message received at 14604 <at> debbugs.gnu.org:


Received: (at 14604) by debbugs.gnu.org; 30 Oct 2013 17:50:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Oct 30 13:50:26 2013
Received: from localhost ([127.0.0.1]:53135 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VbZuU-0007uP-6x
	for submit <at> debbugs.gnu.org; Wed, 30 Oct 2013 13:50:26 -0400
Received: from pruche.dit.umontreal.ca ([132.204.246.22]:60656)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <monnier@HIDDEN>) id 1VbZuR-0007uE-8f
 for 14604 <at> debbugs.gnu.org; Wed, 30 Oct 2013 13:50:24 -0400
Received: from faina.iro.umontreal.ca (lechon.iro.umontreal.ca
 [132.204.27.242])
 by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r9UHoLaU005872;
 Wed, 30 Oct 2013 13:50:21 -0400
Received: by faina.iro.umontreal.ca (Postfix, from userid 20848)
 id F3F81B42FC; Wed, 30 Oct 2013 13:50:20 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: E Sabof <esabof@HIDDEN>
Subject: Re: bug#14604: 24.3.50.1;
 Possibly incorrect behaviour of frame-selected-window
Message-ID: <jwvfvri3b2p.fsf-monnier+emacsbugs@HIDDEN>
References: <CAEp6DyZCmQsH4CQAmiJNDUbpaKVX_RBtm=zWKP7Xarwsb8e_ig@HIDDEN>
 <jwvd2rqf5nq.fsf-monnier+emacs@HIDDEN>
 <CAEp6DyZKNPM2U37Zgy3LdkhVtypJwv6WpyObuLpmR8Zg+kgYmA@HIDDEN>
Date: Wed, 30 Oct 2013 13:50:20 -0400
In-Reply-To: <CAEp6DyZKNPM2U37Zgy3LdkhVtypJwv6WpyObuLpmR8Zg+kgYmA@HIDDEN>
 (E. Sabof's message of "Thu, 13 Jun 2013 15:59:11 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-NAI-Spam-Flag: NO
X-NAI-Spam-Threshold: 5
X-NAI-Spam-Score: 0
X-NAI-Spam-Rules: 1 Rules triggered
	RV4747=0
X-NAI-Spam-Version: 2.3.0.9362 : core <4747> : inlines <191> : streams
 <1065086> : uri <1580870>
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 14604
Cc: 14604 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.9 (-)

> (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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14604; Package emacs. Full text available.

Message received at 14604 <at> debbugs.gnu.org:


Received: (at 14604) by debbugs.gnu.org; 13 Jun 2013 16:16:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 13 12:16:17 2013
Received: from localhost ([127.0.0.1]:41735 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UnAC8-0003NK-Cp
	for submit <at> debbugs.gnu.org; Thu, 13 Jun 2013 12:16:16 -0400
Received: from mail-qe0-f43.google.com ([209.85.128.43]:59228)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <esabof@HIDDEN>) id 1UnAC2-0003Mh-QP
 for 14604 <at> debbugs.gnu.org; Thu, 13 Jun 2013 12:16:13 -0400
Received: by mail-qe0-f43.google.com with SMTP id q19so3261851qeb.16
 for <14604 <at> debbugs.gnu.org>; Thu, 13 Jun 2013 09:16:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=24e4qj09njCs+nVwPJdXDZkhvzLJzX659qAxCCJsjV8=;
 b=boXLWUZaSSb8bHIezkQEABJtzcirEwGGCGpImtWr+D0ALv+p3lX9xeGSbemT11VuAC
 2vRRMLJS8gRmVB674rn1i4d9jHwU0bD145L6y5U05kqMrUkD6hTjcWlm3IW7rtDrs1hN
 fGtjtYVf4cHGJbECyMMUfTJe92UtedlLz635nccV+CjwT+g8QIxqmdgDUhUWmom3zino
 2XAPU2ic1N911bn9WtOAHoBnqTST4mZ5U5cfSfBCK7B9Y/yTRBOMJXk2eM3Q253g5+lC
 6FyQr4SAzzfii30oU00VUCBpesRfKF3WRok72MC7WGsSGpOoWpD+RAe+g9oQJAO2jPv5
 1xJw==
MIME-Version: 1.0
X-Received: by 10.229.139.4 with SMTP id c4mr584367qcu.118.1371140165217; Thu,
 13 Jun 2013 09:16:05 -0700 (PDT)
Received: by 10.49.96.226 with HTTP; Thu, 13 Jun 2013 09:16:05 -0700 (PDT)
In-Reply-To: <83ehc6vvy8.fsf@HIDDEN>
References: <CAEp6DyZCmQsH4CQAmiJNDUbpaKVX_RBtm=zWKP7Xarwsb8e_ig@HIDDEN>
 <jwvd2rqf5nq.fsf-monnier+emacs@HIDDEN>
 <CAEp6DyZKNPM2U37Zgy3LdkhVtypJwv6WpyObuLpmR8Zg+kgYmA@HIDDEN>
 <83ehc6vvy8.fsf@HIDDEN>
Date: Thu, 13 Jun 2013 17:16:05 +0100
Message-ID: <CAEp6DybdMyUaviGAr=uhGx4vWuv+wOkVXPKVAvZTN1LxSFZyLA@HIDDEN>
Subject: Re: bug#14604: 24.3.50.1;
 Possibly incorrect behaviour of frame-selected-window
From: E Sabof <esabof@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary=e89a8f5035be7c352004df0b728a
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 14604
Cc: 14604 <at> debbugs.gnu.org, Stefan Monnier <monnier@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--e89a8f5035be7c352004df0b728a
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Jun 13, 2013 at 5:04 PM, Eli Zaretskii <eliz@HIDDEN> wrote:

> > Date: Thu, 13 Jun 2013 15:59:11 +0100
> > From: E Sabof <esabof@HIDDEN>
> > Cc: 14604 <at> debbugs.gnu.org
> >
> > (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")))
>
> Does this work with mouse-autoselect-window?
>

Yes

--e89a8f5035be7c352004df0b728a
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Thu, Jun 13, 2013 at 5:04 PM, Eli Zaretskii <span dir=
=3D"ltr">&lt;<a href=3D"mailto:eliz@HIDDEN" target=3D"_blank">eliz@HIDDEN=
</a>&gt;</span> wrote:<br><div class=3D"gmail_extra"><div class=3D"gmail_qu=
ote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-le=
ft:1px #ccc solid;padding-left:1ex">
&gt; Date: Thu, 13 Jun 2013 15:59:11 +0100<br>
&gt; From: E Sabof &lt;<a href=3D"mailto:esabof@HIDDEN">esabof@HIDDEN=
</a>&gt;<br>
&gt; Cc: <a href=3D"mailto:14604 <at> debbugs.gnu.org">14604 <at> debbugs.gnu.org</a>=
<br>
<div class=3D"im">&gt;<br>
&gt; (defvar user-selected-window nil)<br>
&gt; (defun register-user-location ()<br>
&gt; =A0 (setq user-selected-window (selected-window)))<br>
&gt; (add-hook &#39;post-command-hook &#39;register-user-location)<br>
&gt;<br>
&gt; (setq-default<br>
&gt; =A0 mode-line-format<br>
&gt; =A0 &#39;(:eval (if (eq user-selected-window (selected-window))<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 &quot;selected&quot;<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 &quot;not-selected&quot;)))<br>
<br>
</div>Does this work with mouse-autoselect-window?<br>
</blockquote></div><br></div><div class=3D"gmail_extra">Yes</div></div>

--e89a8f5035be7c352004df0b728a--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14604; Package emacs. Full text available.

Message received at 14604 <at> debbugs.gnu.org:


Received: (at 14604) by debbugs.gnu.org; 13 Jun 2013 16:04:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 13 12:04:54 2013
Received: from localhost ([127.0.0.1]:41703 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1UnA17-00030V-IB
	for submit <at> debbugs.gnu.org; Thu, 13 Jun 2013 12:04:54 -0400
Received: from mtaout20.012.net.il ([80.179.55.166]:41474)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <eliz@HIDDEN>) id 1UnA14-000304-FA
 for 14604 <at> debbugs.gnu.org; Thu, 13 Jun 2013 12:04:51 -0400
Received: from conversion-daemon.a-mtaout20.012.net.il by
 a-mtaout20.012.net.il (HyperSendmail v2007.08) id
 <0MOC00L009YPN500@HIDDEN> for 14604 <at> debbugs.gnu.org;
 Thu, 13 Jun 2013 19:04:05 +0300 (IDT)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il
 (HyperSendmail v2007.08) with ESMTPA id
 <0MOC00LLK9YTEL40@HIDDEN>;
 Thu, 13 Jun 2013 19:04:05 +0300 (IDT)
Date: Thu, 13 Jun 2013 19:04:15 +0300
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#14604: 24.3.50.1;
 Possibly incorrect behaviour of frame-selected-window
In-reply-to: <CAEp6DyZKNPM2U37Zgy3LdkhVtypJwv6WpyObuLpmR8Zg+kgYmA@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: E Sabof <esabof@HIDDEN>
Message-id: <83ehc6vvy8.fsf@HIDDEN>
References: <CAEp6DyZCmQsH4CQAmiJNDUbpaKVX_RBtm=zWKP7Xarwsb8e_ig@HIDDEN>
 <jwvd2rqf5nq.fsf-monnier+emacs@HIDDEN>
 <CAEp6DyZKNPM2U37Zgy3LdkhVtypJwv6WpyObuLpmR8Zg+kgYmA@HIDDEN>
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 14604
Cc: 14604 <at> debbugs.gnu.org, monnier@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

> Date: Thu, 13 Jun 2013 15:59:11 +0100
> From: E Sabof <esabof@HIDDEN>
> Cc: 14604 <at> debbugs.gnu.org
> 
> (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")))

Does this work with mouse-autoselect-window?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14604; Package emacs. Full text available.

Message received at 14604 <at> debbugs.gnu.org:


Received: (at 14604) by debbugs.gnu.org; 13 Jun 2013 14:59:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 13 10:59:21 2013
Received: from localhost ([127.0.0.1]:41559 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Un8zg-0000RQ-U7
	for submit <at> debbugs.gnu.org; Thu, 13 Jun 2013 10:59:21 -0400
Received: from mail-qe0-f44.google.com ([209.85.128.44]:33900)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <esabof@HIDDEN>) id 1Un8ze-0000R3-Mq
 for 14604 <at> debbugs.gnu.org; Thu, 13 Jun 2013 10:59:19 -0400
Received: by mail-qe0-f44.google.com with SMTP id 5so4177335qeb.3
 for <14604 <at> debbugs.gnu.org>; Thu, 13 Jun 2013 07:59:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=ROIxWVssMEKhf8K1AZ+wWITKUd5kqJdMlxc3BW8cktY=;
 b=HhsN8xmRWjpIsGCXOw7cC8/Ek0vYSXXoSUnKRyldokwp1Gx/BCX4scxAfeKURF9PQp
 C3WJ4Rhq2IuI2JrciQJ+vmaBMDLvvHuV4JYItDnLajNTBDcTE36a4Q2gL1sRfPMPsRhK
 yX3fKa/ypbaSKZHbF13qdnSyTPEPKF4TbB3lHBKxn1HQioakROj3h9PY8JNKLWkaIAUP
 ybbiSdnPXl+QpHjcykdCpqovOYQO0cHXN18jS/zAd7w9RBLJc1khAkQ1XcWmUFvhhjz3
 gSIEqF+OirI9dJHO3s4KC+qfXzH3D+3SF5h6vrDGQPNVwS9UEpy5BECjMB17Q1mZu4Go
 +5DQ==
MIME-Version: 1.0
X-Received: by 10.224.164.205 with SMTP id f13mr3475286qay.16.1371135551874;
 Thu, 13 Jun 2013 07:59:11 -0700 (PDT)
Received: by 10.49.96.226 with HTTP; Thu, 13 Jun 2013 07:59:11 -0700 (PDT)
In-Reply-To: <jwvd2rqf5nq.fsf-monnier+emacs@HIDDEN>
References: <CAEp6DyZCmQsH4CQAmiJNDUbpaKVX_RBtm=zWKP7Xarwsb8e_ig@HIDDEN>
 <jwvd2rqf5nq.fsf-monnier+emacs@HIDDEN>
Date: Thu, 13 Jun 2013 15:59:11 +0100
Message-ID: <CAEp6DyZKNPM2U37Zgy3LdkhVtypJwv6WpyObuLpmR8Zg+kgYmA@HIDDEN>
Subject: Re: bug#14604: 24.3.50.1;
 Possibly incorrect behaviour of frame-selected-window
From: E Sabof <esabof@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>
Content-Type: multipart/alternative; boundary=089e0158bac2822b4104df0a5fe6
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 14604
Cc: 14604 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--089e0158bac2822b4104df0a5fe6
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Jun 13, 2013 at 3:35 PM, Stefan Monnier <monnier@HIDDEN>wrote:

> > This works on 24.3, but on trunk all windows will be shown as "selected".
> > (setq-default
> >  mode-line-format
> >  '(:eval (if (eq (frame-selected-window)
> >                  (selected-window))
> >              "selected"
> >              "not-selected")))
>
> Indeed this doesn't work any more.  This was one of the very few places
> where (eq (frame-selected-window) (selected-window)) was nil, and this
> "invariant" is presumed at various places in the C code, so it was
> a bug.
>
> BTW, this worked in Emacs<24.3 if you wanted to highlight every frame's
> selected-window, but not if you wanted to highlight "the one and only
> selected-window".  For single-frame settings, there's no difference,
> of course.
>
> There is no alternative, yet.  We should probably provide some ad-hoc
> primitives (call them maybe display-selected-window and
> display-frame-selected-window) which return something like "the window
> that was selected when we entered redisplay".
>
>
>         Stefan
>

FWIW, the below seems to be working, although it still feels like an
omission.

Evgeni

(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")))

--089e0158bac2822b4104df0a5fe6
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On Thu, Jun 13, 2013 at 3:35 PM, Stefan Monnier <span dir=3D"ltr">&=
lt;<a href=3D"mailto:monnier@HIDDEN" target=3D"_blank">monnier@ir=
o.umontreal.ca</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex"><div class=3D"im">&gt; This works on 24.3, but on trunk al=
l windows will be shown as &quot;selected&quot;.<br>

&gt; (setq-default<br>
&gt; =A0mode-line-format<br>
&gt; =A0&#39;(:eval (if (eq (frame-selected-window)<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(selected-window))<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;selected&quot;<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;not-selected&quot;)))<br>
<br>
</div>Indeed this doesn&#39;t work any more. =A0This was one of the very fe=
w places<br>
where (eq (frame-selected-window) (selected-window)) was nil, and this<br>
&quot;invariant&quot; is presumed at various places in the C code, so it wa=
s<br>
a bug.<br>
<br>
BTW, this worked in Emacs&lt;24.3 if you wanted to highlight every frame&#3=
9;s<br>
selected-window, but not if you wanted to highlight &quot;the one and only<=
br>
selected-window&quot;. =A0For single-frame settings, there&#39;s no differe=
nce,<br>
of course.<br>
<br>
There is no alternative, yet. =A0We should probably provide some ad-hoc<br>
primitives (call them maybe display-selected-window and<br>
display-frame-selected-window) which return something like &quot;the window=
<br>
that was selected when we entered redisplay&quot;.<br>
<span class=3D""><font color=3D"#888888"><br>
<br>
=A0 =A0 =A0 =A0 Stefan<br></font></span></blockquote><div>=A0</div></div>FW=
IW, the below seems to be working, although it still feels like an omission=
.</div><div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra">Evge=
ni</div><div class=3D"gmail_extra">
<br></div><div class=3D"gmail_extra"><div class=3D"gmail_extra">(defvar use=
r-selected-window nil)</div><div class=3D"gmail_extra">(defun register-user=
-location ()</div><div class=3D"gmail_extra">=A0 (setq user-selected-window=
 (selected-window)))</div>
<div class=3D"gmail_extra">(add-hook &#39;post-command-hook &#39;register-u=
ser-location)</div><div class=3D"gmail_extra"><br></div><div class=3D"gmail=
_extra"><span style=3D"color:rgb(80,0,80)">(setq-default</span><br style=3D=
"color:rgb(80,0,80)">
<span style=3D"color:rgb(80,0,80)">=A0 mode-line-format</span><br style=3D"=
color:rgb(80,0,80)"><span style=3D"color:rgb(80,0,80)">=A0 &#39;(:eval (if =
(eq=A0</span>user-selected-window<span style=3D"color:rgb(80,0,80)">=A0(sel=
ected-window))</span><br style=3D"color:rgb(80,0,80)">
<span style=3D"color:rgb(80,0,80)">=A0 =A0 =A0 =A0 =A0 =A0 =A0 &quot;select=
ed&quot;</span><br style=3D"color:rgb(80,0,80)"><span style=3D"color:rgb(80=
,0,80)">=A0 =A0 =A0 =A0 =A0 =A0 =A0 &quot;not-selected&quot;)))</span><br><=
/div><div><br></div></div></div>

--089e0158bac2822b4104df0a5fe6--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14604; Package emacs. Full text available.

Message received at 14604 <at> debbugs.gnu.org:


Received: (at 14604) by debbugs.gnu.org; 13 Jun 2013 14:35:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 13 10:35:37 2013
Received: from localhost ([127.0.0.1]:41507 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Un8cj-0007mz-21
	for submit <at> debbugs.gnu.org; Thu, 13 Jun 2013 10:35:37 -0400
Received: from relais.videotron.ca ([24.201.245.36]:43746)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <monnier@HIDDEN>) id 1Un8cf-0007mn-9K
 for 14604 <at> debbugs.gnu.org; Thu, 13 Jun 2013 10:35:34 -0400
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: text/plain; CHARSET=US-ASCII
Received: from ceviche.home ([24.201.64.104]) by VL-VM-MR005.ip.videotron.ca
 (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21
 2011)) with ESMTP id <0MOC00C7X5UUIY60@HIDDEN> for
 14604 <at> debbugs.gnu.org; Thu, 13 Jun 2013 10:35:18 -0400 (EDT)
Received: by ceviche.home (Postfix, from userid 20848)	id 6182D660D7; Thu,
 13 Jun 2013 10:35:18 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: E Sabof <esabof@HIDDEN>
Subject: Re: bug#14604: 24.3.50.1; Possibly incorrect behaviour of
 frame-selected-window
Message-id: <jwvd2rqf5nq.fsf-monnier+emacs@HIDDEN>
References: <CAEp6DyZCmQsH4CQAmiJNDUbpaKVX_RBtm=zWKP7Xarwsb8e_ig@HIDDEN>
Date: Thu, 13 Jun 2013 10:35:18 -0400
In-reply-to: <CAEp6DyZCmQsH4CQAmiJNDUbpaKVX_RBtm=zWKP7Xarwsb8e_ig@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 14604
Cc: 14604 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

> This works on 24.3, but on trunk all windows will be shown as "selected".
> (setq-default
>  mode-line-format
>  '(:eval (if (eq (frame-selected-window)
>                  (selected-window))
>              "selected"
>              "not-selected")))

Indeed this doesn't work any more.  This was one of the very few places
where (eq (frame-selected-window) (selected-window)) was nil, and this
"invariant" is presumed at various places in the C code, so it was
a bug.

BTW, this worked in Emacs<24.3 if you wanted to highlight every frame's
selected-window, but not if you wanted to highlight "the one and only
selected-window".  For single-frame settings, there's no difference,
of course.

There is no alternative, yet.  We should probably provide some ad-hoc
primitives (call them maybe display-selected-window and
display-frame-selected-window) which return something like "the window
that was selected when we entered redisplay".


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14604; Package emacs. Full text available.

Message received at 14604 <at> debbugs.gnu.org:


Received: (at 14604) by debbugs.gnu.org; 13 Jun 2013 13:47:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 13 09:47:25 2013
Received: from localhost ([127.0.0.1]:41130 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Un7s4-0005c1-QU
	for submit <at> debbugs.gnu.org; Thu, 13 Jun 2013 09:47:25 -0400
Received: from mail-qa0-f44.google.com ([209.85.216.44]:32791)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <esabof@HIDDEN>) id 1Un7s1-0005bi-Rz
 for 14604 <at> debbugs.gnu.org; Thu, 13 Jun 2013 09:47:22 -0400
Received: by mail-qa0-f44.google.com with SMTP id j8so1073372qah.10
 for <14604 <at> debbugs.gnu.org>; Thu, 13 Jun 2013 06:47:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:in-reply-to:references:date:message-id:subject:from:to
 :cc:content-type;
 bh=vPQQhP5fsfGRkKONbaGraLnaVW32Jnyh//S2GhP0NBo=;
 b=G4yfNKX6s+rjykTpUGfeFzR/j1awF/9mK651rCQ1K/PvsTyKZk37IqSDckR0+RiJqP
 GBZRmPpn9RiqF0HWxsOsA1u7sqAnLgPET9/KbMOynhduZuoabNwV+M+McNu36kFUQ11h
 M2v7PGm38b9LJI50tEYHEGdPMKbaQyyNWDIp0V5wkSTGoIKs3bJHPRBVrzL9Nglm2mcA
 XE98q5HmYdiR0Ezp9Gw89sRQNVh4CQHk0MG9uQz0qHRSgHFl+i7Slu2sBy4KgipX5qWS
 YjkYu45IsET45rcqfq54nulL3oBTHrgNnbE8h8PjWh4X+E1UNQ1HKsvWHSi1LRjvLsZa
 3CHg==
MIME-Version: 1.0
X-Received: by 10.49.98.138 with SMTP id ei10mr1499825qeb.3.1371131236037;
 Thu, 13 Jun 2013 06:47:16 -0700 (PDT)
Received: by 10.49.96.226 with HTTP; Thu, 13 Jun 2013 06:47:15 -0700 (PDT)
In-Reply-To: <83ppvqw4dy.fsf@HIDDEN>
References: <CAEp6DyZCmQsH4CQAmiJNDUbpaKVX_RBtm=zWKP7Xarwsb8e_ig@HIDDEN>
 <83ppvqw4dy.fsf@HIDDEN>
Date: Thu, 13 Jun 2013 14:47:15 +0100
Message-ID: <CAEp6Dyawkf3nwHgQrXprE7qnCtimubaQO_hqPKaR=H8NuUf-JQ@HIDDEN>
Subject: Re: bug#14604: 24.3.50.1;
 Possibly incorrect behaviour of frame-selected-window
From: E Sabof <esabof@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary=047d7bdc832c43b94204df095e48
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 14604
Cc: 14604 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

--047d7bdc832c43b94204df095e48
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Jun 13, 2013 at 2:02 PM, Eli Zaretskii <eliz@HIDDEN> wrote:

> > Date: Thu, 13 Jun 2013 12:45:54 +0100
> > From: E Sabof <esabof@HIDDEN>
> >
> >
> > [1:text/plain Hide]
> >
> > This works on 24.3, but on trunk all windows will be shown as "selected".
> >
> > (setq-default
> >  mode-line-format
> >  '(:eval (if (eq (frame-selected-window)
> >                  (selected-window))
> >              "selected"
> >              "not-selected")))
> >
> > I don't know which behavior is correct, but being able to find which is
> the
> > "really" selected window would be nice.
>
> When the mode-line format is evaluated, Emacs makes its window the
> selected window.  If it didn't, how could it show values for that
> window in the mode line?
>

(frame-selected-window) used to remain bound to the window which the user
would consider selected, and only (selected-window) changed. I don't know
whether it was a bug, or intentional.

If it was a bug, I suppose I could get the desired results with command
hooks.

--047d7bdc832c43b94204df095e48
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail=
_quote">On Thu, Jun 13, 2013 at 2:02 PM, Eli Zaretskii <span dir=3D"ltr">&l=
t;<a href=3D"mailto:eliz@HIDDEN" target=3D"_blank">eliz@HIDDEN</a>&gt;</s=
pan> wrote:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;p=
adding-left:1ex">&gt; Date: Thu, 13 Jun 2013 12:45:54 +0100<br>
&gt; From: E Sabof &lt;<a href=3D"mailto:esabof@HIDDEN" target=3D"_blank=
">esabof@HIDDEN</a>&gt;<br>
&gt;<br>
&gt;<br>
&gt; [1:text/plain Hide]<br>
&gt;<br>
&gt; This works on 24.3, but on trunk all windows will be shown as &quot;se=
lected&quot;.<br>
&gt;<br>
&gt; (setq-default<br>
&gt; =A0mode-line-format<br>
&gt; =A0&#39;(:eval (if (eq (frame-selected-window)<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(selected-window))<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;selected&quot;<br>
&gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;not-selected&quot;)))<br>
&gt;<br>
&gt; I don&#39;t know which behavior is correct, but being able to find whi=
ch is the<br>
&gt; &quot;really&quot; selected window would be nice.<br>
<br>
When the mode-line format is evaluated, Emacs makes its window the<br>
selected window. =A0If it didn&#39;t, how could it show values for that<br>
window in the mode line?<br>
</blockquote></div><br></div><div class=3D"gmail_extra">(frame-selected-win=
dow) used to remain bound to the window which the user would consider selec=
ted, and only (selected-window) changed. I don&#39;t know whether it was a =
bug, or intentional.</div>
<div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra">If it was a=
 bug, I suppose I could get the desired results with command hooks.</div>
<div class=3D"gmail_extra"><br></div><div class=3D"gmail_extra"><br></div><=
/div>

--047d7bdc832c43b94204df095e48--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14604; Package emacs. Full text available.

Message received at 14604 <at> debbugs.gnu.org:


Received: (at 14604) by debbugs.gnu.org; 13 Jun 2013 13:02:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 13 09:02:09 2013
Received: from localhost ([127.0.0.1]:41047 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Un7AG-0003MZ-T9
	for submit <at> debbugs.gnu.org; Thu, 13 Jun 2013 09:02:09 -0400
Received: from mtaout22.012.net.il ([80.179.55.172]:49770)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <eliz@HIDDEN>) id 1Un7AD-0003Ln-QU
 for 14604 <at> debbugs.gnu.org; Thu, 13 Jun 2013 09:02:07 -0400
Received: from conversion-daemon.a-mtaout22.012.net.il by
 a-mtaout22.012.net.il (HyperSendmail v2007.08) id
 <0MOC006001D4SH00@HIDDEN> for 14604 <at> debbugs.gnu.org;
 Thu, 13 Jun 2013 16:01:52 +0300 (IDT)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il
 (HyperSendmail v2007.08) with ESMTPA id
 <0MOC005GM1J3WKD0@HIDDEN>;
 Thu, 13 Jun 2013 16:01:52 +0300 (IDT)
Date: Thu, 13 Jun 2013 16:02:01 +0300
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#14604: 24.3.50.1;
 Possibly incorrect behaviour of frame-selected-window
In-reply-to: <CAEp6DyZCmQsH4CQAmiJNDUbpaKVX_RBtm=zWKP7Xarwsb8e_ig@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: E Sabof <esabof@HIDDEN>
Message-id: <83ppvqw4dy.fsf@HIDDEN>
References: <CAEp6DyZCmQsH4CQAmiJNDUbpaKVX_RBtm=zWKP7Xarwsb8e_ig@HIDDEN>
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 14604
Cc: 14604 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

> Date: Thu, 13 Jun 2013 12:45:54 +0100
> From: E Sabof <esabof@HIDDEN>
> 
> 
> [1:text/plain Hide]
> 
> This works on 24.3, but on trunk all windows will be shown as "selected".
> 
> (setq-default
>  mode-line-format
>  '(:eval (if (eq (frame-selected-window)
>                  (selected-window))
>              "selected"
>              "not-selected")))
> 
> I don't know which behavior is correct, but being able to find which is the
> "really" selected window would be nice.

When the mode-line format is evaluated, Emacs makes its window the
selected window.  If it didn't, how could it show values for that
window in the mode line?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#14604; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 13 Jun 2013 11:46:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Jun 13 07:46:14 2013
Received: from localhost ([127.0.0.1]:40972 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Un5yn-0007ZA-0Y
	for submit <at> debbugs.gnu.org; Thu, 13 Jun 2013 07:46:13 -0400
Received: from eggs.gnu.org ([208.118.235.92]:56351)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <esabof@HIDDEN>) id 1Un5yk-0007Ye-6l
 for submit <at> debbugs.gnu.org; Thu, 13 Jun 2013 07:46:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <esabof@HIDDEN>) id 1Un5yc-0007gG-E3
 for submit <at> debbugs.gnu.org; Thu, 13 Jun 2013 07:46:04 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_40,FREEMAIL_FROM,
 HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:58900)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <esabof@HIDDEN>) id 1Un5yc-0007gC-B6
 for submit <at> debbugs.gnu.org; Thu, 13 Jun 2013 07:46:02 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:58042)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <esabof@HIDDEN>) id 1Un5yZ-0006p5-Ik
 for bug-gnu-emacs@HIDDEN; Thu, 13 Jun 2013 07:46:02 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <esabof@HIDDEN>) id 1Un5yW-0007eT-73
 for bug-gnu-emacs@HIDDEN; Thu, 13 Jun 2013 07:45:59 -0400
Received: from mail-qe0-f44.google.com ([209.85.128.44]:61449)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <esabof@HIDDEN>) id 1Un5yV-0007eD-8J
 for bug-gnu-emacs@HIDDEN; Thu, 13 Jun 2013 07:45:55 -0400
Received: by mail-qe0-f44.google.com with SMTP id 5so4017811qeb.3
 for <bug-gnu-emacs@HIDDEN>; Thu, 13 Jun 2013 04:45:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:date:message-id:subject:from:to:content-type;
 bh=/0QL0tiETNUpqwlnF7ipcg0Ph3dXXZWqPgfoQtAtjt4=;
 b=kSQukGmJOCwsQfmo/4t4FHq3AxTWUPwXlT2MNsDS/6fPzG/6tZ3TQ0rKOaCGFCYaVt
 1C0sO39fTEMV/ADaybwR9u0UPGNNDVJ0TRiOcaWKVx4uFyPTUtmJUdah0QWw9GC9J6Eo
 ms7cBeRrZGfkZDr7i0lhDjDh1UWFgeLsRt8HIbYYAHIVV+MjEW9xyWizHcC2/cOy36zb
 jm/22F6Qloqa4QGJqVStuna7f9QbvvqnwsvA+qmm9uj3Og4jh0yxMQKEhaYu2wfOT9Xt
 xYtnJg/GpMyc+uSwtBJ1yo1Bfqv6T+9DKvMT1J04KRi+sF81IYPILLZJAHu5WW6PRum2
 Stxg==
MIME-Version: 1.0
X-Received: by 10.224.34.198 with SMTP id m6mr2574317qad.39.1371123954451;
 Thu, 13 Jun 2013 04:45:54 -0700 (PDT)
Received: by 10.49.96.226 with HTTP; Thu, 13 Jun 2013 04:45:54 -0700 (PDT)
Date: Thu, 13 Jun 2013 12:45:54 +0100
Message-ID: <CAEp6DyZCmQsH4CQAmiJNDUbpaKVX_RBtm=zWKP7Xarwsb8e_ig@HIDDEN>
Subject: 24.3.50.1; Possibly incorrect behaviour of frame-selected-window
From: E Sabof <esabof@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/alternative; boundary=20cf3074b7b03fa63d04df07acf1
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
 [fuzzy]
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -4.3 (----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -4.3 (----)

--20cf3074b7b03fa63d04df07acf1
Content-Type: text/plain; charset=ISO-8859-1

This works on 24.3, but on trunk all windows will be shown as "selected".

(setq-default
 mode-line-format
 '(:eval (if (eq (frame-selected-window)
                 (selected-window))
             "selected"
             "not-selected")))

I don't know which behavior is correct, but being able to find which is the
"really" selected window would be nice.

--20cf3074b7b03fa63d04df07acf1
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>This works on=A0<span style=3D"background-color:rgb(2=
49,249,249);color:rgb(37,37,37);font-family:&#39;Helvetica Neue&#39;,Helvet=
ica,Arial,sans-serif;font-size:14.666666984558105px;line-height:19.19791603=
088379px;text-align:center">24.3</span>, but on trunk all windows will be s=
hown as &quot;selected&quot;.</div>
<div><br></div><div>(setq-default=A0</div><div>=A0mode-line-format</div><di=
v>=A0&#39;(:eval (if (eq (frame-selected-window)</div><div>=A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0(selected-window))</div><div>=A0 =A0 =A0 =A0 =A0 =A0 =A0=
&quot;selected&quot;</div><div>=A0 =A0 =A0 =A0 =A0 =A0 =A0&quot;not-selecte=
d&quot;)))</div>
<div><br></div><div>I don&#39;t know which behavior is correct, but being a=
ble to find which is the &quot;really&quot; selected window would be nice.<=
/div></div>

--20cf3074b7b03fa63d04df07acf1--




Acknowledgement sent to E Sabof <esabof@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#14604; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.