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: RE: Q on read-file-name and completion-ignored-extensions Date: Fri, 20 Jan 2006 08:34:27 -0800 Message-ID: References: <200601200233.k0K2XjC26200@raven.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1137790153 2377 80.91.229.2 (20 Jan 2006 20:49:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 20 Jan 2006 20:49:13 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jan 20 21:49:12 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1F03Bg-0002kQ-6Z for ged-emacs-devel@m.gmane.org; Fri, 20 Jan 2006 21:48:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F03EB-0001XI-3h for ged-emacs-devel@m.gmane.org; Fri, 20 Jan 2006 15:51:23 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EzzGD-0000bg-FB for emacs-devel@gnu.org; Fri, 20 Jan 2006 11:37:14 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EzzGA-0000aa-W0 for emacs-devel@gnu.org; Fri, 20 Jan 2006 11:37:11 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EzzG8-0000a4-RP for emacs-devel@gnu.org; Fri, 20 Jan 2006 11:37:09 -0500 Original-Received: from [148.87.122.30] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EzzKN-0004JM-As for emacs-devel@gnu.org; Fri, 20 Jan 2006 11:41:31 -0500 Original-Received: from rgmsgw300.us.oracle.com (rgmsgw300.us.oracle.com [138.1.186.49]) by rgminet01.oracle.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id k0KGYUXb029192 for ; Fri, 20 Jan 2006 09:34:30 -0700 Original-Received: from rgmsgw300.us.oracle.com (localhost [127.0.0.1]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id k0KGYUMi011778 for ; Fri, 20 Jan 2006 09:34:30 -0700 Original-Received: from dradamslap (dhcp-amer-rmdc-csvpn-gw5-141-144-107-196.vpn.oracle.com [141.144.107.196]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id k0KGYTx1011769 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Fri, 20 Jan 2006 09:34:29 -0700 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-reply-to: <200601200233.k0K2XjC26200@raven.dms.auburn.edu> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE 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:49328 Archived-At: I guess the reference to `file-name-all-completions' was mistaken, No, that reference is correct. `file-name-all-completions' is the function used internally by the commands that display completion lists and it is _really_ unaffected by `completion-ignored-extensions' (otherwise, there would be a bug). Note that `file-name-all-completions' is described in exactly the same Info node as `completion-ignored-extensions'. This does _not_ display the list (of all four files), even though TAB would normally display the list of possible completions in that case (since the common part is already in the minibuffer). The minibuffer commands do not ignore completion-ignored-extensions in deciding _whether_ to display lists of completions (as opposed to doing completion), it only ignores it _when_ it displays them. Is it perhaps true that the "displaying a list of completions" that shows ignored completions (even when there are non-ignored candidates) applies only to display by `?' and not to display by TAB? No, it affects TAB too, if TAB can not do completion, even ignoring all extensions in completion-ignored-extensions. As I explained, TAB takes completion-ignored-extensions into account in deciding whether it can do completion (as opposed to having to display a list of completions), but _after_ it decides that it has to display a list, it ignores the variable. Great. So, since none of that info is in the doc string or the manual, let's add it: Completion ignores file names ending in any string in this list. It ignores directory names if they match any string in the list that ends in a slash (/). However: - If all possible completions have ignored extensions, then those completions are not ignored. Example: If .ico is an ignored extension, and the only possible completions are fun.ico and fudge.ico, then those file names are available for completion: `C-x C-f fud TAB' completes to fudge.ico. - Displayed and returned lists of possible completions include file names, even if they have ignored extensions. This includes the completions displayed in buffer *Completions*, as well as the lists of completions returned by functions such as `file-name-all-completions'. File names with ignored extensions are ignored in deciding whether buffer *Completions* is to be displayed, but if it is displayed then it includes any matching file names with ignored extensions. Example: files fun.ico and fun.el, `C-x C-f fun. TAB' completes to fun.el, because fun.ico is ignored for completion. `C-x C-f fun ?' displays fun.el and fun.ico in *Completions*, because ignored file names are included whenever *Completions* is displayed. Reword as needed. The various points you've made should be addressed in a clear way, preferably with examples. The examples might be reserved for the Elisp manual, leaving the doc string simpler (if less clear): Completion ignores file names ending in any string in this list. It ignores directory names if they match any string in the list that ends in a slash (/). However: - If all possible completions have ignored extensions, then those completions are not ignored. - Displayed and returned lists of possible completions include file names, even if they have ignored extensions. This includes the completions displayed in buffer *Completions*, as well as the lists of completions returned by functions such as `file-name-all-completions'. File names with ignored extensions are ignored in deciding whether buffer *Completions* is to be displayed, but if it is displayed then it includes any matching file names with ignored extensions.