reddit / emacs

Multi-step multi select

ilemming · 2022-04-07 22:29
What's the best method of selecting multiple items that preserves the state between the choices? [when using ivy/vertico/helm/etc] e.g., - search the project using a term, - select an item from the results; - initiate another search with a different term, - choose another item; - repeat as needed Every time you search & choose, items get appended into some buffer. After you're done collecting the items, you can feed them into some other function. Has anyone seen a package that does something similar?
[deleted] · 2022-04-08 12:35
[removed]
[deleted] · 2022-04-08 14:07
[deleted]
cradlemann · 2022-04-09 18:49
embark?
ilemming · 2022-04-10 20:28
And? I don't think I've ever seen anything similar to what I've described that's done using Embark. I'm contemplating if this can be done with transient.el. An explanation could be something like this: - Transient popup opens with two key prefixes: "g - Gather"; and "d - Execute" - User presses "g" - it opens consult/ivy/etc to lets you select items (but transient stays open) - You select an item (pressing RET) - The selected item appears on the same transient popup (on the right side, where there's a dedicated area) - Then, if you choose to do so, you can press "g" again and add another item (and keep repeating the process until all required items are in the list) - After all the desired items are in the list, the user may choose to press "d" - and execute a command that involves using the collected items. Transient closes, the result of the final action appears on the screen. One good practical example of why something like that could be useful is Org/Org-roam for finding cross-linked items, e.g., I need to find all the items related to "programming", "psychology" and "natural language processing". For something like that, one needs to build a UI that would allow you to select each of these categories from the global list of notes one category at a time. The problem though - I don't think transient.el allows adding arbitrary items into popups. Things that aren't keyboard actions. That's not what it is made for.