unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Oleh Krehel <ohwoeowho@gmail.com>
To: emacs-devel@gnu.org
Subject: Questions about the `completing-read-function' interface
Date: Fri, 17 Apr 2015 11:59:57 +0200	[thread overview]
Message-ID: <87lhhrxeg2.fsf@gmail.com> (raw)


Hi all,

I'd like to know, if a function calls `completing-read', should the
members of DEF be inside COLLECTION? I haven't found info on this in the
doc, and `completing-read-default' doesn't seem to handle DEF not being
in COLLECTION.

But, for instance, `magit-completing-read' (and some other functions) do
make that assumption. And `helm-mode' has code to deal with that.  I'm
thinking of adding a similar work-around to `ivy-mode' as well, but
maybe it would be better if it was somehow mandated that DEF should be
in COLLECTION. Because, theoretically, DEF can be a list, and it would
be inefficient for the completion engine to go through the whole
collection just to make sure that DEF isn't there, and then add it
there.

As second question is about this interface:

    (setq completing-read-function 'foo)

We've accumulated a bunch of packages that call this: icomplete-mode,
helm-mode, icy-mode, ivy-mode. If these functions are called in
succession, each of them will think that they are on, however, the
resource (`completing-read-function') will belong only to the last one.

Maybe we could have this type of interface:

    (set-completing-read-function 'foo callback)

So that each time `set-completing-read-function' is called, the current
minor mode is properly shut down in the callback.  We could keep the
current interface for single-use completion through a let binding. But
all the minor modes mentioned would use `set-completing-read-function'.

Oleh



             reply	other threads:[~2015-04-17  9:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-17  9:59 Oleh Krehel [this message]
2015-04-17 14:10 ` Questions about the `completing-read-function' interface Drew Adams
2015-04-17 14:32   ` Oleh Krehel
2015-04-17 15:06     ` Drew Adams
2015-04-17 14:18 ` Stefan Monnier
2015-04-17 14:47   ` Oleh Krehel
2015-04-17 15:31     ` Stefan Monnier
2015-04-17 15:40       ` Oleh Krehel
2015-04-17 18:04         ` Stefan Monnier
2015-04-17 18:15           ` Oleh Krehel
2015-04-17 19:05             ` Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lhhrxeg2.fsf@gmail.com \
    --to=ohwoeowho@gmail.com \
    --cc=emacs-devel@gnu.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).