From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: Stepping Back: A Wealth Of Completion systems Re: [ELPA] New package: vertico Date: Mon, 05 Apr 2021 22:49:03 +0200 Message-ID: <874kgkxxs0.fsf@posteo.net> References: <9c9af088-580f-9fb1-4d79-237a74ce605c@inventati.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23599"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cc: Manuel Uberti , emacs-devel@gnu.org To: "T.V Raman" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Apr 05 22:51:51 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 1lTWCM-0005zA-Qp for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Apr 2021 22:51:50 +0200 Original-Received: from localhost ([::1]:49606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lTWCL-00080j-K7 for ged-emacs-devel@m.gmane-mx.org; Mon, 05 Apr 2021 16:51:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42150) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTW9l-0006Wt-2A for emacs-devel@gnu.org; Mon, 05 Apr 2021 16:49:09 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:52432) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lTW9j-0001vu-7t for emacs-devel@gnu.org; Mon, 05 Apr 2021 16:49:08 -0400 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 15438160061 for ; Mon, 5 Apr 2021 22:49:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1617655745; bh=J469niy6EStuzKzSCeN8zyQFBSwP4n+QM+45totUkXs=; h=From:To:Cc:Subject:Date:From; b=Mg9KquuGZzD11n0zZ+LxsVnrV2WTHKJJSEJkfdpqpOsUFuarpwKEviJNSsl53Ufbi hURhbKlTeXT5rD+EJnmLkRu2HSfE2HcoM+BbRdHqQANTlSAUK8DWhw1+uhWY0NaOPE COY5Bbo9WENVOapGO7gxcIR9p7kBaPq+saypgOEh/TX0VZJUGE46t0J2M6J254miU6 TvMPWUgM1Kmk56kWhA/oNw8prKhj/0G4QoFrwfV207cxeMSGMB6dvcXKXFoxmTzOaU roXQtjrNvwWo+CmZ41LID+KswOB1hO4ScsHCGGLJwCpXBdeAtLBoGXfBL+0gwFRDr3 jbFlEspxKGeOQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FDjSJ3Hkjz9rxB; Mon, 5 Apr 2021 22:49:04 +0200 (CEST) In-Reply-To: (T. V. Raman's message of "Mon, 05 Apr 2021 11:30:51 -0700") Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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:267435 Archived-At: I guess I can bring up a point I've been meaning to raise here for a while, and have discussed on other forums. > 1. Where invoked -- anywhere in emacs vs minibuffer. > 2. When invoked -- as in find-file and friends vs everywhere > something prompts in the minibuffer. > 3. Using what? the various backends that populate the available > choices. > 4. How displayed: How the choices are displayed -- horizontal, > vertical, and perhaps 3-d in the future. > 5. How completed: tab, vs prefix vs fuzzy completion vs ... I have the feeling all these completion systems are encouraging confusion around how to use completing-read. That is the 0th point that is missing here: Are you completing (expanding text) or selecting (narrowing options). Most completion frameworks I have looked at seem to limit themselves to the latter. To simplify, they collect all the options of a collection using all-completions and then narrow it depending on user input. Ido and all it's descendents (Ivy, Helm, Selectrum and now vertico) seem to be based on that approach. Try-completion for partial completion seems to only be used by the default completion system, which I think is a shame. I noticed this when implementing a completion-style based on Peter Norvig's spell checker[0], that would recognize minor typos such as M-x evla-buffer. IIRC this kind of behaviour is not strictly correct for a completing style, but that is another matter. The issue I see here is how packages (in and outside of Emacs) use completing-read. When package developers that use these newer completion frameworks test their functions, they might tend to assume that completing-read means "selecting-read", i.e. the user is presented a list of options that they can choose from. A personal example is a package I created a while back to insert eastern emoticons[1] (=C2=AF\_(=E3=83=84)_/=C2=AF, =C2=B4 =E2=96=BD ` )=EF=BE=89, =CE=A3 =E2=97= =95 =E2=97=A1 =E2=97=95, ...), that was convenient to use with Ivy but since I have stopped using it has become inconvenient, as I don't have most of the letters on my keyboard to complete such an emoticon. Nevertheless completing-read seems to have satisfied an existing need for a simple mechanism to implement selection. There are packages in Emacs that do this, but they all have to re-implement selection interfaces, as there is no default way of doing it (that I know of). Think of recentf's menu or more complex examples such as reftex's TOC, that includes hierarchical structures. It might therefore be necessary to actually implement a "selecting-read" function, that could be used more or less like completing-read, but that provides a better default UI not based around completing text but actually selecting objects/items. [0] https://norvig.com/spell-correct.html [1] https://git.sr.ht/~zge/kaomoji --=20 Philip K. =20