From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: is there a hook for when a buffer loses/gains the cursor or the frame loses/gains focus? Date: Tue, 13 May 2008 10:26:47 -0400 Message-ID: References: <86od7apaxl.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1210688865 22739 80.91.229.12 (13 May 2008 14:27:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 13 May 2008 14:27:45 +0000 (UTC) Cc: emacs-devel@gnu.org To: Ted Zlatanov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 13 16:28:21 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JvvTv-0001P0-I5 for ged-emacs-devel@m.gmane.org; Tue, 13 May 2008 16:27:55 +0200 Original-Received: from localhost ([127.0.0.1]:47722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JvvTC-0001ff-3J for ged-emacs-devel@m.gmane.org; Tue, 13 May 2008 10:27:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JvvT7-0001fN-Ee for emacs-devel@gnu.org; Tue, 13 May 2008 10:27:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JvvT5-0001eh-MG for emacs-devel@gnu.org; Tue, 13 May 2008 10:27:04 -0400 Original-Received: from [199.232.76.173] (port=49061 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JvvT5-0001eX-JV for emacs-devel@gnu.org; Tue, 13 May 2008 10:27:03 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:34495) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JvvT5-0005Db-BG for emacs-devel@gnu.org; Tue, 13 May 2008 10:27:03 -0400 Original-Received: from ceviche.home (vpn-132-204-232-36.acd.umontreal.ca [132.204.232.36]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id m4DERBCs002153 for ; Tue, 13 May 2008 10:27:12 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 07D9B70492; Tue, 13 May 2008 10:26:48 -0400 (EDT) In-Reply-To: <86od7apaxl.fsf@lifelogs.com> (Ted Zlatanov's message of "Tue, 13 May 2008 08:53:42 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3014=0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:97084 Archived-At: > http://www.postal-code.com/binarycode/2008/05/12/save-should-die/ > go me thinking that it would be nice to save every time the buffer loses > the cursor. Is there a way in Emacs to do that? Similarly, I'd like to > save every time the frame loses focus. I didn't find any hooks or > functions for this. I don't think there is such a thing yet. We have a `switch-frame' event, but it's only triggered when you enter another frame, not when you leave a frame (if your whole display is covered with nothing but Emacs frames, it's equivalent, of course, but not in general). Stefan