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

From: Eli Zaretskii <[email-masked]>
Date: Wed, 08 May 2024 21:32:42 +0300

> Date: Wed, 8 May 2024 09:13:59 -0700
> Cc: [email-masked]
> From: Jim Porter <[email-masked]>
> 
> On 5/8/2024 6:20 AM, Eli Zaretskii wrote:
> > 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.
> 
> Not to say we *should* do this, but if we kept the "/:" syntax of my 
> patch, a user could still /:-quote a remote file name in Eshell by using 
> the fully-qualified name like: "/ssh:user@remote:/:/blah".
> 
> I can construct an argument for why using /: this way in Eshell would 
> make sense, but maybe it's just needlessly "clever"...

We do need the ability to quote like "/ssh:user@remote:/:/blah".
That's why I think quoting should not "escape to local".  Another
reason that I think "/:" quoting should not escape to local is that
"/:" is for protecting file names from being interpreted as
referencing another host; a simple name like "/foo/bar/baz", when
quoted as "/:/foo/bar/baz", should resolve to itself.

> (As a note, Eshell already uses /:-quoting to mean "on the local host" 
> in one spot: for the command to run. However, I added that for Emacs 30, 
> so we can still change it without worrying about compatibility issues. 
> See the manual here for more info: 
> <https://git.savannah.gnu.org/cgit/emacs.git/tree/doc/misc/eshell.texi#n1534>.)

I think we should remove that before we release Emacs 30.  It's wrong
to interpret quoting this way.

> > If the user wants to specify a local file name while default-directory
> > is remote, the user can use the normal Tramp "/METHOD:..." notation.
> 
> How about a new "local" method? Then users would type 
> "/local::~/some-file.txt". That's more typing, but it's also more clear, 
> and doesn't repurpose an existing syntax used elsewhere in Emacs.

Don't we already have that with "/localhost:" or somesuch?

> If I go this route, I'm not sure whether it would be better to make 
> "local" a real file name handler available everywhere in Emacs despite 
> only being useful for Eshell, or if Eshell should just strip out the 
> "/local::" prefix before sending it to other parts of Emacs. I'm leaning 
> towards the former though, since the latter seems like a hack that could 
> have unforeseen consequences.

I'd like Michael's opinion on this, since we will be "invading" the
Tramp methods space.