-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More maintainable solution for Selectrum-based commands #234
Comments
I think having a package which provides and maintains useful
I think the only cases which currently require Selectrum are those which use dynamic swapping of candidate sets by your input pattern and those which gather data from text properties of the result: The former could probably also be replicated passing a dynamic completion function to The latter will be possible to some extend in Emacs 28 where we get |
Cool! The problem I am seeing with something like this is only that it is some kind of kitchen sink package, which is not clearly limited. However if some functionality grows larger, it could be moved to another separate package, in order to avoid that such a thing grows beyond any bounds.
In my understanding, the license of the wiki/project documentation coincides with the project license. But we should clearly state if some work is derived from something else, e.g. ivy.
What I find interesting about this, is that given more data regarding this, one could propose an improved completing-read api for upstream, if it is necessary after all. I thought about this before in #225. Regarding the details you wrote, I am not yet such familiar with all those. I think we will see case-by-case if completing-read is sufficient or not. Only one thing, I wonder, what about this selectrum-switch-buffer+ function? Would something like this be out of reach or is it possible with completing-read? I am a bit divided what to do about functions which would need more than completing-read. I see the following options:
It seems to me either option 1 or 2 are acceptable. What do you think, @clemera? |
I'm not sure, maybe it would be possible with some hacks and removing the issues I mentioned with dynamic candidate sets.
I think I would prefer to only include completing-read commands, maybe there could be a separate package for commands which currently require selectrum. |
Point in case, as to why a dedicated package would be nicer than a wiki: The |
@hpdeifel Yes, better maintenance is certainly a reason. Furthermore we automatically get access to all the commands which are deemed good enough for such a package without having to manually copy them from the wiki. |
Okay, seeing issues like #232, and a large number of previous ones containing code snippets with various One option---and feel free to suggest others---would be to do a thing similar to So we could perhaps have a If we end up with a bunch of functions in And I find the idea of calling such a package |
You may be surprised to learn that I don't use any of them... which probably explains why I haven't pushed for a more maintainable solution until now, sorry :o |
@raxod502 No, I am not really surprised. I looked at your radian config before. And I generally like your more minimalist approach to things. Instead of doing the selectrum-x file, I propose to have a separate package. This is cleaner and otherwise we end up with a monorepo like swiper which contains swiper, ivy and counsel. If we generally like the "consult" name I would just go with that, instead of chosing a more selectrum-related name. What I've heard from @clemera, he prefers to have most commands not selectrum-specific, which would also point to having a separate package. It is one of the main reasons for me to use selectrum, since it integrates with the Emacs defaults. So maybe we should not deviate from that approach. I am also willing to help maintain such a thing, this wasn't a request to have this in selectrum. However it would be ideal if some more elisp experienced folks like @clemera or you would co-maintain or somehow help out. I think the package should also be up to the quality standards of this package, otherwise there is not really a point in doing this. |
I think what @raxod502 suggested would be good fit for commands which require selectrum. For framework agnostic commands I agree with @minad that they are better placed in a separate package. I also like "consult", for searching it may be beneficial to also include the term "completion" as in "consult-completion" if that sounds still good. I don't want to spend to much time with such a package currently but I'm happy to help out if I can. |
@clemera Regarding the name, I like "consult" more. I tend to prefer descriptive names like "completion-utils" or completely free names like "consult", but I am not in favor of mixing both naming schemes. This feels better if the package gets split up at some point, e.g., "consult-selectrum" and "consult". Regarding the maintenance it would be very nice to get a review and some consultation here and there ;) @raxod502 Do you prefer to have a |
@clemera Thank you! Yes I've seen the wiki page! |
I started something at https://github.com/minad/consult. I will step-by-step add the functions from the wiki when I have time. We will see how this goes. Please let me know if you want to be added to the repository, have some comments (@raxod502, @clemera, @okamsn). |
Chiming in only to say that keeping |
Update: I added a bunch of functions to the consult repository. If some of you are interested, it would be great to get some feedback or maybe you have time to test if the commands work in your setup. Maybe some things don't work or feel odd. Please let me know. Furthermore I would be interested in hearing about commands you would like to have added. Any kind of feedback is appreciated! |
Update: Since consult is already quite usable, I opened a PR on melpa melpa/melpa#7255 and a PR here which links to consult #238. Now some of the commands also feature live preview+recursive editing: consult-buffer, consult-mark, consult-outline and consult-line. consult-theme also supports preview when scrolling through candidates. Another small update: I improved the live preview support and consult-buffer such that the package is now fully compatible with icomplete (consult-buffer on icomplete is a bit less powerful however). The library is almost completion-system agnostic now, which is pretty nice. |
Closing this. It would be great if we can get a link in the readme, see #238. |
This looks awesome! Great work @minad! |
Feel free to ping me if you need help with anything. |
@raxod502 Thank you! If you have suggestions, please let me know! |
There are many useful commands in the wiki which might profit from a more maintained and packaged solution. Basically it would be nice to have an alternative to the ivy counsel package, which uses the completing-read mechanism and maybe only falls back to selectrum if more functionality is required. Ideally the package should not have a hard dependency on selectrum. Hopefully such a package would be much much smaller than counsel.el, since many Emacs functions already work out of the box with completing-read and don't need counseling. However there are still some others which do more than only completion, e.g. the switch-buffer function with support for virtual buffers (recent files, bookmarks etc). Things like this could go into such a new and simple "consult" package ;)
@raxod502 How are you organizing such things? Do you keep such things in your radian Emacs config? And you @clemera?
The text was updated successfully, but these errors were encountered: