From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Brian Jenkins Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] frame.c: focus hooks Date: Sun, 17 Nov 2013 17:25:33 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=bcaec52160d7c703b404eb66e9b3 X-Trace: ger.gmane.org 1384727156 5067 80.91.229.3 (17 Nov 2013 22:25:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Nov 2013 22:25:56 +0000 (UTC) Cc: emacs-devel To: Bozhidar Batsov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 17 23:26:01 2013 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 1ViAmw-0001NB-V3 for ged-emacs-devel@m.gmane.org; Sun, 17 Nov 2013 23:25:55 +0100 Original-Received: from localhost ([::1]:40524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViAmw-0001TJ-Bo for ged-emacs-devel@m.gmane.org; Sun, 17 Nov 2013 17:25:54 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38600) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViAms-0001T9-Ub for emacs-devel@gnu.org; Sun, 17 Nov 2013 17:25:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ViAmr-0006PM-J8 for emacs-devel@gnu.org; Sun, 17 Nov 2013 17:25:50 -0500 Original-Received: from mail-pb0-x22a.google.com ([2607:f8b0:400e:c01::22a]:57023) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViAmr-0006PI-9i for emacs-devel@gnu.org; Sun, 17 Nov 2013 17:25:49 -0500 Original-Received: by mail-pb0-f42.google.com with SMTP id uo5so5930390pbc.1 for ; Sun, 17 Nov 2013 14:25:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=ALaVVrXRXm6EraCU/SLwI3tUZI1WT0ROB54Gja6sM00=; b=PwQZwfYb6Hzhcf9DTglmHf/LqXSoddOq7NbES9uLxosY73kvF93vRTaS9n/n/Xr/BZ Xi7Rh/fBFWyn90Z+q+xJNpuIBQSXnb6c/45mn1ewfc2qB1kYJfGlbKnj4AE8hA41voMM v8LJ1lUW0/K+luxR+vc7+UYBR3Ni+PbkO3CLhsB22EHn3LhGBlydifB7p+YHegQuU47u ZKz4O1R1JPFZecMiVgG+Tt+6D5/MQaCCD9iXdXeYYqTd1PAwGRygwfHzSBYWoDOQHFF8 v0w6uCwrgd8qUBfGUoflIPeHDzbYxVRRbnenNRtR/IXclZ0rpriDyoFXTPjh4wySYjGe lpeQ== X-Received: by 10.68.17.132 with SMTP id o4mr17843534pbd.44.1384727148166; Sun, 17 Nov 2013 14:25:48 -0800 (PST) Original-Received: by 10.68.29.202 with HTTP; Sun, 17 Nov 2013 14:25:33 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: HtHNOdVzUfTvFOumE72pWAByhqM X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c01::22a 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:165310 Archived-At: --bcaec52160d7c703b404eb66e9b3 Content-Type: text/plain; charset=ISO-8859-1 Thanks for the encouragement and feedback, Bozhidar. I'm not married to the names. I noticed that terms for focus gain/loss seem to vary between platforms, so I used the event names used elsewhere in the Emacs source. Perhaps "focus-gain-hook" and "focus-loss-hook" would be more intuitive? Brian On Sun, Nov 17, 2013 at 1:29 PM, Bozhidar Batsov wrote: > I welcome your idea! In fact I've been thinking for quite some time we > needed something like this. I don't like the names of the hooks, however, > since they don't seem particularly standard - usually the terminology used > with focus is "focus gained" and "focus lost" (or "on focus" and "on lose > focus"). > > > On 17 November 2013 19:50, Brian Jenkins wrote: > >> Hello. >> >> I'd like to contribute the attached patch, which adds hooks into gain and >> loss of focus events. >> >> This allows saving all buffers on loss of focus. (Alt-tabbing between >> an editor and browser is a popular workflow for web programmers.) >> >> It also allows reversion of buffers on regain of focus, convenient if >> one is switching between Emacs and another editor. >> >> People will probably find other handy uses for these hooks. >> >> Best, >> Brian Jenkins >> > > --bcaec52160d7c703b404eb66e9b3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thanks for the encouragement and feedback, Bozhidar.<= /div>

I'm not married to the names. =A0I noticed that ter= ms for focus gain/loss seem to vary between platforms, so I used the event = names used elsewhere in the Emacs source.

Perhaps "focus-gain-hook" and "focus-loss-hoo= k" would be more intuitive?

Brian


On Sun, N= ov 17, 2013 at 1:29 PM, Bozhidar Batsov <bozhidar@batsov.com> wrote:
I welcome your idea! In fac= t I've been thinking for quite some time we needed something like this.= I don't like the names of the hooks, however, since they don't see= m particularly standard - usually the terminology used with focus is "= focus gained" and "focus lost" (or "on focus" and = "on lose focus").


On 17 Novembe= r 2013 19:50, Brian Jenkins <brian@brianjenkins.org> wr= ote:
Hello.

<= /div>
I'd like to contribute the attached patch, which adds hooks i= nto gain and
loss of focus events.

This allows saving all = buffers on loss of focus. =A0(Alt-tabbing between
an editor and browser is a popular workflow for web programmers.)

It also allows reversion of buffers on regain of focus= , convenient if
one is switching between Emacs and another editor= .

People will probably find other handy uses for these ho= oks.

Best,
Brian Jenkins


--bcaec52160d7c703b404eb66e9b3--