Subject: bug#27193: 25.2; tmm should use completing-read-default

From: Dmitry Gutov <[email-masked]>
Date: Sat, 3 Jun 2017 01:24:45 +0300

On 6/3/17 1:19 AM, Drew Adams wrote:

> "Adhere to the contract of `completing-read-function'"?
> Are you kidding?  What contract is that?

So the docstring is not written out fully and seriously enough. Even so, 
it's not hard to understand.

>   (defvar completing-read-function 'completing-read-default
>     "The function called by `completing-read' to do its work.
>   It should accept the same arguments as `completing-read'.")
> 
> Just accept the arguments - that's the only contract.
> "Do the work" of `completing-read' is completely vague.

Yup. If the value of this variable accepts the arguments and performs 
completion,

> That means that anytime you can come up with a function that
> accepts those args and causes trouble, `completing-read-default'
> should be imposed as the only possible value.

Pretty much. Except we don't consider the very extremes, like completer 
functions trying to break examples like this intentionally.

So not "a function" but "any reasonable function". It's Emacs, after all.

>> I'll install the submitted patch in a few days if someone
>> doesn't beat me to it.
> 
> Of course you will.

Thanks for the encouragement.

>>> The result is not even recognizable as completing-read.
>>>
>>> I don't think so. Certainly no more unrecognizable than Ido...
>>
>> You are mixing up concepts right and left. E.g. APIs with their callers.
> 
> Nonsense.  Ido's completion behavior is as far from that of
> vanilla `completing-read' as is Tmm's completion behavior
> ("the result").

Ido is one of the API's possible implementations. TMM is its caller. 
Comparing them doesn't make any sense.