bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Dmitry Gutov
Subject: bug#27193: 25.2; tmm should use completing-read-default
Date: Sat, 3 Jun 2017 01:24:45 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101 Thunderbird/54.0

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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]