GNU bug report logs - #27193
25.2; tmm should use completing-read-default

Previous Next

Package: emacs;

Reported by: Ryan <rct <at> thompsonclan.org>

Date: Fri, 2 Jun 2017 04:52:01 UTC

Severity: minor

Tags: patch

Found in version 25.2

Fixed in version 26.1

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Drew Adams <drew.adams <at> oracle.com>, Ryan Thompson <rct <at> thompsonclan.org>,  27193 <at> debbugs.gnu.org
Subject: bug#27193: 25.2; tmm should use completing-read-default
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.




This bug report was last modified 7 years and 353 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.