From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: HowTo: Run a hook when a buffer becomes "current" Date: Thu, 17 Dec 2015 00:04:51 +0100 Message-ID: <87bn9q3sh8.fsf@fencepost.gnu.org> References: <874mfi5afk.fsf@ulb.ac.be> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1450307143 19877 80.91.229.3 (16 Dec 2015 23:05:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Dec 2015 23:05:43 +0000 (UTC) Cc: emacs-devel@gnu.org, raman To: Nicolas Richard Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 17 00:05:42 2015 Return-path: Envelope-to: ged-emacs-devel@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 1a9L8f-0007Bq-Mw for ged-emacs-devel@m.gmane.org; Thu, 17 Dec 2015 00:05:41 +0100 Original-Received: from localhost ([::1]:49821 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9L8f-0003Np-19 for ged-emacs-devel@m.gmane.org; Wed, 16 Dec 2015 18:05:41 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9L8I-0003NF-QD for emacs-devel@gnu.org; Wed, 16 Dec 2015 18:05:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9L8F-0002C6-QH for emacs-devel@gnu.org; Wed, 16 Dec 2015 18:05:18 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9L8F-0002Bu-N9; Wed, 16 Dec 2015 18:05:15 -0500 Original-Received: from localhost ([127.0.0.1]:41792 helo=lola) by fencepost.gnu.org with esmtp (Exim 4.82) (envelope-from ) id 1a9L8E-0003eb-W0; Wed, 16 Dec 2015 18:05:15 -0500 Original-Received: by lola (Postfix, from userid 1000) id 6084FE000B; Thu, 17 Dec 2015 00:04:51 +0100 (CET) In-Reply-To: <874mfi5afk.fsf@ulb.ac.be> (Nicolas Richard's message of "Wed, 16 Dec 2015 22:51:43 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:196403 Archived-At: Nicolas Richard writes: > raman writes: > >> I was looking for a way of running a function when a buffer becomes >> "current". I cant find any hooks in Emacs -- the closest is >> buffer-list-update-hook -- but that gets called way too often >> including when a buffer is buried, is visited transiently from within >> lisp code etc. > > I think you're after window-configuration-change-hook, see > (info "(elisp) Window Hooks") That would be for "selected", not "current". -- David Kastrup