|
From: | Daniel Mendler |
Subject: | Re: Stepping Back: A Wealth Of Completion systems Re: [ELPA] New package: vertico |
Date: | Fri, 9 Apr 2021 10:53:09 +0200 |
On 4/9/21 8:21 AM, Tassilo Horn wrote:
Daniel Mendler <mail@daniel-mendler.de> writes:I use the default completion system, so for me it is not about filtering a data set but expanding a string. Just to reiterate, this is exactly the point I am bringing this up.Well, but what does this mean in the context of opening a file? I guess, you are not interested in the string (the file name) alone but in the end you want to select a file?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<TAB> 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)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? 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. And probably Icicles supports something like this out of the box?
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.
Daniel Mendler
[Prev in Thread] | Current Thread | [Next in Thread] |