From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: Is there a hook when current window or buffer changes? Date: Tue, 02 Apr 2013 23:32:06 +0200 Message-ID: <87bo9w8vqh.fsf@web.de> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1364938350 23567 80.91.229.3 (2 Apr 2013 21:32:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Apr 2013 21:32:30 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 02 23:32: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 1UN8p7-0005Kw-Jh for geh-help-gnu-emacs@m.gmane.org; Tue, 02 Apr 2013 23:32:57 +0200 Original-Received: from localhost ([::1]:38036 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN8oi-0003vY-Tf for geh-help-gnu-emacs@m.gmane.org; Tue, 02 Apr 2013 17:32:32 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN8oM-0003ot-5G for help-gnu-emacs@gnu.org; Tue, 02 Apr 2013 17:32:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UN8oK-0002Ir-JB for help-gnu-emacs@gnu.org; Tue, 02 Apr 2013 17:32:10 -0400 Original-Received: from mout.web.de ([212.227.17.12]:61989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN8oK-0002IU-Af for help-gnu-emacs@gnu.org; Tue, 02 Apr 2013 17:32:08 -0400 Original-Received: from drachen.dragon ([92.74.136.91]) by smtp.web.de (mrweb103) with ESMTPSA (Nemesis) id 0MLxwG-1UHe5y43kC-00855n; Tue, 02 Apr 2013 23:32:07 +0200 Mail-Followup-To: help-gnu-emacs@gnu.org, help-gnu-emacs@gnu.org In-Reply-To: (Steven Degutis's message of "Tue, 2 Apr 2013 14:15:20 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Provags-ID: V02:K0:XXC7ieqSuWa58JILpA9e9J/6eqlAJDDGNtTt6SZpLr1 1UGiRDFtdFQOFIiRPJAv19V+LW0s7iqHJZ39tjK5n5N/+I3vKp n5Be1zVqP9PyBFNTtp8CPPXQtYwBI/e+N1dCbQnSKzUoM7HG60 h8N5YRupjHEIFkdMq5KAes2+r7oS0+Ng+C+03va8b5yz75yWmd TjLf1O1GO17uS62IHv0HVe5ESmHCH2qCOZd0sPy36c= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.17.12 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:89911 Archived-At: Hi again, to your original question: no, there is no hook and no trivial substitute AFAIK. The reason may be that Emacs often temporarily selects different windows in the background. An example is `walk-windows', which explicitly calls `select-window'. So, if there was a hook, it would presumably be called all the time in situations where you wouldn't expect it. The solution to your problem depends on what you want to do. `post-command-hook' could be an option. Regards, Michael.