Skip to content

completion-at-point triggers ivy completion but I don't want it for in-buffer completion #367

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

Closed
tsdh opened this issue Jan 29, 2016 · 2 comments

Comments

@tsdh
Copy link
Contributor

tsdh commented Jan 29, 2016

Due to lack of time, I didn't follow ivy and emacs development closely in the last months. I use a current emacs from the emacs-25 branch together with swiper 20160129.104 from MELPA.

The problem I face since recently is that M-TAB (calling completion-at-point) now triggers ivy completion instead of the traditional emacs completion which would simply complete up to the longest common prefix string and show a Completions buffer if it can't complete any further. So now with M-TAB I'm put into the minibuffer with ivy completion.

I really love ivy but how can I opt out for using it for in-buffer completion? I didn't find any customization variable that seemed relevant.

Steps to reproduce:

  1. Maybe you need emacs 25 and the MELPA swiper package
  2. emacs -Q
  3. M-x package-initialize RET & M-x ivy-mode RET
  4. Switch to scratch in case you're not there
  5. Insert "(d" and hit M-TAB and you're put into the minibuffer with ivy completion
@abo-abo
Copy link
Owner

abo-abo commented Jan 29, 2016

Welcome back:)

Too bad you don't like ivy's completion in region, I thought it was a universal improvement over the defaults, so there was no way to disable it.

Example 1

In *scratch*, | is the point:

(with-n|)

C-M-i results in:

(with-no-warnings|)

without a completion session, because it's a single candidate.

Example 2

(d|)

C-M-i results in ivy completion with 1118 candidates, restricted to ones that start with d. Note that you can use C-M-n to cycle matching candidates: they will appear in the buffer right away.

Without ivy-mode, it results in a huge *Completions* window popping up, with 563 lines, 2 candidates on each line.

Summary

I think with ivy-mode the completion is region becomes far easier. You can now disable it by setting ivy-do-completion-in-region. But I'd appreciate pointers to make it as good or better than the default.

@tsdh
Copy link
Contributor Author

tsdh commented Jan 29, 2016

My full story is that I already use company-mode for in-buffer completion and almost never have a need for M-TAB. However, I use (setq tab-always-indent 'complete) so a normal TAB might either indent or complete, the latter triggering ivy in region completion.

One thing which I got used to is that the standard emacs completion places point after the completed symbol even if it actually didn't need to complete anything and the current symbol already was the single possible match, e.g., with (do|list M-TAB results in (dolist| where | is point. I'd suggest that ivy acts likewise. (I have the habit to use that as a kind of forward-symbol. I know that's a bit awkward but TAB is just convenient. ;-))

And sometimes, when there are many completions, I do like a Completions buffer because it is usually 2 columns wide, sorted, and I can easily scroll it page-wise by just hitting TAB again. (I guess I can sort the ivy in region candidates, too, right?)

That said, I also see the positive sides of ivy in region. It's just triggered too often when I don't want it. (I'm constantly tabbing out of habit...)

What I could imagine was that the ivy in region completion was triggered only when I call completion-at-point interactively (M-TAB) but not when that is called by something else like indent-for-tab-command (TAB) in my case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants