GNU bug report logs - #16761
24.3.50; focus-in-hook not running accurately when frame switches to terminal

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: Steven Edwards <cureadvocate@HIDDEN>; Done: Lars Ingebrigtsen <larsi@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
bug closed, send any further explanations to 16761 <at> debbugs.gnu.org and Steven Edwards <cureadvocate@HIDDEN> Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

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


Received: (at 16761) by debbugs.gnu.org; 4 Dec 2021 03:28:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 03 22:28:11 2021
Received: from localhost ([127.0.0.1]:52603 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mtLid-0002Qs-AH
	for submit <at> debbugs.gnu.org; Fri, 03 Dec 2021 22:28:11 -0500
Received: from quimby.gnus.org ([95.216.78.240]:59498)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mtLia-0002Qd-AC
 for 16761 <at> debbugs.gnu.org; Fri, 03 Dec 2021 22:28:10 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=aM4RqhCK7jojBU02/AgCZdgj5Zf6IouwfJ3iA7+TPVc=; b=Jy9mb53cDkYUQU6l6k0Aag2tjJ
 rs0az4eZYDMouK5txZ5tudhNDW17LsXHD7t+MACqUXIDDuA7pH8QNOdQTrdqLSos9/E+Hwgnh0Zb+
 JKE6kFqxSTSE4cFmO4ntGNsYYdrWAOJAM+4botJzqFqsQCj5ko26tWAKIOn2YzcRQq7w=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mtLiR-0001nT-At; Sat, 04 Dec 2021 04:28:01 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Steven Edwards <cureadvocate@HIDDEN>
Subject: Re: bug#16761: 24.3.50; focus-in-hook not running accurately when
 frame switches to terminal
References: <CAA3vWKCdxPjNYgYhQg7wV6-8a5ukh91UMKKThyoML9NOE_89Xw@HIDDEN>
X-Now-Playing: Genesis's _Trespass_: "The Knife"
Date: Sat, 04 Dec 2021 04:27:56 +0100
In-Reply-To: <CAA3vWKCdxPjNYgYhQg7wV6-8a5ukh91UMKKThyoML9NOE_89Xw@HIDDEN>
 (Steven Edwards's message of "Sat, 15 Feb 2014 07:14:22 -0500")
Message-ID: <87a6hhrqv7.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Steven Edwards <cureadvocate@HIDDEN> writes: > ...but when
 cycling from a graphical frame to a terminal frame, nothing new > appears
 in *Messages*--until you switch to a graphical frame: (I'm going through
 old bug reports that unfortunately weren't resolved at the time.) 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 16761
Cc: 16761 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://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: <https://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: -3.3 (---)

Steven Edwards <cureadvocate@HIDDEN> writes:

> ...but when cycling from a graphical frame to a terminal frame, nothing new
> appears in *Messages*--until you switch to a graphical frame:

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

focus-in-hook was made obsolete in Emacs 27.1, and
`after-focus-change-function' should be used instead.  And using that, I
see that the change function is called reliably when changing to a
terminal frame, so I think this has been fixed now, and I'm closing this
bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




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

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


Received: (at 16761) by debbugs.gnu.org; 15 Feb 2014 20:39:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 15 15:39:22 2014
Received: from localhost ([127.0.0.1]:53799 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1WEm1C-0003t6-0m
	for submit <at> debbugs.gnu.org; Sat, 15 Feb 2014 15:39:22 -0500
Received: from mtaout21.012.net.il ([80.179.55.169]:56918)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <eliz@HIDDEN>) id 1WEm19-0003sn-7J
 for 16761 <at> debbugs.gnu.org; Sat, 15 Feb 2014 15:39:20 -0500
Received: from conversion-daemon.a-mtaout21.012.net.il by
 a-mtaout21.012.net.il (HyperSendmail v2007.08) id
 <0N1200M001339700@HIDDEN> for 16761 <at> debbugs.gnu.org;
 Sat, 15 Feb 2014 22:39:12 +0200 (IST)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il
 (HyperSendmail v2007.08) with ESMTPA id
 <0N1200MGY1DC3B40@HIDDEN>;
 Sat, 15 Feb 2014 22:39:12 +0200 (IST)
Date: Sat, 15 Feb 2014 22:39:12 +0200
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#16761: 24.3.50;
 focus-in-hook not running accurately when frame switches to terminal
In-reply-to: <CAA3vWKC9se0Gbj8fNjC=mztsw7ToxeY7xOrgotdWp_3sGBSPkA@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Steven Edwards <cureadvocate@HIDDEN>
Message-id: <837g8waz67.fsf@HIDDEN>
References: <CAA3vWKCdxPjNYgYhQg7wV6-8a5ukh91UMKKThyoML9NOE_89Xw@HIDDEN>
 <83eh34bg7v.fsf@HIDDEN>
 <CAA3vWKCzs2SouzbePDBPFRD6gOxQdTgY1P0ftxdT2aWOke-5tg@HIDDEN>
 <838utcb8n0.fsf@HIDDEN>
 <CAA3vWKC9se0Gbj8fNjC=mztsw7ToxeY7xOrgotdWp_3sGBSPkA@HIDDEN>
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 16761
Cc: jan.h.d@HIDDEN, 16761 <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: Sat, 15 Feb 2014 12:23:56 -0500
> From: Steven Edwards <cureadvocate@HIDDEN>
> Cc: 16761 <at> debbugs.gnu.org, jan.h.d@HIDDEN
> 
> On 2/15/14, Eli Zaretskii <eliz@HIDDEN> wrote:
> > How can Emacs get a focus-in event for the terminal frame, when the
> > event is sent by X?  Jan, is this possible with X?
> 
> Interesting.  I wasn't aware those events were sent by X.
> 
> Out of curiosity, then, how does Emacs produce the message indicating
> a terminal frame after I return to an X frame?  It seems like it's
> blocking somewhere.

I think the event is generated by X when you switch to a GUI frame,
and the terminal frame is just indicated as the previous one (since
Emacs does know about its terminal frames).  But I may be mistaken, so
I prefer to hear from Jan on this.




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

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


Received: (at 16761) by debbugs.gnu.org; 15 Feb 2014 17:24:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 15 12:24:06 2014
Received: from localhost ([127.0.0.1]:53670 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1WEiyD-0006uq-6b
	for submit <at> debbugs.gnu.org; Sat, 15 Feb 2014 12:24:05 -0500
Received: from mail-la0-f53.google.com ([209.85.215.53]:62137)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <cureadvocate@HIDDEN>) id 1WEiyA-0006u5-9L
 for 16761 <at> debbugs.gnu.org; Sat, 15 Feb 2014 12:24:02 -0500
Received: by mail-la0-f53.google.com with SMTP id e16so10021536lan.40
 for <16761 <at> debbugs.gnu.org>; Sat, 15 Feb 2014 09:23:56 -0800 (PST)
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=MnuNoO83sOaf21TjhC4DcJYvh0hDUtNHovC+/n76SEY=;
 b=yrqpnHEQ9hKze2vebH7yUZ99RdUB+VswzQi5tQgD8xwMRAOXdW5qQ9Jc/UO/WU8x4+
 91U4Zlgq0z3+Qg7ExAMlw4au1L7LtvdfYxjwgR4vm534GIHpAYWGt+MmZTNSKL1fPYYo
 Wjm+ycYcwUDA1UHrFPyjjBRn58Ja0J8rRxuLVhk5PXea8IREI1hxyBnqjYh4SnxOvh6o
 EajrftFm47Ox8KaP1Q1nvO2yz0qlv8Ja+2QJ7GPkKwXdEAZvvVm59+nDXDWsuUS6q1Q8
 CmNJJNPq2AiCcfj9N0+mayTtL1T3cbZ2umzSsuJng4bBV+d5jvfU1vQ9d253X2GOwLEs
 TMbg==
MIME-Version: 1.0
X-Received: by 10.152.8.47 with SMTP id o15mr10548819laa.20.1392485036123;
 Sat, 15 Feb 2014 09:23:56 -0800 (PST)
Received: by 10.112.142.233 with HTTP; Sat, 15 Feb 2014 09:23:56 -0800 (PST)
In-Reply-To: <838utcb8n0.fsf@HIDDEN>
References: <CAA3vWKCdxPjNYgYhQg7wV6-8a5ukh91UMKKThyoML9NOE_89Xw@HIDDEN>
 <83eh34bg7v.fsf@HIDDEN>
 <CAA3vWKCzs2SouzbePDBPFRD6gOxQdTgY1P0ftxdT2aWOke-5tg@HIDDEN>
 <838utcb8n0.fsf@HIDDEN>
Date: Sat, 15 Feb 2014 12:23:56 -0500
Message-ID: <CAA3vWKC9se0Gbj8fNjC=mztsw7ToxeY7xOrgotdWp_3sGBSPkA@HIDDEN>
Subject: Re: bug#16761: 24.3.50; focus-in-hook not running accurately when
 frame switches to terminal
From: Steven Edwards <cureadvocate@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 16761
Cc: jan.h.d@HIDDEN, 16761 <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 (/)

On 2/15/14, Eli Zaretskii <eliz@HIDDEN> wrote:
> How can Emacs get a focus-in event for the terminal frame, when the
> event is sent by X?  Jan, is this possible with X?

Interesting.  I wasn't aware those events were sent by X.

Out of curiosity, then, how does Emacs produce the message indicating
a terminal frame after I return to an X frame?  It seems like it's
blocking somewhere.




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

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


Received: (at 16761) by debbugs.gnu.org; 15 Feb 2014 17:14:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 15 12:14:52 2014
Received: from localhost ([127.0.0.1]:53657 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1WEipI-0006f0-IE
	for submit <at> debbugs.gnu.org; Sat, 15 Feb 2014 12:14:52 -0500
Received: from mtaout28.012.net.il ([80.179.55.184]:45618)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <eliz@HIDDEN>) id 1WEipG-0006eh-6Q
 for 16761 <at> debbugs.gnu.org; Sat, 15 Feb 2014 12:14:51 -0500
Received: from conversion-daemon.mtaout28.012.net.il by mtaout28.012.net.il
 (HyperSendmail v2007.08) id <0N1100O00RHDMK00@HIDDEN> for
 16761 <at> debbugs.gnu.org; Sat, 15 Feb 2014 19:15:34 +0200 (IST)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout28.012.net.il
 (HyperSendmail v2007.08) with ESMTPA id
 <0N1100KZDRXYW460@HIDDEN>; Sat, 15 Feb 2014 19:15:34 +0200 (IST)
Date: Sat, 15 Feb 2014 19:14:43 +0200
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#16761: 24.3.50;
 focus-in-hook not running accurately when frame switches to terminal
In-reply-to: <CAA3vWKCzs2SouzbePDBPFRD6gOxQdTgY1P0ftxdT2aWOke-5tg@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Steven Edwards <cureadvocate@HIDDEN>
Message-id: <838utcb8n0.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=iso-8859-1
Content-transfer-encoding: 8BIT
References: <CAA3vWKCdxPjNYgYhQg7wV6-8a5ukh91UMKKThyoML9NOE_89Xw@HIDDEN>
 <83eh34bg7v.fsf@HIDDEN>
 <CAA3vWKCzs2SouzbePDBPFRD6gOxQdTgY1P0ftxdT2aWOke-5tg@HIDDEN>
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 16761
Cc: jan.h.d@HIDDEN, 16761 <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: Sat, 15 Feb 2014 12:04:52 -0500
> From: Steven Edwards <cureadvocate@HIDDEN>
> Cc: 16761 <at> debbugs.gnu.org, Jan Djärv <jan.h.d@HIDDEN>
> 
> > You don't say what you expect to happen.  Do you expect a focus-in and
> > focus-out event to be generated for terminal frames?  Or do you expect
> > (or need) something else?
> 
> I need a focus-in event to occur when switching to a terminal frame;

How can Emacs get a focus-in event for the terminal frame, when the
event is sent by X?  Jan, is this possible with X?




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

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


Received: (at 16761) by debbugs.gnu.org; 15 Feb 2014 17:05:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 15 12:05:03 2014
Received: from localhost ([127.0.0.1]:53651 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1WEifm-0006OZ-D6
	for submit <at> debbugs.gnu.org; Sat, 15 Feb 2014 12:05:02 -0500
Received: from mail-lb0-f182.google.com ([209.85.217.182]:46434)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <cureadvocate@HIDDEN>) id 1WEifi-0006O1-W9
 for 16761 <at> debbugs.gnu.org; Sat, 15 Feb 2014 12:04:59 -0500
Received: by mail-lb0-f182.google.com with SMTP id w7so10412997lbi.27
 for <16761 <at> debbugs.gnu.org>; Sat, 15 Feb 2014 09:04:52 -0800 (PST)
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=eYztQIJvU9+H2k6S5aUAHpvx7i11HWPkfwSHaZL3Zh0=;
 b=gysQo2PgEsQ2jlM06Ke7Z8DSIEimKJXTH6ETuci+iML5rpMf0Bk2RXdX1dREBJhdg9
 2L3f88+zZJOFkx6ea2RGtZnyWHJsokr6g7GCw/GEmL0riX2mAvWENjfinudTKOdJjR8j
 e42O64M7baJ6syi6ZcNJGBhE6F66ZT8mKJWHPllj89+M0mndKvL31yi4MFVY5uRPHWIS
 KAsPz79CV9DD/Csw790WJeyD9EVPoisKfqIMk06yuSQMkHd6CHmwJM6GXRPbxtTnP675
 ZDBoTdfBCcdsw/5oJIKXlrhUcRZkNDhnK0h2rTxwOWkN9+56cBEezBgazbYjG03I4vAu
 3d/w==
MIME-Version: 1.0
X-Received: by 10.112.170.234 with SMTP id ap10mr9807287lbc.23.1392483892734; 
 Sat, 15 Feb 2014 09:04:52 -0800 (PST)
Received: by 10.112.142.233 with HTTP; Sat, 15 Feb 2014 09:04:52 -0800 (PST)
In-Reply-To: <83eh34bg7v.fsf@HIDDEN>
References: <CAA3vWKCdxPjNYgYhQg7wV6-8a5ukh91UMKKThyoML9NOE_89Xw@HIDDEN>
 <83eh34bg7v.fsf@HIDDEN>
Date: Sat, 15 Feb 2014 12:04:52 -0500
Message-ID: <CAA3vWKCzs2SouzbePDBPFRD6gOxQdTgY1P0ftxdT2aWOke-5tg@HIDDEN>
Subject: Re: bug#16761: 24.3.50; focus-in-hook not running accurately when
 frame switches to terminal
From: Steven Edwards <cureadvocate@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-1
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 16761
Cc: =?ISO-8859-1?Q?Jan_Dj=E4rv?= <jan.h.d@HIDDEN>, 16761 <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 (/)

> You don't say what you expect to happen.  Do you expect a focus-in and
> focus-out event to be generated for terminal frames?  Or do you expect
> (or need) something else?

I need a focus-in event to occur when switching to a terminal frame;
the code I provided was simply to demonstrate and focus on the error.

The real code:

---
(defun rand/swap-theme (from to)
  (disable-theme from)
  (enable-theme to))

(defun rand/choose-theme ()
  (cond
    ((memq window-system '(x w32 ns)) (rand/swap-theme 'Custom 'assemblage))
    (t (rand/swap-theme 'assemblage 'Custom))))

(add-hook 'focus-in-hook 'rand/choose-theme)
---

The goal is to switch to a terminal-friendly theme when I'm in tmux
and a GUI friendly theme when I'm in a graphical environment.  The
problem seems to be that the hooks in focus-in-hooks aren't being
executed when I switch to a terminal frame.

Best,

Steven




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

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


Received: (at 16761) by debbugs.gnu.org; 15 Feb 2014 14:31:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 15 09:31:14 2014
Received: from localhost ([127.0.0.1]:53055 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1WEgGu-00024O-WE
	for submit <at> debbugs.gnu.org; Sat, 15 Feb 2014 09:31:13 -0500
Received: from mtaout26.012.net.il ([80.179.55.182]:53649)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <eliz@HIDDEN>) id 1WEgGp-00023l-CZ
 for 16761 <at> debbugs.gnu.org; Sat, 15 Feb 2014 09:31:09 -0500
Received: from conversion-daemon.mtaout26.012.net.il by mtaout26.012.net.il
 (HyperSendmail v2007.08) id <0N1100E00JYTC200@HIDDEN> for
 16761 <at> debbugs.gnu.org; Sat, 15 Feb 2014 16:29:29 +0200 (IST)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout26.012.net.il
 (HyperSendmail v2007.08) with ESMTPA id
 <0N11007NBK95QI90@HIDDEN>; Sat, 15 Feb 2014 16:29:29 +0200 (IST)
Date: Sat, 15 Feb 2014 16:31:00 +0200
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#16761: 24.3.50;
 focus-in-hook not running accurately when frame switches to terminal
In-reply-to: <CAA3vWKCdxPjNYgYhQg7wV6-8a5ukh91UMKKThyoML9NOE_89Xw@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Steven Edwards <cureadvocate@HIDDEN>
Message-id: <83eh34bg7v.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=iso-8859-1
Content-transfer-encoding: 8bit
References: <CAA3vWKCdxPjNYgYhQg7wV6-8a5ukh91UMKKThyoML9NOE_89Xw@HIDDEN>
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 16761
Cc: Jan =?iso-8859-1?Q?Dj=E4rv?= <jan.h.d@HIDDEN>, 16761 <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: Sat, 15 Feb 2014 07:14:22 -0500
> From: Steven Edwards <cureadvocate@HIDDEN>
> 
> Starting from emacs -Q:
> 
> ---
> (server-start)
> (defun rand/on-focus ()
>   (message (concat (prin1-to-string window-system) (prin1-to-string
>   (selected-frame)) (format-time-string "%H:%M:%S.%N"))))
> (add-hook 'focus-in-hook 'rand/on-focus)
> ---
> 
> Open another graphical frame with C-x 5 2; switch it to *Messages* buffer.
> 
> Next open a non-graphical frame with emacsclient -nw.
> 
> You should now have three frames open.
> 
> Switch frames from one to the next.  (I'm using the awesome window
> manager, so Super-J.)
> 
> You'll notice that when switching from one graphical frame to the next,
> two messages appear, e.g.:
> 
> ---
> x#<frame *unsent mail to bug-gnu-emacs@HIDDEN* 0xe88e40>06:40:47.325463985
> x#<frame *Messages* 0x1123978>06:40:47.384926969
> ---
> 
> ...but when cycling from a graphical frame to a terminal frame, nothing new
> appears in *Messages*--until you switch to a graphical frame:
> 
> ---
> x#<frame *Messages* 0x1123978>06:44:37.889809270
> x#<frame *Messages* 0x1123978>06:44:37.922339020
> x#<frame *unsent mail to bug-gnu-emacs@HIDDEN* 0xe88e40>06:44:37.922801690
> ---
> 
> If you perform any actions on the terminal frame after switching switch
> from a graphical frame, *Messages* will receive one message--as if
> focus-in-hooks are being called from focus-out-hooks:
> 
> ---
> x#<frame emacs@HIDDEN 0x352e880>06:56:51.097246751
> ---
> 
> Switching to a raphical frame after performing an action on the terminal
> frame will finally send a message containing the terminal frame object,
> but only after it loses focus:
> 
> ---
> nil#<frame F2 0x11e90c8>06:56:53.533491550
> x#<frame emacs@HIDDEN 0x352e880>06:56:53.533998714
> ---
> 
> Possibly related, C-x 5 o skips over any terminal frames and C-x 5 1
> won't delete terminal frames.

You don't say what you expect to happen.  Do you expect a focus-in and
focus-out event to be generated for terminal frames?  Or do you expect
(or need) something else?




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

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


Received: (at submit) by debbugs.gnu.org; 15 Feb 2014 12:14:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Feb 15 07:14:37 2014
Received: from localhost ([127.0.0.1]:52993 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1WEe8i-0005OW-RF
	for submit <at> debbugs.gnu.org; Sat, 15 Feb 2014 07:14:37 -0500
Received: from eggs.gnu.org ([208.118.235.92]:45488)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <cureadvocate@HIDDEN>) id 1WEe8g-0005OH-FX
 for submit <at> debbugs.gnu.org; Sat, 15 Feb 2014 07:14:35 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <cureadvocate@HIDDEN>) id 1WEe8a-0005e9-16
 for submit <at> debbugs.gnu.org; Sat, 15 Feb 2014 07:14:29 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM,
 T_DKIM_INVALID autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:39515)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <cureadvocate@HIDDEN>) id 1WEe8Z-0005e5-UW
 for submit <at> debbugs.gnu.org; Sat, 15 Feb 2014 07:14:27 -0500
Received: from eggs.gnu.org ([2001:4830:134:3::10]:47209)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <cureadvocate@HIDDEN>) id 1WEe8Y-0001HK-Gg
 for bug-gnu-emacs@HIDDEN; Sat, 15 Feb 2014 07:14:27 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <cureadvocate@HIDDEN>) id 1WEe8X-0005dd-3y
 for bug-gnu-emacs@HIDDEN; Sat, 15 Feb 2014 07:14:26 -0500
Received: from mail-la0-x235.google.com ([2a00:1450:4010:c03::235]:56788)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <cureadvocate@HIDDEN>) id 1WEe8W-0005dS-Oe
 for bug-gnu-emacs@HIDDEN; Sat, 15 Feb 2014 07:14:25 -0500
Received: by mail-la0-f53.google.com with SMTP id e16so9866106lan.26
 for <bug-gnu-emacs@HIDDEN>; Sat, 15 Feb 2014 04:14:22 -0800 (PST)
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=JfhwzgT6ybS7yMdvIaQUtcpSMZ5+Vl6kJbQpjqL7YCY=;
 b=ighRGSH1KG0YW0i/7ZT2Ve+p8FuJZgZWw05jgQYjK6R0k5Fp9YuuNs1N7dFgMNnnZ4
 6/Z8Of9pe3YWUvriqGj+hqirax5C2ILybTfei0jL1Nn8DRpFhpUEeQM+h38yFnCDdNqL
 KH0p9fQIarVUAyPycjwIx+zAJN5qGeZ6Z19PQArR7VgxfYnrIRpUTp6sLQ1O6JBtfEBY
 HukXBBa74Ay1R03sSgRiqNlWFsitc3EE+QdzJ+spW2qeWsv4X5HnAzWtfmkp2bmdKtFB
 4uGErCxaMeOKQ5eZxp4q30oPQNEwgMrzvZkH/fgcAQFRj8uYLuoXVJuwOrptwm1wrQMZ
 7VaA==
MIME-Version: 1.0
X-Received: by 10.112.164.5 with SMTP id ym5mr1125397lbb.48.1392466462748;
 Sat, 15 Feb 2014 04:14:22 -0800 (PST)
Received: by 10.112.142.233 with HTTP; Sat, 15 Feb 2014 04:14:22 -0800 (PST)
Date: Sat, 15 Feb 2014 07:14:22 -0500
Message-ID: <CAA3vWKCdxPjNYgYhQg7wV6-8a5ukh91UMKKThyoML9NOE_89Xw@HIDDEN>
Subject: 24.3.50;
 focus-in-hook not running accurately when frame switches to terminal
From: Steven Edwards <cureadvocate@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
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.0 (----)
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.0 (----)

Starting from emacs -Q:

---
(server-start)
(defun rand/on-focus ()
  (message (concat (prin1-to-string window-system) (prin1-to-string
  (selected-frame)) (format-time-string "%H:%M:%S.%N"))))
(add-hook 'focus-in-hook 'rand/on-focus)
---

Open another graphical frame with C-x 5 2; switch it to *Messages* buffer.

Next open a non-graphical frame with emacsclient -nw.

You should now have three frames open.

Switch frames from one to the next.  (I'm using the awesome window
manager, so Super-J.)

You'll notice that when switching from one graphical frame to the next,
two messages appear, e.g.:

---
x#<frame *unsent mail to bug-gnu-emacs@HIDDEN* 0xe88e40>06:40:47.325463985
x#<frame *Messages* 0x1123978>06:40:47.384926969
---

...but when cycling from a graphical frame to a terminal frame, nothing new
appears in *Messages*--until you switch to a graphical frame:

---
x#<frame *Messages* 0x1123978>06:44:37.889809270
x#<frame *Messages* 0x1123978>06:44:37.922339020
x#<frame *unsent mail to bug-gnu-emacs@HIDDEN* 0xe88e40>06:44:37.922801690
---

If you perform any actions on the terminal frame after switching switch
from a graphical frame, *Messages* will receive one message--as if
focus-in-hooks are being called from focus-out-hooks:

---
x#<frame emacs@HIDDEN 0x352e880>06:56:51.097246751
---

Switching to a raphical frame after performing an action on the terminal
frame will finally send a message containing the terminal frame object,
but only after it loses focus:

---
nil#<frame F2 0x11e90c8>06:56:53.533491550
x#<frame emacs@HIDDEN 0x352e880>06:56:53.533998714
---

Possibly related, C-x 5 o skips over any terminal frames and C-x 5 1
won't delete terminal frames.

The use case for this is that I'd like to use different themes for X
frames and terminal frames.

I know the use of window-system is deprecated; (framep (selected-frame))
does not work either.

I hope this report helps.

Best,

Steven




In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.20.1)
 of 2014-01-25 on Rand
Windowing system distributor `The X.Org Foundation', version 11.0.11004000
System Description:	Debian GNU/Linux 6.0.8 (squeeze)

Important settings:
  value of $LC_CTYPE: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-x C-f . e m a c s <return> C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-b C-x
C-e C-x b C-g C-x C-f . e m a c s . d / l i TAB c u
s TAB g l TAB <return> C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-b C-x C-e C-n C-n C-n C-n
C-n C-n C-a C-b C-x C-e C-x 5 2 <switch-frame> M-x
i d o - m o d e <return> <switch-frame> C-x b m e <return>
<switch-frame> <switch-frame> <switch-frame> <switch-frame>
ESC [ > 1 ; 2 4 0 3 ; 0 c <switch-frame> <switch-frame>
<switch-frame> <switch-frame> <switch-frame> <switch-frame>
M-x r e p o r t - e m SPC SPC <return>

Recent messages:
x#<frame custom-global.el 0xe88e40>06:28:40.401223846
x#<frame *Messages* 0x1123978>06:28:40.435829590
x#<frame *Messages* 0x1123978>06:28:58.428023215
x#<frame *Messages* 0x1123978>06:28:58.482460360
x#<frame custom-global.el 0xe88e40>06:28:58.482890190
x#<frame custom-global.el 0xe88e40>06:29:07.640302435
x#<frame *Messages* 0x1123978>06:29:07.675357806
x#<frame *Messages* 0x1123978>06:29:20.079938338
x#<frame *Messages* 0x1123978>06:29:20.136675311
x#<frame custom-global.el 0xe88e40>06:29:20.137121846

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util help-fns mail-prsvr mail-utils xterm ido server time-date
tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list
newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer
select scroll-bar mouse jit-lock font-lock syntax facemenu font-core
frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp
files text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind gfilenotify dynamic-setting font-render-setting move-toolbar
gtk x-toolkit x multi-tty emacs)




Acknowledgement sent to Steven Edwards <cureadvocate@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#16761; 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: Sat, 4 Dec 2021 03:30:02 UTC

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