From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Deniz Dogan Newsgroups: gmane.emacs.help Subject: Re: Hook for "buffer switched" Date: Wed, 15 Dec 2010 11:22:57 +0100 Message-ID: References: <44c604d5-d4ca-4914-bc02-40f0fada6f3d@y31g2000vbt.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1292409495 17614 80.91.229.12 (15 Dec 2010 10:38:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 15 Dec 2010 10:38:15 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Elena Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 15 11:38:10 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 1PSokE-0000f0-F5 for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Dec 2010 11:38:02 +0100 Original-Received: from localhost ([127.0.0.1]:56992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSoWq-0003hC-9y for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Dec 2010 05:24:12 -0500 Original-Received: from [140.186.70.92] (port=52938 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSoWA-0003fm-G4 for help-gnu-emacs@gnu.org; Wed, 15 Dec 2010 05:23:31 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSoW9-00010E-5x for help-gnu-emacs@gnu.org; Wed, 15 Dec 2010 05:23:30 -0500 Original-Received: from mail-iw0-f169.google.com ([209.85.214.169]:51550) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSoW9-000107-2Q for help-gnu-emacs@gnu.org; Wed, 15 Dec 2010 05:23:29 -0500 Original-Received: by iwn40 with SMTP id 40so2091661iwn.0 for ; Wed, 15 Dec 2010 02:23:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=WshIsJXvqUN7rRtuESsmH/nr/JoOw1nB3qYfvjrmZHI=; b=NIZuR/+XbZfwdD9v5ZZPCeQvxZV/IKFlPFgJFR6nI3mZbscYv0XOUe/MxPBzm0g+Nq WTI14K/tS8xjnWeVoV/xYjNuBbAllnkkrcfwCpK8U2175u8A+4rmpkQ2IPFQHW/H7ZdW 4KkUskO4xWRto4/di392IvKT4t4mJ6IXwdpqY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=MNQGF0jj97PW1A19rBu4g/J7d42RLI3pzJ0CH7W6ct3sm7gZ3OASLmhcYB2dopZI94 QHe/a51NmVReimmcABDPMWjuzVt9tBvkq0Id3tVc5+drlJtx0WhEP5n1Rk1LK1x4DrR5 jO1zJQMwWuVS3mNjGcChJRlcUTRGyBDSYJ76Q= Original-Received: by 10.231.35.195 with SMTP id q3mr4537767ibd.186.1292408607848; Wed, 15 Dec 2010 02:23:27 -0800 (PST) Original-Received: by 10.231.33.140 with HTTP; Wed, 15 Dec 2010 02:22:57 -0800 (PST) In-Reply-To: <44c604d5-d4ca-4914-bc02-40f0fada6f3d@y31g2000vbt.googlegroups.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:77520 Archived-At: 2010/12/15 Elena : > On Dec 15, 5:07=A0am, Stefan Monnier wrote: >> > 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 ... > > I would like to be able to handle the "change > the currently active buffer" case. > > >> > 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? > > Or maybe because they are not able to solve it reliably. =A0For > instance, I'd like Viper state to be global instead of buffer-local. > For this to work, I would have to know whenever the current active > buffer changes and switch Viper state when needed. =A0Or I could just > prefer always switching to Normal state whenever I switch buffer. > How come I never received Stefan's e-mail? --=20 Deniz Dogan