[Top][All Lists]

[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 10:36:56 -0700

On 8/31/2023 6:58 AM, Michael Albinus wrote:
Jim Porter <jporterbugs@gmail.com> writes:

The one edge case I'm not quite sure what to do about is: how should
we spell "the user's home directory on localhost"? Using "/:~" *could*
work (in that Eshell could recognize it and do the right thing), but
it's also the way that you spell "the file named ~" elsewhere in
Emacs. (Eshell would spell that \~ or '~'). Maybe that's not such a
big deal though: we can just document this corner case and hope users
don't get *too* confused.

IIUC, "~" in a file name means always the home directory when it is the
first character (of the local part in remote file names), or it comes
after a slash like in "/~". See (info "(elisp) File Name Expansion")

The main thing I'm worried about is this: if we say that in Eshell, "/foo/bar" is relative to the current remote host, then the same should be true for "~": it would refer to your remote homedir when applicable.

Then we'd want a way to refer to your *local* homedir no matter where you are. If we use "/:/foo/bar" to refer to the always-local "/foo/bar", then we might say "/:~" means your local homedir. 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".

I *think* what we'd want to do is to say, "Eshell's quoted file names work slightly differently from quoted filenames elsewhere in Emacs. Since Eshell expands tildes in file names on its own, '/:~' always means your local home directory. If you want to refer to a file whose name is tilde, you can use Eshell's escape sequences (etc, etc)."

I'll try to put together a patch that does this, and then people can try it out and see if it makes sense.

reply via email to

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