unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: emacs-devel@gnu.org
Subject: Re: how to determine the current table (really) being used for minibuffer completion?
Date: Fri, 25 Sep 2009 16:01:19 -0400	[thread overview]
Message-ID: <jwvzl8ikdjj.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <FA5695D9503345B5977692721561042D@us.oracle.com> (Drew Adams's message of "Fri, 25 Sep 2009 10:20:46 -0700")

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

I do not know what you mean.  Please give a concrete example showing how
you used to do it in Emacs-22.

> 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?

If you mean uses of completion-table-in-turn: you can't and neither
could you in Emacs-22; and this is not strictly a change in the
minibuffer completion but in the implementation of some completion
tables (yes, I made changes to both because the minibuffer completion
changes needed some adjustments in the competion tables to work better,
and because I wanted to rewrite in Lisp the C implementation of some of
the completion tables, and because I wanted to give the code more
structure).

> 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)'?

You can't (and neither could you before, AFAICT).
Could you give us some context to beter understand when you need it?

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

It does mean that `foo' is the table that does the completion.
That table may be decomposed into several distinct cases, but that's
nothing new.  The same was already the case when completing for
Info-goto-node, for example.

> So not only is checking `minibuffer-completion-table' against
> `read-file-name-internal' useless,

Comparing functions is usually a bad idea.  Sometimes, there's not much
else we can do, admittedly.

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

It's not even clear what that would mean.


        Stefan




  reply	other threads:[~2009-09-25 20:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=jwvzl8ikdjj.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=drew.adams@oracle.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).