From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: CORRECT VERSION: tramp (2.0.51); tramp and file-name-all-completions Date: Mon, 17 Oct 2005 17:14:08 +0200 Message-ID: References: <87r7aklpcf.fsf@gmx.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1129562178 13844 80.91.229.2 (17 Oct 2005 15:16:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 17 Oct 2005 15:16:18 +0000 (UTC) Cc: tramp-devel@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 17 17:16:09 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ERWhX-0000SH-UF for ged-emacs-devel@m.gmane.org; Mon, 17 Oct 2005 17:15:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ERWhX-0005Pv-8S for ged-emacs-devel@m.gmane.org; Mon, 17 Oct 2005 11:14:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ERWhI-0005Oz-0F for emacs-devel@gnu.org; Mon, 17 Oct 2005 11:14:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ERWhC-0005Mc-MZ for emacs-devel@gnu.org; Mon, 17 Oct 2005 11:14:43 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ERWh8-0005Iv-Rp; Mon, 17 Oct 2005 11:14:34 -0400 Original-Received: from [194.113.59.95] (helo=mailrelay1.alcatel.de) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ERWh8-00072H-Jp; Mon, 17 Oct 2005 11:14:34 -0400 Original-Received: from slbwba.alcatel.de (slbwba.bln.sel.alcatel.de [149.204.93.70]) by mailrelay1.alcatel.de (8.12.10/8.12.10/ICT TSC MAIL 2005) with ESMTP id j9HFE8G0022231; Mon, 17 Oct 2005 17:14:08 +0200 Original-To: storm@cua.dk (Kim F. Storm) In-Reply-To: (Kim F. Storm's message of "Mon, 17 Oct 2005 15:58:27 +0200") User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/20.7 (hpux) X-Scanned-By: MIMEDefang 2.49 on 149.204.45.72 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:44187 Archived-At: storm@cua.dk (Kim F. Storm) writes: > I used it in ido, and it seems to work: > > ;; work around bug in ange-ftp. > ;; /ftp:user@host: => nil > ;; /ftp:user@host:./ => ok > (and > (not (string= "/ftp:" dir)) > (or > (string-match "\\`/ftp:.*:\\'" dir) > (and (string= tramp-default-method "ftp") > (string-match "\\`/[^/:]+:\\'" dir))) > (file-name-all-completions "" (concat dir "./")))))) This works for Tramp 2.0. It will work for Tramp 2.1 too, but there are also other means to derive a default methold. For the time being you might use a comment for this. > There are still a small problem (I have worked around them in ido, > so a fix is not urgent.) > > E.g. if I try > > (file-directory-p "/telnet:kfs@") > or > (file-directory-p "/telnet:kfs@:") > > tramp signals "Login failure" in both cases. I know. This problem has eaten most of the time yesterday. In fact I don't know a safe decision whether a file name shall be completed only or "applied". Therefore I've introduced a new variable tramp-completion-mode, which is set in file-name-all-completions. Sensible Tramp file name functions, which need to behave depending on the mode, check this variable (beside other checks). So you might use it as well (untested, I'm @work): (let ((tramp-completion-mode t)) (file-directory-p "/telnet:kfs@")) Best regards, Michael.