From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bozhidar Batsov Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] frame.c: focus hooks Date: Mon, 18 Nov 2013 10:20:44 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11331e1a6bbfc004eb6f390e X-Trace: ger.gmane.org 1384762850 8139 80.91.229.3 (18 Nov 2013 08:20:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Nov 2013 08:20:50 +0000 (UTC) Cc: emacs-devel To: Brian Jenkins Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 18 09:20:55 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 1ViK4j-0004Jo-9u for ged-emacs-devel@m.gmane.org; Mon, 18 Nov 2013 09:20:53 +0100 Original-Received: from localhost ([::1]:41852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViK4i-0007bB-Qm for ged-emacs-devel@m.gmane.org; Mon, 18 Nov 2013 03:20:52 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViK4c-0007ZR-NB for emacs-devel@gnu.org; Mon, 18 Nov 2013 03:20:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ViK4b-0007YF-2y for emacs-devel@gnu.org; Mon, 18 Nov 2013 03:20:46 -0500 Original-Received: from mail-oa0-x22a.google.com ([2607:f8b0:4003:c02::22a]:46961) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ViK4a-0007YA-M9 for emacs-devel@gnu.org; Mon, 18 Nov 2013 03:20:44 -0500 Original-Received: by mail-oa0-f42.google.com with SMTP id i4so1105178oah.15 for ; Mon, 18 Nov 2013 00:20:44 -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:date:message-id:subject :from:to:cc:content-type; bh=sBC9uFr9FTKEez/dPMIKc8aiMNn2AYbUoFIpNAxNJ+8=; b=o8cznCpgcW97ZpFbCmwHlvYstQf61BHrXlMXlxQfTWayPt6ZbgbqrunQx44YVpv233 kVsCOUfioPHvAvbfatbIAhUgJZmA0VPQGu2fCWxBGYsL6h/vZjCOyX+lyLw4mIneSoU2 qdMh0drSD6YId5Yk8jXp1Dt3yPm7mTLUgMramyNDHnBipw8HbUCfwEjzj+7/TuY7Ve3r YUj2d1cKXqDSEsvNlGrt49v7xes0dZRkm1GhjMU/ef/hK7GKr1q5nQdEOkpJ1rGybdaK /S/DtFTXRGDZGdKFLpZx3TpAuFONYqjX1ZomCd4CgaF3IBnRKaifhKWUDUZZcnUDo9XV eg3g== X-Received: by 10.60.44.239 with SMTP id h15mr19080730oem.22.1384762844099; Mon, 18 Nov 2013 00:20:44 -0800 (PST) Original-Received: by 10.76.21.207 with HTTP; Mon, 18 Nov 2013 00:20:44 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: RIyn_5CzgloacsIDLixORK7v6DA X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c02::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:165318 Archived-At: --001a11331e1a6bbfc004eb6f390e Content-Type: text/plain; charset=UTF-8 These names are fine by me. On 18 November 2013 00:25, Brian Jenkins wrote: > 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 >>> >> >> > --001a11331e1a6bbfc004eb6f390e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
These names are fine by me.


On 18 November 2013 00:25, Brian Jenki= ns <brian@brianjenkins.org> wrote:
Thanks for the encoura= gement and feedback, Bozhidar.

I'm not married to t= he names. =C2=A0I noticed that terms for focus gain/loss seem to vary betwe= en 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, Nov 17, 2013 at 1:29 PM, Bozhidar Batsov <= ;bozhidar@batsov.c= om> 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. =C2=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



--001a11331e1a6bbfc004eb6f390e--