From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.devel Subject: Re: HowTo: Run a hook when a buffer becomes "current" Date: Wed, 16 Dec 2015 22:51:43 +0100 Message-ID: <874mfi5afk.fsf@ulb.ac.be> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1450305176 13750 80.91.229.3 (16 Dec 2015 22:32:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Dec 2015 22:32:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: raman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 16 23:32:47 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 1a9Kcn-0004N2-9y for ged-emacs-devel@m.gmane.org; Wed, 16 Dec 2015 23:32:45 +0100 Original-Received: from localhost ([::1]:49726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9Kcm-0002b6-LG for ged-emacs-devel@m.gmane.org; Wed, 16 Dec 2015 17:32:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9JyZ-00075c-4q for emacs-devel@gnu.org; Wed, 16 Dec 2015 16:51:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9JyU-0002O5-2N for emacs-devel@gnu.org; Wed, 16 Dec 2015 16:51:11 -0500 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:25631) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9JyT-0002NR-TQ for emacs-devel@gnu.org; Wed, 16 Dec 2015 16:51:06 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtsEACPccVakD4Xx/2dsb2JhbABegmmCEIJivQeGDQKBegEBAQEBAYELhDUBAQMBeQULCAMhJQ8BBEkTiCcIukKDYwELASCGVoR9iUAFlnyPJIc6iyOIYmOEBT00hRIBAQE Original-Received: from mathsrv4.ulb.ac.be (HELO localhost) ([164.15.133.241]) by smtp.ulb.ac.be with ESMTP; 16 Dec 2015 22:51:04 +0100 In-Reply-To: (raman@google.com's message of "Wed, 16 Dec 2015 08:37:57 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 164.15.128.112 X-Mailman-Approved-At: Wed, 16 Dec 2015 17:32:42 -0500 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:196402 Archived-At: 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") -- Nicolas