branch: elpa/crux commit 6ef681d853a2847472aae7095a74703310e391f8 Author: Riccardo Murri <riccardo.mu...@gmail.com> Commit: GitHub <nore...@github.com>
Ensure `vc-rename-file` gets the local file paths (#91) --- crux.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crux.el b/crux.el index 526b611b02..e7aa8aaf1f 100644 --- a/crux.el +++ b/crux.el @@ -420,7 +420,11 @@ there's a region, all lines that region covers will be duplicated." (containing-dir (file-name-directory new-name))) (make-directory containing-dir t) (cond - ((vc-backend filename) (vc-rename-file filename new-name)) + ((vc-backend filename) + ;; vc-rename-file seems not able to cope with remote filenames? + (let ((vc-filename (if (tramp-tramp-file-p filename) (tramp-file-local-name filename) filename)) + (vc-new-name (if (tramp-tramp-file-p new-name) (tramp-file-local-name filename) new-name))) + (vc-rename-file vc-filename vc-new-name))) (t (rename-file filename new-name t) (set-visited-file-name new-name t t)))))))