reddit / emacs

Idea/Question: Using "feature-full" packages (e.g. dired) for completion?

BlueFlo0d · 2022-09-08 04:27
I like completion frameworks on the featureful/heavy-weight side a lot. I use helm and use helm actions heavily to accomplish things within a completion session (e.g. moving files, grepping). However, the more I use it, the more I think: it would be much better if it's a full dired! I like the multiple column view of \`helm-buffers-list\`. It in fact just imitates the native \`list-buffers\`, but in a pretty hacky way (it use spaces to pad each completion items to make it look like a table). I've written my own \`describe-functions\` and \`describe-variables\` sources that uses similar hack to give me a column of function argument list/variable value and documentation. It would be much better if we just use \`tabulated-list-mode\`, or some blend of it and the native \`\*Apropos\*\` buffer! In general I feel like lots of functionalities are implemented twice, once as a "feature-full" package, once as a simplified version in helm. My question is then: Is there any completion framework based on the idea of wrapping "feature-full" package out there? Do you think this is a sensible idea? I haven't looked much into other popular completion frameworks (ivy, vertico, etc), because I get the impression that they're typically at the more "light-weight" side of helm so are probably not what I want. Feel free to correct me.
MitchellMarquez42 · 2022-09-08 04:38
This is a good idea but I'm pretty happy with vertico+embark for operating on completions.
lebensterben · 2022-09-08 05:05
helm or ivy are really not "featureful" comparing to vertico/selectrum + emabark + marginalia and their supporting packages.
[deleted] · 2022-09-08 07:07
[deleted]
7890yuiop · 2022-09-08 07:18
It sounds like any such integrations would be very specific to the "feature-full" package in question, so you may as well implement all the heavy lifting there, and have a light-weight wrapper in your completion code. For dired, you can pass your filename completions to `dired` directly: (dired '("DIR" "FILE1" "FILE2" ...))
alexluigit · 2022-09-08 16:47
A demo on searching (by name) and copying files using dirvish: [https://user-images.githubusercontent.com/16313743/189178518-9655acee-7f30-4b03-82e6-64c6fa8da410.mp4](https://user-images.githubusercontent.com/16313743/189178518-9655acee-7f30-4b03-82e6-64c6fa8da410.mp4) Repo: [https://github.com/alexluigit/dirvish](https://github.com/alexluigit/dirvish)
eleven_cupfuls · 2022-09-08 17:47
I am not entirely sure I understand your suggestion, but it sounds like you should have a look at the `:affixation-function` (or `:annotation-function` for pre-28) properties for completion: https://www.gnu.org/software/emacs/manual/html_node/elisp/Completion-Variables.html#Completion-Variables These allow "decorating" the completion candidate with extra information that is displayed but isn't matched by what the user types. For example, when looking at `M-x` candidates the first line of the command docstring could be displayed alongside. I can't find anything that seems to discuss them in detail, but [Marginalia](https://github.com/minad/marginalia) is a package that applies them widely in completion. And [here is a simple example for customized file completion](https://gitlab.com/woolsweater/dotemacs.d/-/blob/6753ee87f2d490ed4bb0358c46c5ccfd8845e6bc/startup/builtin.el#L496).