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

completing-read-multiple behaves as if REQUIRE-MATCH were non-nil #907

Closed
tarsius opened this Issue Mar 1, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@tarsius
Contributor

tarsius commented Mar 1, 2017

When ivy-mode is enabled, completing-read-multiple always behaves as if its REQUIRE-MATCH argument were non-nil.

@abo-abo

This comment has been minimized.

Owner

abo-abo commented Mar 1, 2017

ivy-mode does this:

(when ivy-do-completion-in-region
  (setq completion-in-region-function 'ivy-completion-in-region))

completing-read-multiple calls read-from-minibuffer. While in the minibuffer, TAB calls completion-in-region-function.

At this point, require-match is not passed from anywhere. I set it to t since my most common use of TAB is during eval-expression, and :require-match t makes sense in that case.

It's easy to change to require-match nil, but this results in a loss of convenience during eval-expression. Suggestions welcome.

@tarsius

This comment has been minimized.

Contributor

tarsius commented Mar 1, 2017

I'll look into it, if you don't come up with something first. But I probably won't get to it soon. Could you please assign this issue to me, so that it shows up in my version of https://github.com/issues/assigned.

@tarsius

This comment has been minimized.

Contributor

tarsius commented Mar 7, 2017

Maybe :require-match (not (eq (current-local-map) crm-local-completion-map)) would work. But I don't know anymore why I thought that it was necessary that ivy-completing-in-region did not just always use t. I can enter arbitrary values even without this, provided I do it before pressing TAB.

@abo-abo abo-abo closed this in d9d7592 Mar 7, 2017

@abo-abo

This comment has been minimized.

Owner

abo-abo commented Mar 7, 2017

I'm still not sure how ivy-completion-in-region should perform if the input did not match any of the candidates.
Since the completion was initiated for the prefix, the prefix is now erased and the new thing is inserted. I wonder if the prefix should be kept.
On the other hand, keeping the prefix is just equivalent to canceling the completion and typing the thing in manually.

@tarsius

This comment has been minimized.

Contributor

tarsius commented Mar 7, 2017

I am also quite unsure what the best approach is... Ah, well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment