From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: [GNU ELPA] New package proposal: aggressive-completion.el Date: Mon, 05 Apr 2021 09:17:24 +0200 Message-ID: <87eefp18q2.fsf@gnu.org> References: <87o8evok58.fsf@gnu.org> <8735w7y98k.fsf@gnu.org> <87mtue5f6x.fsf@tcd.ie> <8735w5rh3s.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37315"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.11; emacs 28.0.50 Cc: "Basil L. Contovounesios" , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Apr 05 09:39:47 2021 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 1lTJpp-0009Zi-7Z for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Apr 2021 09:39:45 +0200 Original-Received: from localhost ([::1]:41134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTJpo-0003zP-9V for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Apr 2021 03:39:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTJpC-0003Zr-Jh for emacs-devel@gnu.org; Mon, 05 Apr 2021 03:39:06 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54502) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTJpB-0007kM-6j; Mon, 05 Apr 2021 03:39:05 -0400 Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:55281) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1lTJpA-0005Yp-Ss; Mon, 05 Apr 2021 03:39:05 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 53AAF27C0054; Mon, 5 Apr 2021 03:39:04 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 05 Apr 2021 03:39:04 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudejuddguddvvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpehffgfhvffuffgjkfggtgesthdtredttdertdenucfhrhhomhepvfgrshhs ihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucggtffrrghtthgvrhhnpe evveeikeetkeeviefgfeffiedvteeguddvffeuueduveegtddthedvhfeuveffhfenucfk phepkeejrdduieefrdefuddrudehgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehthhhorhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgr lhhithihqdekieejfeekjeekgedqieefhedvleekqdhtshguhheppehgnhhurdhorhhgse hfrghsthhmrghilhdrfhhm X-ME-Proxy: Original-Received: from thinkpad-t440p (p57a31f9a.dip0.t-ipconnect.de [87.163.31.154]) by mail.messagingengine.com (Postfix) with ESMTPA id C6BD2240054; Mon, 5 Apr 2021 03:39:02 -0400 (EDT) In-reply-to: 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:267405 Archived-At: Stefan Monnier writes: >>>> (defcustom aggressive-completion-no-complete-commands >>>> '( left-char icomplete-fido-backward-updir minibuffer-complete >>>> right-char delete-backward-char backward-kill-word >>>> backward-kill-paragraph backward-kill-sentence backward-kill-sexp >>>> delete-char kill-word kill-line completion-at-point) >>>> "Commands after which automatic completion is not performed." >>>> :type '(repeat command)) > [...] >> How hard can it be to get it right on the first try?!? ;-) > > BTW, you might want to document (via comments) the reason behind all > those choices. E.g. the set of possible completions generally depends > on the position of `point` (e.g. for the `partial-completion` style, > there's an implicit `*` at point), so whether or not to refresh the > *Completions* buffer after `left-char` (for example) is not as obvious > a decision as one might think. I've replaced that variable with `aggressive-completion-auto-complete-commands' which lists the commands after which automatic completion is performed (as you've implicitly suggested). The default value is just '(self-insert-command yank). I think that's much less controversial than what commands previously had to go into the blacklist. > Also, listing command names inevitably can cause problems for > circumstances where another command name (e.g. defined as a thin > wrapper for a standard command) is used. I don't really have a better > solution to offer, tho, unless you can think of a clear statement of > which kinds of commands should be included/excluded, such that we > could then check using hooks that let us record what the command has > actually done. Now with the whitelist approach, the criterion for triggering auto-completion is basically "you have inserted something". I think the current default value captures 99% of the cases. Some people might also want to add things like `transpose-chars' but I prefer an explicit tab after such a correction. That's indeed the main motivation why I changed the blacklist to a whitelist approach: it isn't too bad when you have to TAB explicitly sometimes but it has been highly annoying when it auto-completed when you didn't want to. For example, before `left-char' and `left-word' where on the blacklist you essentially couldn't move point leftwards for editing. It would just pop back to the end unless you were able to invoke each movement/editing command with a delay < 0.3 seconds. Bye, Tassilo