unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: tramp-devel@gnu.org, emacs-devel@gnu.org
Subject: Re: CORRECT VERSION:  tramp (2.0.51); tramp and file-name-all-completions
Date: Tue, 18 Oct 2005 01:05:37 +0200	[thread overview]
Message-ID: <m3ek6jeoce.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <nqfyr0mb0f.fsf@alcatel.de> (Michael Albinus's message of "Mon, 17 Oct 2005 17:14:08 +0200")

Michael Albinus <michael.albinus@gmx.de> writes:

> 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.

What code will I need to be 2.1 compatible?

>>
>> (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@"))

This still cause the "Login Failed" error...

In any case, I don't quite understand how to use this.  How can ido
know whether it makes sense to set tramp-completion-mode or not?

I have this function in ido to identify filename which may be handled
by a tramp file name handler.  Is there a better way?

(defun ido-is-tramp-root (&optional dir)
  (and ido-enable-tramp-completion
       (string-match "\\`/[^/]+[@:]\\'"
		     (or dir ido-current-directory))))


My best solution is to try to eliminate such calls.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

  parent reply	other threads:[~2005-10-17 23:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-15 22:04 CORRECT VERSION: tramp (2.0.51); tramp and file-name-all-completions Kim F. Storm
2005-10-17  4:49 ` Michael Albinus
2005-10-17 13:58   ` Kim F. Storm
2005-10-17 15:14     ` Michael Albinus
2005-10-17 17:46       ` Stefan Monnier
2005-10-18  8:51         ` Michael Albinus
2005-10-17 23:05       ` Kim F. Storm [this message]
2005-10-18  8:47         ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3ek6jeoce.fsf@kfs-l.imdomain.dk \
    --to=storm@cua.dk \
    --cc=emacs-devel@gnu.org \
    --cc=tramp-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).