tramp-devel
[Top][All Lists]
Advanced

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

[PATCH] Fix hostname completion on MS Windows


From: Jim Porter
Subject: [PATCH] Fix hostname completion on MS Windows
Date: Wed, 7 Apr 2021 13:31:24 -0700

This patch resolves an MS Windows-specific issue with file name completion for Tramp: currently, when trying to complete a Tramp hostname (or method/user), it fails to match anything on MS Windows (however, completing the remote path works ok). This is because `file-name-completion' provides handlers with an absolute path to match against, but on MS Windows, that means the path starts with the volume letter, e.g. "c:/ssh:host:/path/to/file".

The attached patch fixes things for me; it's somewhat hacky, since it tries to recognize the mutilated path string as shown above. However, changing that would (probably) be an invasive change to how core Emacs handles file name completion. This also mirrors the behavior of `tramp-drop-volume-letter', so hopefully it's ok. I *think* this only applies to windows-nt systems and not cygwin (which usually uses *nix-style paths), but I don't have Cygwin installed so I didn't try it there.

I don't have copyright assignment papers filled out, but hopefully this patch is small enough that that's not necessary. If you think it is, just let me know and I'll get that handled.

As a small addendum: this patch still doesn't fix things when `default-directory' is a UNC path (e.g. "\\server\mnt\"), but the same issue applies to `tramp-drop-volume-letter', and this case should be rare in practice anyway.

- Jim

Attachment: 0001-tramp.el-tramp-completion-file-name-regexp-default.patch
Description: Binary data


reply via email to

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