From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: how to determine the current table (really) being used for minibuffer completion? Date: Fri, 25 Sep 2009 16:01:19 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1253911415 5283 80.91.229.12 (25 Sep 2009 20:43:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Sep 2009 20:43:35 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Drew Adams" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 25 22:43:28 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MrHdX-0007XM-I1 for ged-emacs-devel@m.gmane.org; Fri, 25 Sep 2009 22:43:27 +0200 Original-Received: from localhost ([127.0.0.1]:49172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrHdX-0002hO-2k for ged-emacs-devel@m.gmane.org; Fri, 25 Sep 2009 16:43:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MrGyt-0004Zh-OR for emacs-devel@gnu.org; Fri, 25 Sep 2009 16:01:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MrGyo-0004X3-4V for emacs-devel@gnu.org; Fri, 25 Sep 2009 16:01:26 -0400 Original-Received: from [199.232.76.173] (port=50670 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrGyn-0004Ww-WA for emacs-devel@gnu.org; Fri, 25 Sep 2009 16:01:22 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:45801) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MrGyn-0006sG-DL for emacs-devel@gnu.org; Fri, 25 Sep 2009 16:01:21 -0400 Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id n8PK1Js1009832; Fri, 25 Sep 2009 16:01:19 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 8C4A53A227; Fri, 25 Sep 2009 16:01:19 -0400 (EDT) In-Reply-To: (Drew Adams's message of "Fri, 25 Sep 2009 10:20:46 -0700") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3371=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:115631 Archived-At: > 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