From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Hook for "buffer switched" Date: Wed, 15 Dec 2010 00:07:04 -0500 Organization: A noiseless patient Spider Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1292427621 13299 80.91.229.12 (15 Dec 2010 15:40:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 15 Dec 2010 15:40:21 +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 Dec 15 16:40:17 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PStSh-0004O9-6W for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Dec 2010 16:40:15 +0100 Original-Received: from localhost ([127.0.0.1]:46394 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PStSf-0005kd-NF for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Dec 2010 10:40:13 -0500 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!t-online.de!news.buerger.net!newsfeed.datemas.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 19 Injection-Info: mx02.eternal-september.org; posting-host="npc8WwhkFofBeKiRj5F6nA"; logging-data="17666"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/nm45B56n4AfDi2aYtUVj5" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:RBQuyWZ6avQbtJ004CEQRTeH7ns= sha1:TWCH8f8hxEwCxQZ9WdiymmRoGtc= Original-Xref: usenet.stanford.edu gnu.emacs.help:183279 X-Mailman-Approved-At: Wed, 15 Dec 2010 10:34:28 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:77535 Archived-At: > Is there any hook that is run when a buffer is switched? I think generally the answer is "no", tho this question is ill-formed: it's not clear what you mean by switching buffer: do you mean "change the currently active buffer" (i.e. what is done by `set-buffer'), or "change the buffer displayed in the current window", or "select a different window showing a different buffer", or ... > If not, why not? Maybe because to a large extent it's an ill-defined problem and once they try to define it better, people seem to end up deciding they don't really need to solve it any more? E.g. often the original problem of the OP becomes simply unsolvable in the general context, such as when a buffer is displayed in several windows at the same time. Stefan