From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mathias Dahl Newsgroups: gmane.emacs.devel Subject: Re: Abbrev suggestions - feedback appreciated Date: Sun, 17 Sep 2017 15:22:32 +0200 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="f403043efaa0f54ab9055962853d" X-Trace: blaine.gmane.org 1505654631 2147 195.159.176.226 (17 Sep 2017 13:23:51 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 17 Sep 2017 13:23:51 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 17 15:23:44 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dtZXz-0000H7-Ap for ged-emacs-devel@m.gmane.org; Sun, 17 Sep 2017 15:23:43 +0200 Original-Received: from localhost ([::1]:60617 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dtZY6-0006Y7-K7 for ged-emacs-devel@m.gmane.org; Sun, 17 Sep 2017 09:23:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dtZXC-0006WV-Ka for emacs-devel@gnu.org; Sun, 17 Sep 2017 09:22:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dtZXB-0006HP-KE for emacs-devel@gnu.org; Sun, 17 Sep 2017 09:22:54 -0400 Original-Received: from mail-ua0-x231.google.com ([2607:f8b0:400c:c08::231]:53981) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dtZXB-0006Gx-F8 for emacs-devel@gnu.org; Sun, 17 Sep 2017 09:22:53 -0400 Original-Received: by mail-ua0-x231.google.com with SMTP id t36so3195938uah.10 for ; Sun, 17 Sep 2017 06:22:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=wf77f1kr4ZZXxIVmaPtht7WHdt0ZTNxCjZaP1dv0V2s=; b=pf6MEsnoS7jBShRAfP+/m3r9UFOHPEsIigjzhaZg6l5HEr4ozIcC0VTykXun22kASC 5OIr1imdmCcyumOViDaVNsrU9gCy6nCyoK4GeGJK/a8YpO85IpHXprc0lQcAoJdVY51v 8lpNVIX/B4lVejlJ4arsouH9qPrQ/4ZC/kL7BACJ6p3yveXhIYSBArYcKFcyYXz403xt IMjN1g9zTYZbAgX0KMKwAbpMvYDMC4VVifusrV1ds5/5hOaIIzD1jmhwLD0MTAzVJ7pS UKtygFQTb2txtMealdQTkBVyXd2xsnfI+kKaAUEMUABbuFIA/x+BZY4wiB+z3BVqinFi 6IYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=wf77f1kr4ZZXxIVmaPtht7WHdt0ZTNxCjZaP1dv0V2s=; b=NXB2ig2mGgVGK1www5XS3cqivDuPDeH4i6fUT05Flp12mmO6tEzUBRYuuYmj8WEYrP 6UB536BS/viXavHRSHvZ7w7AcI3Od2/iIIE2KVYP6dlZ8CIk8G9O4kz7hBTSDBAyNB20 3x27mFjz2fGtZZsQtWXMRGnfme+RZUs8qlXrM8PUK+NwnxHXW+BhsLN489KQ51csIfZJ C7UerDcGrCthz41o0rtSEm0H87HrxyKi7/E8eC8ryD9HBnMroAMg88jVZ40740KU0ChQ TD6kbwNDcUrL5qYtDuPnmbtsyK321+LppYONPNNMER64Kovdwdt9Vq6Ix3TPQ7VQxqKe iNjw== X-Gm-Message-State: AHPjjUhJSRIX1UeyHVIeubRqQ/ljHNxhNxkEe54GriHVBkF/DxTLJRn9 KXOwTdbU/I/DYfTfRgmIp34OXmRQrzOsmS5NPQ4yqFop X-Google-Smtp-Source: ADKCNb5l+oyRFmVleueYgqcvQSCvRgfYmC30QPmhsPNklcDYVVUxjEQPMl64bpWXoTcg2wnAUAL19GgYEcLMnhLV5Rk= X-Received: by 10.159.52.66 with SMTP id s2mr26445867uab.120.1505654572663; Sun, 17 Sep 2017 06:22:52 -0700 (PDT) Original-Received: by 10.176.83.89 with HTTP; Sun, 17 Sep 2017 06:22:32 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400c:c08::231 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:218396 Archived-At: --f403043efaa0f54ab9055962853d Content-Type: text/plain; charset="UTF-8" Hi Stefan, thanks for your comments. I like the feature. Here are some comments: > > - The expansion is not necessarily a "word". > True. I thought about that and concluded that it would be a lot harder to look for more than one words, matching a certain expansion. It will be especially tricky, I think, if the words the user types and which match an extension, spans more than one line. Of course not impossible but I thought I would start with the easy and probably quite common use case. - The `expansions` list is built only to then pass it to `assoc`. > You could avoid constructing the list by passing `word` to > absug-get-active-abbrev-expansions and have it check equality as it > goes. > That's a good optimization, thanks! At least as long as I am not trying to tackle multi-word expansions. In that case, I don't know on beforehand how many words to match. Again, surely possible to solve... One way might be to save not one but, say, ten previous words, and send that in to the function that will look for expansions matching that. It would of course break on eleven words and above... Any clever ideas? :) I might surely be able to do this, but I am also concerned about performance here. --f403043efaa0f54ab9055962853d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Stefan, thanks for your comments.

I like the feature.=C2=A0 Here are some co= mments:

- The expansion is not necessarily a "word".

True. I thought about that and concluded that it would= be a lot harder
to look for more than one words, matching a cert= ain expansion. It will
be especially tricky, I think, if the word= s the user types and which
match an extension, spans more than on= e line. Of course not impossible but
I thought I would start with= the easy and probably quite common use
case.
- The `expansions` list is built only to then pass it to `assoc`.
=C2=A0 You could avoid constructing the list by passing `word` to
=C2=A0 absug-get-active-abbrev-expansions and have it check equality a= s it goes.

That's a good optimizati= on, thanks! At least as long as I am not trying
to tackle multi-w= ord expansions. In that case, I don't know on
beforehand how = many words to match. Again, surely possible to
solve... One way m= ight be to save not one but, say, ten previous words,
and send th= at in to the function that will look for expansions matching
that= . It would of course break on eleven words and above...

Any clever ideas? :) I might surely be able to do this, but I am also= concerned
about performance here.

--f403043efaa0f54ab9055962853d--