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: Thu, 26 Sep 2013 20:49:32 +0300 Message-ID: <83r4cbfp77.fsf@gnu.org> References: "slrnl46lft.31s.joostkremers@j.kremers4.news.arnhem.chello.nl" NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1380217814 5639 80.91.229.3 (26 Sep 2013 17:50:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Sep 2013 17:50:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 26 19:50:18 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 1VPFhh-0007gT-V4 for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Sep 2013 19:50:18 +0200 Original-Received: from localhost ([::1]:59208 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPFhh-0001Ab-Jq for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Sep 2013 13:50:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41866) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPFhR-00015t-Ic for help-gnu-emacs@gnu.org; Thu, 26 Sep 2013 13:50:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VPFhK-00086S-7a for help-gnu-emacs@gnu.org; Thu, 26 Sep 2013 13:50:01 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:37426) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPFhJ-00084E-Ug for help-gnu-emacs@gnu.org; Thu, 26 Sep 2013 13:49:54 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0MTQ00B00UT9LT00@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Thu, 26 Sep 2013 20:49:43 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MTQ00BJ7UUUFW50@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Thu, 26 Sep 2013 20:49:42 +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.166 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:93627 Archived-At: > From: Joost Kremers > Date: 26 Sep 2013 16:54:34 GMT > > What I'd like to know is if it's possible to detect when a window > goes from being selected to being not selected and vice versa. Or, > alternatively, when a buffer goes from being current to not current > and vice versa. There's always post-command-hook, where you can test whether the current-buffer is one of yours, and act accordingly.