unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Questions about the `completing-read-function' interface
@ 2015-04-17  9:59 Oleh Krehel
  2015-04-17 14:10 ` Drew Adams
  2015-04-17 14:18 ` Stefan Monnier
  0 siblings, 2 replies; 11+ messages in thread
From: Oleh Krehel @ 2015-04-17  9:59 UTC (permalink / raw)
  To: emacs-devel


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



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-04-17 19:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-17  9:59 Questions about the `completing-read-function' interface Oleh Krehel
2015-04-17 14:10 ` 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

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).