Subject: bug#12331: 24.1; completing-read when COLLECTION has exactly one element

From: "Roland Winkler" <[email-masked]>
Date: Mon, 3 Sep 2012 11:26:07 -0500

On Mon Sep 3 2012 Stefan Monnier wrote:
> > chosen it deliberately. If nonethless we ask the user what he or she
> > wants even though there is only one choice available, it much
> > reminds of one of my least favorite operating systems.
> 
> The motivation sounds good, but the minibuffer prompt always offers one
> more choice, i.e. C-g.  So accepting the only choice without prompting
> might end up being a bit too eager in some cases.

Sure, under any circumstances I would not want to make this a
default for completing-read. I merely suggest that there are
scenarios where shortcutting the invocation of the minibuffer can be
reasonable. And I hope you don't mind we give this a try for the
particular example of ibuffer-switch-to-saved-filter-groups
described in my previous email.

> I think so, yes.  So I suggest you look for callers where that could be
> used, and if they are common enough, we could consider adding a special
> value of `require-match' which would allow such a short-circuiting.

The least questionable examples are, in my opinion, those cases
where the elements in the list COLLECTION reflect a choice the user
made earlier (such as COLLECTION being a user variable defaulting to
nil).

I'll see whether I'll find more cases of that kind.

Roland