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: Stepping Back: A Wealth Of Completion systems Re: [ELPA] New package: vertico Date: Fri, 09 Apr 2021 20:51:13 +0200 Message-ID: <87im4vfdzz.fsf@gnu.org> References: <9c9af088-580f-9fb1-4d79-237a74ce605c@inventati.org> <874kgkxxs0.fsf@posteo.net> <3ec7e2e58a100426a22e@heytings.org> <877dleb2px.fsf@posteo.net> <87blaq5amw.fsf@posteo.net> <87o8eplxgt.fsf@posteo.net> <1a701fa9-52e9-df8c-562a-6e793e2347a1@daniel-mendler.de> <87k0pcufsl.fsf@gnu.org> <311f38fe-c622-4d77-7422-787fd369e79b@daniel-mendler.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21234"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.5.11; emacs 28.0.50 Cc: emacs-devel@gnu.org To: Daniel Mendler Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Apr 09 21:36:39 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 1lUwvm-0005Qu-VW for ged-emacs-devel@m.gmane-mx.org; Fri, 09 Apr 2021 21:36:38 +0200 Original-Received: from localhost ([::1]:52464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUwvl-0002va-T6 for ged-emacs-devel@m.gmane-mx.org; Fri, 09 Apr 2021 15:36:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUwuL-0001ec-TA for emacs-devel@gnu.org; Fri, 09 Apr 2021 15:35:09 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57676) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUwuL-0002F6-2N; Fri, 09 Apr 2021 15:35:09 -0400 Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:45521) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.82) (envelope-from ) id 1lUwuF-0006xz-SE; Fri, 09 Apr 2021 15:35:04 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailauth.nyi.internal (Postfix) with ESMTP id 9E4BA27C0054; Fri, 9 Apr 2021 15:35:03 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 09 Apr 2021 15:35:03 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudekuddgudegfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfhgfhffvufffjgfkgggtsehttd ertddtredtnecuhfhrohhmpefvrghsshhilhhoucfjohhrnhcuoehtshguhhesghhnuhdr ohhrgheqnecuggftrfgrthhtvghrnhepveevieekteekveeigfefffeivdetgeduvdffue euudevgedttdehvdfhueevfffhnecukfhppeekjedrudeifedrfedurdduheegnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomh gvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdel kedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmh 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 85E65240054; Fri, 9 Apr 2021 15:35:02 -0400 (EDT) In-reply-to: <311f38fe-c622-4d77-7422-787fd369e79b@daniel-mendler.de> 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:267747 Archived-At: Daniel Mendler writes: Hi Daniel, >> I'm not sure that's what your are asking but one thing that comes to >> mind is that when I want to find the file >> ~/Repos/el/emacs/lisp/doc-view.el >> I can just do >> C-x C-f reeld >> and that will already expand to ~/Repos/el/emacs/l/d if >> `completion-styles' contains `initials' (and >> `read-file-name-completion-ignore-case' set to t). Now depending on >> what I type further, it'll also switch between lisp/ or lib/ directory. >> AFAIK, that's not really supported with (most) alternative completion >> UIs where the possible completions are always the files of the currently >> selected directory. > > The completion you describe works with Vertico. The candidate set is > updated accordingly in the UI. > > (setq completion-category-overrides nil) > (setq completion-category-defaults nil) > (setq completion-styles '(initials)) > (vertico-mode) Indeed, I've just tried it out. > However what does not work is the further narrowing in an Orderless > fashion (your lisp/lib selection). This is what I assume you want to > do? Well, I've guessed that already the `initials' completion wouldn't work at all. So with my recipe above I've got ~/Repos/el/emacs/lib/deps/ as the first completion candidate. When I TAB there, it'll expand to just that. In order to find ~/Repos/el/emacs/lisp/doc-view.el, it seems I need to scroll the list of possible completions which is very long. > One could use both initials+orderless completion styles, but then one > would also need a feature in the completion system which locks the > current candidate set. There is the Restricto package by Omar, who is > also the author of Orderless. Restricto essentially replaces the > minibuffer-completion table with the current candidate subset - a bit > of a hack if you ask me. Yes, probably, but it helps in the situation I sketched. Well, but I guess the better way to find doc-view.el with vertico is to just do C-x C-f reel Hit TAB on the ~/Repos/el/emacs/lisp/ candidate being pretty much on top of the list. do BTW, more a question to the list (and Stefan in particular): I actually have several emacs worktrees ~/Repos/el/emacs/ ~/Repos/el/emacs-27/ ~/Repos/el/emacs-native-comp/ With the `completion-category-overrides' (file (styles basic partial-completion initials)) (actually, just `initials' suffices) and the input ~/Reeld the expansion is ~/Repos/el/emacs/l/d, and the completion help just shows lib/d*, lisp/d*, and lwlib/d* files. Shouldn't it also consider {lib,lisp,lwlib}/d* in emacs-27/ and emacs-native-comp/? When I rename the emacs-27 directory to e27, it'll include the files in there. So the reason seems to be that my emacs-*/ worktrees start with emacs and TAB expands to the shortest possibility neglecting longer ones. It seems like the files below ~/Repos/el/emacs-27/ is completely inaccessible in the presence of ~/Repos/el/emacs/ using the initials style. Of course, when I move point to ~/Repos/el/emacs|/l/d (| being point) and hit TAB, I can complete any emacs-* worktree. > The idea is basically to lock the candidate set and switch between > completion styles. This feature does not seem to be available in the > Emacs completion mechanism directly. I understand the idea but I'm not sure how convenient it would be to enable/disable styles using key bindings during completion. In general, I prefer if it just does what I want. ;-) Bye, Tassilo