From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thorsten Jolitz Newsgroups: gmane.emacs.help Subject: Re: switch-buffer-hook to catch the switch-event? Date: Wed, 27 Feb 2013 00:38:41 +0100 Message-ID: <87y5ea3ata.fsf@gmail.com> References: <87ehg3oqjm.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1361922249 9631 80.91.229.3 (26 Feb 2013 23:44:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 26 Feb 2013 23:44:09 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Feb 27 00:44:32 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 1UAUCG-0003H3-Jl for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Feb 2013 00:44:32 +0100 Original-Received: from localhost ([::1]:32899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAUBv-00076x-PD for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Feb 2013 18:44:11 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:56994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAUBp-00076P-O1 for help-gnu-emacs@gnu.org; Tue, 26 Feb 2013 18:44:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAUBo-0002lf-Dr for help-gnu-emacs@gnu.org; Tue, 26 Feb 2013 18:44:05 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:60278) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAU6s-0000UZ-5Y for help-gnu-emacs@gnu.org; Tue, 26 Feb 2013 18:38:58 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UAU79-00016d-1z for help-gnu-emacs@gnu.org; Wed, 27 Feb 2013 00:39:15 +0100 Original-Received: from e178118228.adsl.alicedsl.de ([85.178.118.228]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Feb 2013 00:39:15 +0100 Original-Received: from tjolitz by e178118228.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Feb 2013 00:39:15 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 19 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: e178118228.adsl.alicedsl.de User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.2 (gnu/linux) Cancel-Lock: sha1:DF6D39z3VKU0Vke/ZiDyjvy+gm4= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:89275 Archived-At: Sean McAfee writes: > Stefan Monnier writes: >>> How can I trigger an action everytime a certain buffer gets the focus >>> (becomes current-buffer)? Is there no hook for 'switch-buffer' or >>> something similar? > >> No, indeed, there isn't. > > Hmm! It seems dired-auto-revert-buffer doesn't do what I always assumed > it did. But dired-auto-revert-buffer is a defcustom (variable), I wonder how the switch-to-buffer event is actually tracked? I searched around a bit in dired.el, but couldn't find an obvious answer. -- cheers, Thorsten