From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Kim F. Storm" Newsgroups: gmane.emacs.tramp,gmane.emacs.devel Subject: CORRECT VERSION: tramp (2.0.51); tramp and file-name-all-completions Date: Sun, 16 Oct 2005 00:04:07 +0200 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1129413956 17840 80.91.229.2 (15 Oct 2005 22:05:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 15 Oct 2005 22:05:56 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: tramp-devel-bounces+tramp=quimby.gnus.org@gnu.org Sun Oct 16 00:05:55 2005 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EQu9m-0002WK-Kc for tramp@deer.gmane.org; Sun, 16 Oct 2005 00:05:34 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1EQu9m-000480-00 for ; Sun, 16 Oct 2005 00:05:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EQu9l-0006DW-L1 for tramp@quimby.gnus.org; Sat, 15 Oct 2005 18:05:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EQu92-00061D-On for tramp-devel@gnu.org; Sat, 15 Oct 2005 18:04:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EQu91-00060m-UC for tramp-devel@gnu.org; Sat, 15 Oct 2005 18:04:48 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EQu90-00060J-4D; Sat, 15 Oct 2005 18:04:46 -0400 Original-Received: from [195.41.46.237] (helo=pfepc.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EQu8z-0001n0-UP; Sat, 15 Oct 2005 18:04:46 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (0x503e2644.bynxx3.adsl-dhcp.tele.dk [80.62.38.68]) by pfepc.post.tele.dk (Postfix) with SMTP id 48C15262838; Sun, 16 Oct 2005 00:04:45 +0200 (CEST) Original-To: tramp-devel@gnu.org X-BeenThere: tramp-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: tramp-devel.gnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: tramp-devel-bounces+tramp=quimby.gnus.org@gnu.org Errors-To: tramp-devel-bounces+tramp=quimby.gnus.org@gnu.org Xref: news.gmane.org gmane.emacs.tramp:2868 gmane.emacs.devel:44096 Archived-At: PLEASE IGNORE MY PREVIOUS POST (Due to temporary brain power failure, I had swapped the args to file-name-all-completions, so the reported ERROR/OK was swapped too). THIS IS THE PROPER BUG REPORT. I'm trying to make ido work sensibly with tramp syntax -- but getting a grip on file-name-all-completions is really a nightmare. Ido uses file-name-all-completions to get a list of all possible completions of "the next component" to be entered by the user. Now, consider these tramp file name: /method:user@host:/file /user@host:/file /host:/file Ideally, ido would like to call file-name-all-completions like this: (file-name-all-completions "" "/method:") (file-name-all-completions "" "/method:user@") (file-name-all-completions "" "/method:user@host:") (file-name-all-completions "" "/method:user@host:/file") (file-name-all-completions "" "/user@") (file-name-all-completions "" "/user@host:") (file-name-all-completions "" "/host:") However, this does not always work -- look at these examples: ======== (file-name-all-completions "" "/telnet:") => ERROR: "Login Failed" Swapping the args works: (file-name-all-completions "/telnet:" "") => OK ======== (file-name-all-completions "" "/telnet:kfs@") => ERROR: Login Failed The desired result can be obtained with this call (swap args, remove leading / of first arg, add / to second arg): (file-name-all-completions "telnet:kfs@" "/") => OK ======== (file-name-all-completions "" "/telnet:kfs@localhost:") => OK ======== (file-name-all-completions "" "/telnet:kfs@localhost:/tmp") => OK ======== (file-name-all-completions "" "/kfs@") => (file-error "Opening directory" "no such file or directory" "/kfs@") Swapping the args works: (file-name-all-completions "/kfs@" "") => OK ======== (file-name-all-completions "" "/kfs@localhost:") => OK ======== (file-name-all-completions "" "/localhost:") => OK ======== I have made ido adapt to all these strange rules, but it is not very nice -- and I have to know whether /xxx: is a method or a host, since: (file-name-all-completions "" "/localhost:") => OK (file-name-all-completions "" "/telnet:") => ERROR (file-name-all-completions "/telnet:" "") => OK Emacs : GNU Emacs 22.0.50.54 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 2005-10-14 on kfs-l.imdomain.dk Package: tramp (2.0.51) -- Kim F. Storm http://www.cua.dk