Subject: bug#70792: 30.0.50; [PATCH] Add Eshell support for expanding absolute file names within the current remote connection

From: Michael Albinus <[email-masked]>
Date: Wed, 08 May 2024 20:17:27 +0200

Eli Zaretskii <[email-masked]> writes:

Hi,

>> There's just one open question with this: if I'm on a remote system, how
>> do I type the fully-qualified *local* file name? I propose using "/:" as
>> the prefix to mean "always look on the local host", so "/:/etc/foo.log"
>> is a local file name no matter what. For this case, I'm open to other
>> spellings, so long as we have *some* way to fully-qualify a local file name.
>
> I think "/:" quoting should not change the host of the file name.
> That's because the user might need this quoting for file names on the
> remote host.
>
> If the user wants to specify a local file name while default-directory
> is remote, the user can use the normal Tramp "/METHOD:..." notation.

FTR, we *have* already two different kinds of quoting. "/:<something>"
makes <something> local, whatever syntax it has (for example, Tramp file
name syntax).

"/method:user@host:/:<something>" makes <something> "local" on
"/method:user@host:" whatever syntax it has.

--8<---------------cut here---------------start------------->8---
(expand-file-name "/:/ssh::.emacs") => "/:/ssh::.emacs"
(file-truename "/:/ssh::.emacs") => "/:/ssh::.emacs"
(file-remote-p "/:/ssh::.emacs") => nil
(file-local-name "/:/ssh::.emacs") => "/:/ssh::.emacs"

(expand-file-name "/ssh::/:.emacs") => "/ssh:gandalf:/:.emacs"
(file-truename "/ssh::/:.emacs") => "/ssh:gandalf:/:/home/albinus/.emacs"
(file-remote-p "/ssh::/:.emacs") => "/ssh:gandalf:"
(file-local-name "/ssh::/:.emacs") => "/:.emacs"
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.