積丹尼 Dan Jacobson <[email protected]> writes:

Hi Dan,

> Users would often like to add ~ or //bla_bla
> to the end of e.g.,
> /adb::/sdcard/DCIM/mei/temp/
> as the usual emacs shortcut to just a local directory,
> but tramp does not detect it.

A double slash or "/~" expand only the file name part of the remote file
name:

(substitute-in-file-name "/adb::/sdcard/DCIM/mei/temp//") => "/adb::/"
(substitute-in-file-name "/adb::/sdcard/DCIM/mei/temp/~") => "/adb::~"

For remote file names to expand to the local file name, you need an
additional slash:

(substitute-in-file-name "/adb::/sdcard/DCIM/mei/temp///") => "/"
(substitute-in-file-name "/adb::/sdcard/DCIM/mei/temp//~") => "~"

See also the Tramp manual (info "(tramp) File name completion")

Best regards, Michael.

_______________________________________________
Tramp-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/tramp-devel
  • // and ~ 積丹尼 Dan Jacobson
    • Re: // and ~ Michael Albinus

Reply via email to