abo-abo/swiper

ivy-completing-read with require-match doesn't permit ivy-use-selectable-prompt

Opened this issue · 0 comments

Note: I think this is a duplicate/regression of #1924

I'm using Ivy Version: 0.14.2, GNU Emacs 31.0.50

I've run into a conflict between completing-read and ivy-completing-read.

completing-read takes the argument REQUIRE-MATCH, the definition of which includes:

REQUIRE-MATCH can take the following values:

  • t means that the user is not allowed to exit unless the input is (or
    completes to) an element of COLLECTION or is null.

That is, if REQUIRE-MATCH is set to t, I can select any of the targets, or the empty string. To demonstrate, try this:

(message "You selected: %s"
	 (completing-read "test: " '("one" "two" "three") nil t))

When I use ivy-mode, I set ivy-use-selectable-prompt to t, which should allow me to select the empty prompt. However, it seems that the function ivy--prompt-selectable-p over-rides this user setting when the call to completing-read sets the REQUIRE-MATCH argument to t.