From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: how to determine the current table (really) being used for minibuffer completion? Date: Fri, 25 Sep 2009 10:20:46 -0700 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1253899276 30418 80.91.229.12 (25 Sep 2009 17:21:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Sep 2009 17:21:16 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 25 19:21:09 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 1MrETl-0005Wl-B5 for ged-emacs-devel@m.gmane.org; Fri, 25 Sep 2009 19:21:09 +0200 Original-Received: from localhost ([127.0.0.1]:45027 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrETk-0002jC-8z for ged-emacs-devel@m.gmane.org; Fri, 25 Sep 2009 13:21:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MrETe-0002iw-NQ for emacs-devel@gnu.org; Fri, 25 Sep 2009 13:21:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MrETa-0002iZ-59 for emacs-devel@gnu.org; Fri, 25 Sep 2009 13:21:02 -0400 Original-Received: from [199.232.76.173] (port=39516 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrETZ-0002iW-Ux for emacs-devel@gnu.org; Fri, 25 Sep 2009 13:20:57 -0400 Original-Received: from rcsinet12.oracle.com ([148.87.113.124]:41485 helo=rgminet12.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MrETZ-0008A1-KV for emacs-devel@gnu.org; Fri, 25 Sep 2009 13:20:57 -0400 Original-Received: from rgminet13.oracle.com (rcsinet13.oracle.com [148.87.113.125]) by rgminet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n8PHKYvt002206 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 25 Sep 2009 17:20:35 GMT Original-Received: from abhmt010.oracle.com (abhmt010.oracle.com [141.146.116.19]) by rgminet13.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n8PHLGi9004948 for ; Fri, 25 Sep 2009 17:21:16 GMT Original-Received: from dradamslap1 (/141.144.66.80) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 25 Sep 2009 10:20:48 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: Aco+BITSgZH0VAVwRmOaybIIK5u9SA== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: abhmt010.oracle.com [141.146.116.19] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090207.4ABCFBF1.0086:SCFSTAT5015188,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) 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:115621 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. 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?