From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Suraj Acharya Newsgroups: gmane.emacs.devel Subject: Re: Filename completion for the 'file widget Date: Wed, 25 Aug 2004 15:34:08 -0700 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: <412BD771.7010601@yahoo.com> <412CBF60.9030305@yahoo.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1093473322 19140 80.91.224.253 (25 Aug 2004 22:35:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 25 Aug 2004 22:35:22 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 26 00:34:46 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1C06Lt-0008BW-00 for ; Thu, 26 Aug 2004 00:34:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C06QT-0000yA-Ko for ged-emacs-devel@m.gmane.org; Wed, 25 Aug 2004 18:39:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1C06QM-0000xk-Ah for emacs-devel@gnu.org; Wed, 25 Aug 2004 18:39:22 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1C06QL-0000xM-Ir for emacs-devel@gnu.org; Wed, 25 Aug 2004 18:39:21 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1C06QL-0000xJ-H0 for emacs-devel@gnu.org; Wed, 25 Aug 2004 18:39:21 -0400 Original-Received: from [80.91.224.249] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1C06LN-0007Ns-AZ for emacs-devel@gnu.org; Wed, 25 Aug 2004 18:34:13 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1C06LJ-0006HL-00 for ; Thu, 26 Aug 2004 00:34:12 +0200 Original-Received: from 63.96.165.58 ([63.96.165.58]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 26 Aug 2004 00:34:09 +0200 Original-Received: from sacharya by 63.96.165.58 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 26 Aug 2004 00:34:09 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 40 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 63.96.165.58 User-Agent: Mozilla Thunderbird 0.7.1 (Windows/20040626) X-Accept-Language: en-us, en In-Reply-To: <412CBF60.9030305@yahoo.com> 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: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:26502 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:26502 Kevin Rodgers wrote: > Suraj Acharya wrote: > > Kevin Rodgers wrote: > >> That doesn't seem right. I was going to suggest something like > > > > Why do you say it's not right? It gives me the behavior I expect, ie > > relative paths stay relative and I still get completion for them. It > > uses default-directory for the current buffer as the base for the > > relative path completion. > > I was confusing the necessity of file-name-as-directory (which Stefan > correctly pointed out in his response) with the functionality of > expand-file-name. Sorry! > > ... In this particular case I think file-name-as-directory isn't required because the directory name comes from file-name-directory which the docs hint might always add a file separator character at the end. > > >> But it's not clear to me (1) why widget-file-complete expands the > >> pattern nor (2) why it can safely assume the pattern has a non-nil > >> directory that can be passed as the second arg to > >> file-name-completion. > > > > (2) is definitely a bug. Asking for completion in a blank 'file widget > > gives "let*: Wrong type argument: stringp, nil" in the minibuffer. > > It looks to me like it would fail any time the widget doesn't contain > a directory separator, since e.g. (file-name-directory "foo") returns > nil. (And isn't it file-name-completion that signals the error, not > let*?) Yes, I was just indicating that there's at least one case where the code throws an error and so is buggy. Suraj