emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Change Tramp syntax


From: Stefan Monnier
Subject: Re: Change Tramp syntax
Date: Sat, 11 Mar 2017 16:54:13 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

>>> Maybe we shall start a poll, in emacs-devel, emacs-help and
>>> tramp-devel. We should not ask what a user prefers (many of them will
>>> prefer not to type a method). They question must be what will be broken
>>> if we stop support for ange-ftp syntax "/host:/path/to/file".
>> Actually, there are several options, for example:
>> 1- Get rid of ange-ftp syntax altogether, like you propose.
>> 2- Keep the syntax, but only when it doesn't collide with the
>> Tramp syntax.  I.e. /fencepost:foo will still be allowed, but
>> if you want to access a host named "ssh" you'll need something like
>> /ftp:ssh:foo or /ssh:ssh:foo or /ssh.domain:foo or /address@hidden:foo.
>> I.e. /foo: will only be considered ange-ftp syntax if `foo` is not a method.
>> 3- Like 2 but treat /foo:./bar and /foo:/bar as an ange-ftp syntax even if
>> `foo` is a method.
> Currently, we have implemented option 2.

Hmm... then I don't understand why you need to handle completion differently
from non-completion.  Which cases currently misbehave if
tramp-completion-mode-p returns nil?

> But the check, whether the host name in /ssh:foo collides with
> a method, happens too late, because file name handlers are fired by
> parsing the file name, and not by additional checks (like a function
> call).

I don't understand this either.  Currently I see two Tramp entries in
f-n-h-alist:

 ("\\`/[^/]*\\'" . tramp-completion-file-name-handler)
 ("^/\\(\\(?:\\(?:\\([a-zA-Z_0-9-]+\\):\\)?\\(?:\\([^/|:        
]+\\)@\\)?\\(\\(?:[a-zA-Z0-9_.-]+\\|\\[\\(?:\\(?:\\(?:[a-zA-Z0-9]+\\)?:\\)+[a-zA-Z0-9.]+\\)?]\\)\\(?:#[0-9]+\\)?\\)?|\\)+\\)?\\(?:\\([a-zA-Z_0-9-]+\\):\\)?\\(?:\\([^/|:
        
]+\\)@\\)?\\(\\(?:[a-zA-Z0-9_.-]+\\|\\[\\(?:\\(?:\\(?:[a-zA-Z0-9]+\\)?:\\)+[a-zA-Z0-9.]+\\)?]\\)\\(?:#[0-9]+\\)?\\)?:\\(.*$\\)"
 . tramp-file-name-handler)

Neither of those regexps seems to handle an /ssh: prefix differently
from a /host: prefix.


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]