Hi Eshel, Eshel Yaron writes: > Thanks for the feature request and for the patch. Thanks for the incredibly quick feedback and thoughtful comments. I really appreciate it. I've attached a patch addressing the first comment and will post an additional patch for a possible fix to the second comment. > That sounds interesting. The ELPA package capf-autosuggest.el provided > a similar feature, IIRC. I'd like to get a better understanding of the > use case though: when would you use one of these commands instead of > completion-preview-complete? This is a functionality that I got used to when I tried using some other packages. One issue that I have with completion on the "common" part of candidates is that oftentimes when using thing functionality in my shell I have so many candidates from my history that the common part is relatively useless. Generally I'd say that I'm so comfortable navigating with forward-word and forward-sexp that this using M-f and C-M-f for this is second nature to me. Given that this is also implemented in `capf-autosuggest` and `github-copilot` I imagine that others might feel the same way. > 1. AFAICT, unlike completion-preview-insert, these new commands should > preserve (the rest of) the completion preview. So instead of > dismissing the preview by disabling completion-preview-active-mode > and then relying on the subsequent post-command-hook to recreate the > preview, I think these commands should modify (e.g. remove a word > from the start of) the after-string property of the preview overlay, > and inhibit a subsequent update of the preview, like we do in > completion-preview-complete. That way we avoid recomputing the > completion candidates, which may lead to a flicker in this case. Ahh that is a really good point, thank you. > 2. The temporary buffer where the motion command is executed has a > different major mode than the original buffer, so they might have > different notions of words/sexps. I was thinking about that when implementing this, even further one could have locally changed the value of `find-word-boundary-function-table` outside of `subword-mode`. One idea I had thought of was inserting the complete after-string and performing character deletions until the suffix was removed but this felt like an even worse solution. Maybe, in the temporary buffer, we can bind `find-word-boundary-function-table` to the parent buffer's value. I need to hop on a flight but can implement this in a third patch. - Jules