unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* how to determine the current table (really) being used for minibuffer completion?
@ 2009-09-25 17:20 Drew Adams
  2009-09-25 20:01 ` Stefan Monnier
  0 siblings, 1 reply; 8+ messages in thread
From: Drew Adams @ 2009-09-25 17:20 UTC (permalink / raw)
  To: emacs-devel

Since the Emacs 23 changes to minibuffer completion, there is little doc, and
there are few doc strings. It's not always obvious how to determine the current
state of evaluation.

In particular, when completion tables are tried in sequence under the covers,
how is it possible to know at some point which table is actually being tried?
For example, how to know, during file-name completion, whether the table
currently being tried is `(completion--make-envvar-table)' or
`(completion--file-name-table)'?

We have the global variable `minibuffer-completion-table', but that is
apparently useless in this context. That var might be bound to some function
`foo', but that doesn't mean that it is `foo' that is actually trying to perform
completion at the moment, since completion now can involve several completion
attempts using different tables (e.g. functions), successively.

For example, the table (function) `read-file-name-internal', which is the value
of `minibuffer-completion-table', is now an alias for the closure returned by
this:

(completion-table-in-turn 'completion--embedded-envvar-table
                          'completion--file-name-table)

So not only is checking `minibuffer-completion-table' against
`read-file-name-internal' useless, there is no way to know which of the two
tables (functions) tried in turn is actually being used at a given time. Unless
I'm missing something.

How about (at least) recording in some global var the table that is currently
being used/tried?





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

end of thread, other threads:[~2009-09-27 18:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-25 17:20 how to determine the current table (really) being used for minibuffer completion? Drew Adams
2009-09-25 20:01 ` Stefan Monnier
2009-09-25 21:22   ` Drew Adams
2009-09-26  1:53     ` Stefan Monnier
2009-09-26 14:58       ` Drew Adams
2009-09-26 21:26         ` Stefan Monnier
2009-09-27  0:02           ` Drew Adams
2009-09-27 18:24             ` 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).