Subject: bug#30324: 26.0.91; cd-absolute to tramp directory fails

From: Michael Albinus <[email-masked]>
Date: Fri, 02 Feb 2018 23:24:30 +0100

Rajeev Narang <[email-masked]> writes:

Hi Rajeev,

> When rlogin-directory-tracking-mode is set to t, rlogin directory tracking fails.
>
> This is because (cd-absolute "/USER@HOST:") fails in emacs-26.  The same call succeeds in emacs-25.

rlogin.el still speaks about FTP access. This has worked until Emacs 25,
because ange-ftp.el and tramp.el have used the same file name
syntax. While ange.ftp.el uses ftp to access, Tramp has a variety of
connection methods. In case of absence, the default connection method is
used, often "ssh".

With Emacs 26, Tramp's file name syntax has changed. A method name is
mandatory now, at least "-" as indicator for the default method. The
obvious simple fix is

diff --git a/lisp/net/rlogin.el b/lisp/net/rlogin.el
index 646adef2f0..3bfc4d7f35 100644
--- a/lisp/net/rlogin.el
+++ b/lisp/net/rlogin.el
@@ -219,7 +219,7 @@ rlogin
                ;; function, to avoid a gratuitous resync check; the default
                ;; should be the user's home directory, be it local or remote.
                (setq comint-file-name-prefix
-                     (concat "/" rlogin-remote-user "@" rlogin-host ":"))
+                     (concat "/-:" rlogin-remote-user "@" rlogin-host ":"))
                (cd-absolute comint-file-name-prefix))
               ((null rlogin-directory-tracking-mode))
               (t
@@ -253,7 +253,7 @@ rlogin-directory-tracking-mode
     (setq rlogin-directory-tracking-mode t)
     (setq shell-dirtrackp t)
     (setq comint-file-name-prefix
-          (concat "/" rlogin-remote-user "@" rlogin-host ":")))
+          (concat "/-:" rlogin-remote-user "@" rlogin-host ":")))
    ((< prefix 0)
     (setq rlogin-directory-tracking-mode nil)
     (setq shell-dirtrackp nil))

Could you pls test it? If it works, I propose to push it to the emacs-26
branch, because the patch is very simple (we know what we're doing,
don't we?), and it cures a regression from Emacs 25.

Eli?

Best regards, Michael.