emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs syntax for filenames to mean "absolute location on the current


From: Jim Porter
Subject: Re: Emacs syntax for filenames to mean "absolute location on the current remote host"?
Date: Fri, 1 Sep 2023 11:36:02 -0700

On 9/1/2023 11:13 AM, Michael Albinus wrote:
Jim Porter <jporterbugs@gmail.com> writes:

But the Emacs manual says:

‘/:’ can also prevent ‘~’ from being treated as a special character
   for a user’s home directory.

So according to that rule, "/:~" would mean "the file named tilde in
the current directory".

Hmm, I've never stumbled over this sentence in the manual. And it is a
little bit vague: "can also prevent".

A short test shows that it doesn't if the tilde comes directly after the 
quoting:

--8<---------------cut here---------------start------------->8---
M-x cd RET /net RET
M-x pwd
   => /net
M-x cd RET /:~ RET
M-x pwd
   => /home/albinus

M-x cd RET /:~user RET
M-x pwd
   => /home/user
--8<---------------cut here---------------end--------------->8---

It even works for remote file names (although there are still some quirks):

--8<---------------cut here---------------start------------->8---
C-x C-f /ssh:ford:/:~ RET
   => dired buffer of remote user's home directory
--8<---------------cut here---------------end--------------->8---

What doesn't work are file names like "/:/tmp/~hack", as said in the manual.

Huh. I never realized it worked that way (though I never actually *tried* this case).

I think the first thing I'll do then is to try and understand *exactly* how quoted file names work, and then update the manual to clarify this. Once I know exactly how they work, it should be easier to be sure that I won't mess anything up with these Eshell improvements.



reply via email to

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