From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Detect window switches? Date: Fri, 27 Sep 2013 08:57:22 +0300 Message-ID: <83ioxmg62l.fsf@gnu.org> References: NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1380261474 23890 80.91.229.3 (27 Sep 2013 05:57:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Sep 2013 05:57:54 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 27 07:57:57 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VPR3r-0005Cb-Ao for geh-help-gnu-emacs@m.gmane.org; Fri, 27 Sep 2013 07:57:55 +0200 Original-Received: from localhost ([::1]:33223 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPR3r-00064C-1l for geh-help-gnu-emacs@m.gmane.org; Fri, 27 Sep 2013 01:57:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPR3b-00063Z-LR for help-gnu-emacs@gnu.org; Fri, 27 Sep 2013 01:57:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VPR3V-0005D4-Qi for help-gnu-emacs@gnu.org; Fri, 27 Sep 2013 01:57:39 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:50461) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPR3V-0005Cv-IU for help-gnu-emacs@gnu.org; Fri, 27 Sep 2013 01:57:33 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MTR00900SHM7Q00@a-mtaout22.012.net.il> for help-gnu-emacs@gnu.org; Fri, 27 Sep 2013 08:57:31 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MTR008IUSJVQG60@a-mtaout22.012.net.il> for help-gnu-emacs@gnu.org; Fri, 27 Sep 2013 08:57:31 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.172 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:93652 Archived-At: > From: Dan Espen > Date: Thu, 26 Sep 2013 16:15:52 -0400 > > Eli Zaretskii writes: > > >> From: Dan Espen > >> Date: Thu, 26 Sep 2013 15:22:58 -0400 > >> > >> Eli Zaretskii writes: > >> > >> >> From: Dan Espen > >> >> Date: Thu, 26 Sep 2013 14:22:15 -0400 > >> >> > >> >> My mode line changes color when a buffer changes from active/inactive. > >> >> Isn't that what the OP is looking for? > >> > > >> > That's done on the C level, and Lisp programs cannot hook into this. > >> > >> Hmm, starting to sound like a bug. > >> Here's an event that Emacs acts on but doesn't make the > >> event visible to ELisp. > > > > No, Emacs doesn't act on this as an event. What happens is that the > > next redisplay after a window switch redraws the mode line in a > > different face. The redisplay isn't triggered by an event (because > > there is no such event), it is triggered by other means, mostly > > because Emacs becomes idle. That could happen many seconds after the > > switch, if Emacs becomes busy calculating something, for example. > > I only meant event with the meaning that something happens. But that's just it: nothing happened, as far as Emacs is concerned. As part of routine redisplay, Emacs displays the mode line of the selected window differently than it does with other windows. It doesn't track whether a particular window was selected earlier and became non-selected now, so it doesn't know that "something's happened". It just reflects the current state of affairs on the screen. > Here Emacs sees a buffer become active or inactive No, it doesn't know a buffer _became_ active, it just _finds_ it to be current or not current. > Well, it also changes the physical appearance of the keyboard cursor. > Mine goes from 3 pixels wide to 1. More of the same.