From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mathias Dahl Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Add abbrev suggestions Date: Thu, 13 Aug 2020 16:29:57 +0200 Message-ID: References: <83pn8rgwib.fsf@gnu.org> <83o8o4c8s4.fsf@gnu.org> <838seimytk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000002b9c9005acc324df" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16398"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 13 16:31:15 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k6EGB-0004AL-0G for ged-emacs-devel@m.gmane-mx.org; Thu, 13 Aug 2020 16:31:15 +0200 Original-Received: from localhost ([::1]:37146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6EGA-0000GZ-09 for ged-emacs-devel@m.gmane-mx.org; Thu, 13 Aug 2020 10:31:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k6EFB-0008A8-Ns for emacs-devel@gnu.org; Thu, 13 Aug 2020 10:30:13 -0400 Original-Received: from mail-ua1-x942.google.com ([2607:f8b0:4864:20::942]:34559) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k6EF9-0002a2-4w; Thu, 13 Aug 2020 10:30:13 -0400 Original-Received: by mail-ua1-x942.google.com with SMTP id s29so1702214uae.1; Thu, 13 Aug 2020 07:30:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=n6UayanexYD/aece3Fs6fE3sJ1Hpx9RfCApX2E1Cxs0=; b=d85Sp+WOqUfQL5bysamkaJJtu67yupe+uD+UKrCv7EBwRtSbqKQNdgnMiGe92exkmC nYpiXKAHMi6apUedGrnTLdPBY7BzQLC9dsKFKlWAfvycI4Kl7MuDPEYHop+RVbBfOnSj baarI37ziSQgWYWpCovecU2s4CDP1w5aATQtJ74b1vGviHfM1DofMP4VPqU9b1AKjRo4 /D89Pv3GPxc07gFANasBK7Mk1pXhVYdo+P/Ua3mKmHE1TOOWIR8kSNWSJqgk+WYlHNog /VfvQwjXQxPuuypSE+FLLcZZYxRNwhpIAsshJ9oQsOevwfvUgDDuKNXWsECMH7Mhspbq hVCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=n6UayanexYD/aece3Fs6fE3sJ1Hpx9RfCApX2E1Cxs0=; b=rnVVXCj0H6qrUgUOAm5n8XiorraRaGV6rEDHM0eLTWcTIJdUAdEpqGeGuuk7vozrnf xyPrg3ySdbK5tXNN08xgy2P3xoQD6eKPeTtM4A2SiZKI4whlu4UTuvi4Z+p3dLQIuiwF /WYHerFG4+7HlnAnya7sfx00U1u4DZPXdTpAEwGqYi0KJ7n3A36XMIGtc8pQmPLk/xPo fUToe34gERQh7/Ic5oL/TIsAZpe3IiGrHTJPzUoabF/p4CAO7Vnv/QfK3cPJeZN0n9fe Nz7cGyBZpKHlyjOUDbZRG+aUqOxNnwTQCQwNg9vqC5OFXtaZXJ/bIYhDg2t9UMhoS2ik Cogw== X-Gm-Message-State: AOAM530xgfxU1wxttEQI/Hsm3vjsf1nLXUZ6maUZpiawTr0q+m6WlTeK AcCzMwzk/WJLT3ybKvGDwJYjFeUPGKc1ughnOx44helkIvg= X-Google-Smtp-Source: ABdhPJwPl8Zs5EaRlH0vHT/QTeMo4thPlfyVUCqGDvvytrNzxoXhJZ9wZq0OVvBoR8ndSb2DQf18X4rIBNmp0hLVDi4= X-Received: by 2002:ab0:6453:: with SMTP id j19mr3443197uap.134.1597329008990; Thu, 13 Aug 2020 07:30:08 -0700 (PDT) In-Reply-To: <838seimytk.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::942; envelope-from=mathias.dahl@gmail.com; helo=mail-ua1-x942.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:253734 Archived-At: --0000000000002b9c9005acc324df Content-Type: text/plain; charset="UTF-8" > > No, I'm not. In fact, it was not the default when I started > > working on this, but Stefan suggested that it might be a good > > default. Now we're me and you against him, I guess... :) > Let's start with having it opt-in. We can later see if it is > popular enough to become the default. Fine by me. > How about the below? > Return non-nil if an abbrev in EXPANSION provides significant > savings. Hey, that's cheating! :) I prepared a new version myself too. Will see which one I select when I send a new patch... > > Should I include those changes in the same patch and resend > > that when done? > Yes, please. Alrighty then! Thanks! /Mathias On Thu, Aug 13, 2020 at 3:59 PM Eli Zaretskii wrote: > > From: Mathias Dahl > > Date: Wed, 12 Aug 2020 00:16:33 +0200 > > Cc: emacs-devel@gnu.org > > > > > Are you sure it is a good idea to make this non-nil by default? > > > Wouldn't some users consider these suggestions an annoyance? > > > > No, I'm not. In fact, it was not the default when I started working on > > this, but Stefan suggested that it might be a good default. Now we're > > me and you against him, I guess... :) > > Let's start with having it opt-in. We can later see if it is popular > enough to become the default. > > > > > +(defun abbrev--suggest-above-threshold (expansion) > > > > + "Return t if we are above the threshold. > > > > > > Who is "we" in this context? This should be explained. > > > > I know, I was not happy when I wrote that. "we", here, is something > > like "the difference in length between what the user typed and the > > abbrev that we found." I guess I could not find a good way to keep the > > first sentence of the docstring short, so I opted for the fuzzy "we" > > expression... > > How about the below? > > Return non-nil if an abbrev in EXPANSION provides significant savings. > > > > > +EXPANSION is a cons cell where the car is the expansion and the > > > > +cdr is the abbrev." > > > > > > Our style is to include the arguments in the first sentence of the doc > > > string. > > > > I know. Frankly I don't know if I can come up with a suggestion that > > combines that together with having a relatively short first > > sentence... > > See above. > > > Should I include those changes in the same patch and resend > > that when done? > > Yes, please. > --0000000000002b9c9005acc324df Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> > No, I'm not. In fact, it was not the default= when I started
> > working on this, but Stefan suggested that it = might be a good
> > default. Now we're me and you against him,= I guess... :)

> Let's start with having it opt-in.=C2=A0 We = can later see if it is
> popular enough to become the default.
Fine by me.

> How about the below?

> Return non-nil if= an abbrev in EXPANSION provides significant
> savings.

Hey, t= hat's cheating! :)

I prepared a new version myself too. Will see= which one I select when
I send a new patch...

> > Should I= include those changes in the same patch and resend
> > that when = done?

> Yes, please.

Alrighty then!

Thanks!

= /Mathias


On Thu, Aug 13, 2020 at 3:59 PM Eli Zaretskii &l= t;eliz@gnu.org> wrote:
> From: Mathias Dahl <<= a href=3D"mailto:mathias.dahl@gmail.com" target=3D"_blank">mathias.dahl@gma= il.com>
> Date: Wed, 12 Aug 2020 00:16:33 +0200
> Cc: emacs-dev= el@gnu.org
>
> > Are you sure it is a good idea to make this non-nil by default? > > Wouldn't some users consider these suggestions an annoyance?<= br> >
> No, I'm not. In fact, it was not the default when I started workin= g on
> this, but Stefan suggested that it might be a good default. Now we'= ;re
> me and you against him, I guess... :)

Let's start with having it opt-in.=C2=A0 We can later see if it is popu= lar
enough to become the default.

> > > +(defun abbrev--suggest-above-threshold (expansion)
> > > +=C2=A0 =C2=A0 "Return t if we are above the threshold.=
> >
> > Who is "we" in this context?=C2=A0 This should be expla= ined.
>
> I know, I was not happy when I wrote that. "we", here, is so= mething
> like "the difference in length between what the user typed and th= e
> abbrev that we found." I guess I could not find a good way to kee= p the
> first sentence of the docstring short, so I opted for the fuzzy "= we"
> expression...

How about the below?

=C2=A0 Return non-nil if an abbrev in EXPANSION provides significant saving= s.

> > > +EXPANSION is a cons cell where the car is the expansion and= the
> > > +cdr is the abbrev."
> >
> > Our style is to include the arguments in the first sentence of th= e doc
> > string.
>
> I know. Frankly I don't know if I can come up with a suggestion th= at
> combines that together with having a relatively short first
> sentence...

See above.

> Should I include those changes in the same patch and resend
> that when done?

Yes, please.
--0000000000002b9c9005acc324df--