-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
Command wishlist #6
Comments
An equivalent to counsel-linux-app would be great. |
@doolio For now I am focused on the core commands, which are Emacs related and uncontroversial. But certainly some of the others like accessing linux apps could be added as well. Since I am not experienced with ivy, I would love some kind of usage statistics or experience reports regarding the most used commands. For example there is counsel-rythmbox which I doubt to be useful for many people. Then there are other commands which are already covered better by other packages I guess. |
I would really like the selectrum-info command. Also, I'd like a command for selecting org capture templates akin to counsel-org-capture-string and something to select org tags like |
|
|
Apologies for the multiple messages. I took inspiration from my current init file, and my todo list. |
That makes sense. |
Yes, please open PRs! We can discuss over there then! |
Is this needed? imenu already uses completing-read for me? Take a look at the function
Same question here. I am not sure if this should be part of consult. I think selectrum alone can already do this by itself. What do you use for completion? Selectrum? |
Ah yes, I'm suggesting This is what |
I use icomplete. It sounds like Selectrum somehow manages to act as the Completion buffer. I'll look into it, thanks. |
Thank you I got it. It is flattening the imenu. There is already flimenu for that but I look into if I can do anything about that here. flimenu also looks like a pretty simple package which does nearly nothing. The confusion thing is that the imenu on my Emacs already looks flat, I don't know what is causing this. But my overall feeling is that consult is not the right place to add something like this if it can be easily solved on another level. |
Perfect, thanks. |
I wrote this function, @tomfitzhenry: (defun completing-read-in-region (start end collection &optional predicate)
"Prompt for completion of region in the minibuffer if non-unique.
Use as a value for `completion-in-region-function'."
(if (and (minibufferp) (not (string= (minibuffer-prompt) "Eval: ")))
(completion--in-region start end collection predicate)
(let* ((initial (buffer-substring-no-properties start end))
(limit (car (completion-boundaries initial collection predicate "")))
(all (completion-all-completions initial collection predicate
(length initial)))
(completion (cond
((atom all) nil)
((and (consp all) (atom (cdr all)))
(concat (substring initial 0 limit) (car all)))
(t (completing-read
"Completion: " collection predicate t initial)))))
(if (null completion)
(progn (message "No completion") nil)
(delete-region start end)
(insert completion)
t)))) To use it you just |
@oantolin Cool, please do! |
This might be out of the scope of consult but here goes. I have also wanted a richer set of org refile functions. Right now org-refile is very limited in the sense that the files have to be in the |
@Luis-Henriquez-Perez please describe a bit more precisely what these functions are supposed to do. It is nice to have a bit more context. There is a plethora of functionality in Emacs and not everyone is aware of everything. |
The function would move subtrees to different places. They would be very similar to the function that doom has to address this same problem. |
I sometimes wish ispell used completing-read when prompting you for a spelling correction. |
Have you tried the package |
Thanks, @okamsn! I'll be sure to check it out, it looks like there are a bunch of UIs to choose from (I bet I'll land on avy). By the way, I think I fixed your file dialog problem with embark. |
What about a function to open a file in the default application for it according to the operating system? It would use |
@oantolin I think |
I am completely fine with that, @minad. But for future reference, can you explain why you think it fits better into an action library? Here's the code from embark (suggestively renamed :P). As you can see it has no embark-specific details in it at all. It is a useful function, that uses completion to select a file and then opens it: (defun consult-open-externally (file)
"Open FILE using system's default application."
(interactive "fOpen: ")
(if (and (eq system-type 'windows-nt)
(fboundp 'w32-shell-execute))
(w32-shell-execute "open" target)
(call-process (pcase system-type
('darwin "open")
('cygwin "cygstart")
(_ "xdg-open"))
nil 0 nil
(expand-file-name file)))) Is it because it relies on external commands that you think it shouldn't be in consult? (That would be a reasonable reason, but is it your reason?) |
Sorry, I misunderstood - I thought it is only used as an action, I should have looked more closely. What you propose selects a file, opens it externally, that's perfectly fine and I think it belongs here. Please make a PR. Why is the counsel function called like this with the "action" in the name? EDIT: I just saw |
|
Why not just use consult-line (no multi) for that? |
Because it's faster. |
yeah I just wanted describe-symbol. Thanks! |
(defun consult-line-multi-current-buffer ()
(interactive)
(consult-line-multi
(list :predicate (lambda (buf) (eq buf (current-buffer)))))) |
It seems |
Oh, I guess I had never tried Do people really use the filtering stage of For buffer switching based on buffer contents |
On 8/7/23 16:24, Omar Antolín Camarena wrote:
Oh, I guess I had never tried |consult-line-multi| before, @minad
<https://github.com/minad>. It has the same two-step search & filter UX
that consult-grep has, but both searching and filtering are done in
Emacs. If I understood correctly, the search part does
|re-search-forward| on the first component regexp and for each matching
line checks if all other components are found there as well. So this is
an Emacs Lisp loop for what |(let ((completion-regexp-list ...))
(all-completions ...))| does with a loop in C. So whether |consult-line|
or a single-buffer variant of |consult-line-muti| is faster depends on
your completion styles: if you use |flex| exclusively, then
single-buffer |consult-line-multi| wins; if you use, say, Orderess with
only orderless-literal, then probably |consult-line| wins.
The main difference is the startup overhead. `consult-line` has to
allocate all the candidates first, while `consult-line-multi` collects
the candidates given the input.
Do people really use the filtering stage of |consult-line-multi|?
Probably not, I would guess, since the search part is already basically
a reimplementation of Orderless. :)
Not sure, but the value similar as for `consult-grep`. You avoid
searching again through all the buffers and instead just filter the
matches. This may matter if you have many large buffers. Anyway, we get
the two-level search feature for free since it already exists for
`consult-grep`. See also `consult-info` which works the same way.
For buffer switching based on buffer contents |consult-line-multi| looks
great, specially the default of using only buffers in the current
project seems really handy; but it looks like for me personally a
single-buffer variant of |consult-line-muti| would not be very useful.
Agree.
|
Of course! I should have realized that! You keep trying to teach me allocation is expensive in Emacs, @minad, and I keep not quite getting it. 😄 |
That's the exact motivation :) especially for large buffers |
Hi, Any idea why
I'm using version 0.35 of |
@jgarte It does work with icomplete-vertical, but to get the results most people expect you need to configure your |
Hi, This is what I currently have set in my emacs config regarding icomplete-vertical: https://git.sr.ht/~whereiseveryone/emacsaroni/tree/master/item/init.el#L11
But isn't flex the default style and currently is not working with consult? I'll look into I'm currently not using |
No, it isn't on by default. It is however the style used by fido-vertical-mode, maybe that's what you were thinking of. |
TLDR: Should I be enabling your |
Or setting one of these? (use-package icomplete-vertical
:ensure t
:demand t
:custom
(completion-styles '(partial-completion substring))
(completion-category-overrides '((file (styles basic substring))))
(read-file-name-completion-ignore-case t)
(read-buffer-completion-ignore-case t)
(completion-ignore-case t)
:config
(icomplete-mode)
(icomplete-vertical-mode)
:bind (:map icomplete-minibuffer-map
("<down>" . icomplete-forward-completions)
("C-n" . icomplete-forward-completions)
("<up>" . icomplete-backward-completions)
("C-p" . icomplete-backward-completions)
("C-v" . icomplete-vertical-toggle))) |
No, using my icomplete-vertical wouldn't make any difference. Try something like |
What you posted also works. Thanks! |
I hardly ever use viper, but if I ever do use it, I want that configuration, @jgarte. In general I'm not a fan of modal user interfaces. Even |
@oantolin I like the expert level. It is even quoted for additional karma. :) (setq viper-expert-level '5) |
@oantolin Ok, the pain is too great with |
@jgarte Vertico is way better than icomplete! |
I think it is time to finally retire this long issue. I wonder how many people are still subscribed to this issue. ;) Thank you all for your participation and your contributions! Consult got to its current state thanks to your help and feedback. I hope you still like and use this package. If you have feedback feel free to reach out. I've just enabled the discussion on the Consult repository, where we can have feature discussions in the future. Support questions can also be asked there. |
todo/open for discussion
Seems feature complete? ;)
done
consult-info
dynamic info search based onconsult--dynamic-collection
. See Info manual commands needed #634 and Add a ‘consult-info’ command. #128 for an earlier draft. The wiki contains a version ofconsult-info
too.consult-line-multi
reimplementation based onconsult--dynamic-collection
(See More efficient consult-line-multi #644)consult-lsp
, available as a separate packageconsult-yasnippet
, available as a separate packageconsult-eglot
, available as a separate package,consult-org-clock-in
consult-org-heading
,consult-org-agenda
(See consult-org-heading, consult-org-agenda #276)consult-outline
by using theoutline-level
function (Add narrowing to consult-outline #277)consult-xref
show function, see xref branch and Add consult-xref. #216 implementedconsult-outline
extension for shell prompts (originallyconsult-prompt
which gives a list of all shell/terminal prompts), see consult-prompt UI #130 discussion. Instead of implementing an extension/extra command, set outline-regexp=eshell-prompt-regexp in the eshell-mode-hook as documented in the wiki.consult-focus-lines
which uses overlays in contrast to consult-keep-lines implementedconsult-keep-lines
with preview and filtering using the completion-style implementedconsult-kmacro
implementedconsult-completion-at-point
implementedconsult-flycheck
(see consult-flycheck #51, cycle through errors with preview) implementedconsult-imenu
implementedconsult-flymake
implementedconsult-global-mark
support for global mark ring, ideallyconsult-mark
should show both local and global marks and vial
andg
narrowing via can either narrow to the local ring or the global one implementedconsult-major-command
list commands corresponding to current major mode, similar to amx-major-mode-commands implemented asconsult-mode-command
consult-ripgrep
(see [WIP] Add first implementation of consult-search #68, consider using xref facilities, xref-search-program, xref-matches-in-files) See also https://github.com/travitch/completing-read-xref.el implementedconsult-match
jump to matches in the buffer, needs dynamic recomputation of candidates, similar toswiper-isearch
, implemented asconsult-line-multi
.rejected
consult-ripgrep/grep/...
(See Dirty hack to test transient popup with consult-grep #170 for a prototype, Command flag toggling support for consult--async-command #238). It would be great to have a transient interface implemented as a separate package, based onconsult-ripgrep
etc.consult-kill-lines
andconsult-copy-lines
variants ofkill/copy-matching-lines
in the style ofconsult-focus-lines
(see Command wishlist #6 (comment))consult-org-capture
(See Add org capture function #32 for a draft). I think capturing is better solved by access keys than by completing-read to quickly jump to a capture template.consult-link
(collect all shr/eww/org/buttons links in a buffer and present them for completion, see also Action, target finder, target collector and exporter wishlist oantolin/embark#95 - this gives us an embark target collector for free). Maybe this functionality should not be added here - it would be a better fit for the link-hint package. See alsoffap-menu
.consult-hippie
hippie or dabbrev expand (see First draft: consult-hippie #175 for a draft) rejected, not robust, see First draft: consult-hippie #175 discussion for alternative ideasconsult-fzf
and async functions which keep the background process alive (see experiment experiment: async find #189), the problem is thatfzf
,fzy
etc do not support a pipe-mode. Therefore we cannot use them efficiently, but this may change in the future. For now it is possible to configureconsult-find-command
with a pipe intofzf
. See https://github.com/minad/affeconsult-flyspell
, provided by see https://github.com/d12frosted/flyspell-correct, which usescompleting-read
by default, see also https://github.com/raxod502/selectrum/wiki/Additional-Configuration#correcting-spelling-errors-with-flyspell-correctconsult-flycheck/flymake/error
variants which shows the lines instead of the error. This could be built in to the existing commands via C-u? out of scope, no intention to implement this as of nowconsult-color
out of scope, not sufficiently useful, there are better UIs for color selection than completing-readconsult-emoji
out of scope, could be implemented on top of insert-char by modifying the minibuffer-predicate of read-char-by-name to restrict the character range, now available upstream in Emacs 29consult-linux-app
out of scope, available as a separate package https://github.com/SebastienWae/app-launcherconsult-help
interactive search through documentation, commands in M-x and other symbols (see Search in functions and their descriptions radian-software/selectrum#241 for the suggestion). Note that this is different from what is provided bymarginalia-mode
. I have an implementation in the consult-help branch, see implement consult-help command which allows to search all documentation strings #67. While it would be very nice, it is too slow to be useful. Maybe computing the candidates dynamically would help. not implemented, use embark collect instead for a searchable helpconsult-help
- implement generic function which allows to search through marginalia annotations, basically transforming candidates such that they also include the annotations and make them searchable. not implemented, use apropos-documentation or embark collect instead for a searchable helpconsult-binding
to browse keybindings, out of scope, useembark-bindings
ordescribe-bindings
+consult-focus-lines
/consult-keep-lines
Contributions and new proposals are welcome. Note that Consult focuses on Emacs core functionality. Integrations with external packages should be provided by external packages, e.g., consult-lsp, consult-notmuch, ...
In many cases it is sufficient to use the built-in Emacs completing-read functionality. Therefore dedicated consult-* packages may not be necessary.
The text was updated successfully, but these errors were encountered: