From: Drew Adams <drew.adams@oracle.com>
To: Dmitry Gutov <dgutov@yandex.ru>,
Ryan Thompson <rct@thompsonclan.org>,
27158@debbugs.gnu.org
Subject: bug#27158: 25.2; Eliminating old usage of completing-read from built-in files
Date: Thu, 1 Jun 2017 07:57:26 -0700 (PDT) [thread overview]
Message-ID: <bdc25c2e-5903-4dd2-a5b6-b5080677eee2@default> (raw)
In-Reply-To: <b415fc7e-42c2-e822-7de5-8eba8f3b0cd5@yandex.ru>
> >> (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.
>
> Citation needed.
No "citation" needed.
`completing-read-function' needs to have the same signature
as `completing-read'.
I am the one who requested `completing-read-function' and
pushed to have it added to Emacs. Its purpose is to easily
let you change the _complete_ behavior of `completing-read',
just by binding a variable.
That requires passing it exactly the same arguments, to do
as it pleases with them. If, as in your case, it wants to
act as if DEF were in fact `(or DEF "")', it can do that.
If you want to simulate an explicit DEF when none is present,
that's easy enough to do in the function that is your value
of `completing-read-function'. You don't need to force that
on all uses of `completing-read-function'.
Changing the signature of `completing-read-function' in the
way you suggest makes all uses of `completing-read-function'
follow the path you've outlined for `ido-ubiquitous-mode'.
That's a particular kind of completion. No thanks.
And no need. You don't need that, to make your mode do
what you want. If you disagree, please show da codez: a
simple example that doesn't work and for which you see no
possible solution.
> >> 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?
>
> Obviously not. Also not when it's not installed, in case you
> were wondering.
In that case, it's obvious that you can do whatever you need
inside the mode. Do your (setq def (or def "")) there, for
use only by your mode. You haven't shown why you think you
cannot do that.
> > 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.
>
> You fail at reading.
Nonsense. Why can't you use `completing-read-function' to
do what you want in your mode?
> > 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.
>
> And yet, you haven't contributed anything helpful to this
> discussion so far.
Ooooh.
Please say why you cannot do what you need for just your mode.
`completing-read' is not intended to have only the behavior
you want. But it is designed to _let you get_ the behavior
you want, as well as other behaviors.
There is a reason for the DEF argument, a reason for it to
be optional, and a reason for its default value to be "".
All of which I've gone over.
This thread was started by a misconception of what DEF is
for, thinking that it is useless. It may be useless - or
even an obstacle to be worked around - for your use case,
but it is not useless for Emacs.
DEF was even expanded several releases ago, to allow a
value that is a list of default values. Those too likely
don't fit your narrow use case. Default values are
intentionally not completion candidates. And yes, in
general they are useful, even if not for your use case
of `completing-read'.
If your use case calls for no default values, or in effect
wants to treat them as completion candidates, it's easy
enough for you to do that. That is not the general,
default, intentional treatment of DEF by `completing-read'.
next prev parent reply other threads:[~2017-06-01 14:57 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-31 4:41 bug#27158: 25.2; Eliminating old usage of completing-read from built-in files Ryan
2017-05-31 5:52 ` Drew Adams
2017-05-31 11:45 ` Ryan Thompson
2017-05-31 14:51 ` Drew Adams
2017-05-31 12:23 ` Dmitry Gutov
2017-05-31 14:51 ` Drew Adams
2017-05-31 14:59 ` Dmitry Gutov
2017-05-31 15:19 ` Drew Adams
2017-05-31 15:44 ` Ryan Thompson
2017-05-31 22:41 ` Dmitry Gutov
2017-05-31 23:16 ` Drew Adams
2017-05-31 23:54 ` Dmitry Gutov
2017-06-01 2:23 ` Drew Adams
2017-06-01 9:27 ` Dmitry Gutov
2017-06-01 14:57 ` Drew Adams [this message]
2017-06-01 20:53 ` Dmitry Gutov
2017-06-01 21:04 ` Ryan Thompson
2017-06-05 23:01 ` Dmitry Gutov
2017-06-06 0:06 ` Ryan Thompson
2017-06-06 0:09 ` Dmitry Gutov
2017-05-31 21:20 ` Dmitry Gutov
2020-08-24 14:58 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bdc25c2e-5903-4dd2-a5b6-b5080677eee2@default \
--to=drew.adams@oracle.com \
--cc=27158@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
--cc=rct@thompsonclan.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.