Subject: bug#27158: 25.2; Eliminating old usage of completing-read from built-in files

From: Drew Adams <[email-masked]>
Date: Wed, 31 May 2017 19:23:12 -0700 (PDT)

> > The value of that variable is supposed to accept the same
> > args as `completing-read'.  Understood is that `completing-read'
> > just passes its args along to the value of `completing-read-function'.
> 
> That will change.

I certainly hope not, a priori.  No good reason has been given
for that.  Just a trumpian pronouncement of a change to come.

> > Anything else makes it impossible for `completing-read-function'
> > to be as general as it should be.
> 
> (defun completing-read (prompt collection &optional predicate
>                                 require-match initial-input hist def
>                                 inherit-input-method)
>    (funcall completing-read-function
>             prompt collection predicate require-match
>             initial-input hist (or def "") inherit-input-method))
> 
> should suffice.

It doesn't suffice.  This should suffice, as advertised:

 (funcall completing-read-function
          prompt collection predicate require-match
          initial-input hist def inherit-input-method)

And in your `completing-read-function': (setq def (or def "")).
End of story.  It really seems like you are making a mountain
out of a mole hill.  You want DEF = nil to act like DEF = "".
Big deal.  Just do that in the right place: inside your
`completing-read-function'.

> > What prevents you from making `completing-read' behave that
> > way (or any other way) within your context?  Why is it
> > insufficient for you to do that in your value of
> > `completing-read-function' or by advising `completing-read'
> > for the duration?
> 
> My context is "the whole of Emacs". That's what Ido Ubiquitous
> is supposed to be affecting and improving.

Really?  Even when `ido-ubiquitous-mode' is off?

What about users who do not want to use `ido-ubiquitous-mode'?
Do they count too?  Do you mean that all of Emacs will succumb
to `ido-ubiquitous-mode'?  Will you be expecting all Emacs users
and libraries to adhere to the "improvement" of Ido Uber Alles?

Not every user is an Ido user.  `completing-read' does not
belong to Ido - it is more general than the restricted
behavior you've been pitching.  Having nil DEF act like ""
is a special case.

If that behavior is contained within `ido-ubiquitous-mode'
then that mode should already be able to impose whatever
completion behavior it wants.

Isn't that fair enough: Keep Ido Ubiquitous completion
behavior for `ido-ubiquitous-mode', and not for all of
Emacs and all the time?

And it should be able to do that without changing anything in
`completing-read' or `completing-read-function'.  And if it
does need to change the value of `completing-read-function'
for the duration, it can do that.  And if it needs to advise
`completing-read' for the duration, it can do that.  That
seems clear enough.  Your mode can use any kind of completion
it wants.

Again: What prevents you from making `completing-read' behave
that way (or any other way) within your context?  Why is it
insufficient for you to do that in your value of
`completing-read-function' or by advising `completing-read'
for the duration?

No answer.  Just a statement that your context is the World
Of Emacs, that you "will change" the behavior not just for
Ido Ubiquitous but for all of Emacs.  Sheesh.

Please do whatever you need to do to `completing-read'
inside the mode only.  That's why it's a mode.  That's
why it's called `ido-ubiquitous-mode' and not "Emacs".

I change the behavior of `completing-read' considerably
more than what you've described, but I do it only inside
`icicle-mode'.  When the mode is off, the vanilla behavior
returns to `completing-read'.  Not a big deal.  Normal.

Icicles completion too applies to "the whole of Emacs".
That's what Icicles "affects and improves".  And it
does so only when Icicle mode is on.

I don't see why `ido-ubiquitous-mode' can't act similarly.
What's so special about it, that it needs to not only
modify `completing-read' behavior when the mode is on
but modify more generally, for all uses, regardless of
whether `ido-ubiquitous-mode' is on?