From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Espen Newsgroups: gmane.emacs.help Subject: Re: Detect window switches? Date: Thu, 26 Sep 2013 14:22:15 -0400 Organization: A noiseless patient Spider Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1380219915 1038 80.91.229.3 (26 Sep 2013 18:25:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Sep 2013 18:25:15 +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 20:25:19 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 1VPGFa-0001iZ-Gk for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Sep 2013 20:25:18 +0200 Original-Received: from localhost ([::1]:59345 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VPGFZ-0005R6-Px for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Sep 2013 14:25:17 -0400 Original-Path: usenet.stanford.edu!news.glorb.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 18 Injection-Info: mx05.eternal-september.org; posting-host="5d070289bfddab8debea427f21ca33d2"; logging-data="16614"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18LRD8KTofazWBtQx7CjVOi58Bjkn1AwSc=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) Cancel-Lock: sha1:1sq7aL3Aix366JitTEM2kJHFQzc= sha1:VIBa+/20pU/S3fNs5yfgeAC1adA= Original-Xref: usenet.stanford.edu gnu.emacs.help:201361 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:93630 Archived-At: Eli Zaretskii writes: >> 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. My mode line changes color when a buffer changes from active/inactive. Isn't that what the OP is looking for? -- Dan Espen