GNU bug report logs -
#29440
Tramp put drive_c in the backup file name when backuping in local PC/windows
Previous Next
Reported by: Shuguang Sun <shuguang <at> gmail.com>
Date: Sat, 25 Nov 2017 17:27:01 UTC
Severity: minor
Fixed in version 26.1
Done: Michael Albinus <michael.albinus <at> gmx.de>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Shuguang Sun <shuguang <at> gmail.com> writes:
> Hi,
Hi,
> backup-directory-alist:
> ("\\.[rR]\\(md\\)?$" . "~/.emacs.d/autosave/Rfiles")
>
> When I open a file in tramp and edit it, the backup file will be and
> was backuped in the local direcory: ~/.emacs.d/autosave/Rfiles
> (c:/Users/username/HOME/.emacs.d/autosave/Rfiles). However the
> backfile is named
> "c:/Users/username/HOME/.emacs.d/autosave/Rfiles/!drive_c!plink!!username <at> host!!!opt!bee!home!username!test!coxph_bench.r.~2~",
> where "dirve_c" was put in.
I've hijacked a Windows 7 machine today. It runs Emacs 25.1 only, but
this should be good enough. I have prepared a similar setting, with
--8<---------------cut here---------------start------------->8---
backup-directory-alist is a variable defined in `files.el'.
Its value is (("." . "c:/Users/lb01177/AppData/Roaming/.emacs.d/backup"))
--8<---------------cut here---------------end--------------->8---
I have used file "/plink:albinus <at> 192.168.178.30:/home/albinus/tmp/123" as
test file. The interesting function is make-backup-file-name-1, which
I debug.
When I enter line 4422, the (when (memq system-type '(windows-nt ms-dos cygwin))
part, backup-directory is
"c:/Users/lb01177/AppData/Roaming/.emacs.d/backup", and file is still
"/plink:albinus <at> 192.168.178.30:/home/albinus/tmp/123". As expected.
The interesting part is here:
--8<---------------cut here---------------start------------->8---
;; Replace any invalid file-name characters (for the
;; case of backing up remote files).
(setq file
(expand-file-name (convert-standard-filename file)))
--8<---------------cut here---------------end--------------->8---
(convert-standard-filename file) returns "\\plink!albinus <at> 192.168.178.30!\\home\\albinus\\tmp\\123".
And (expand-file-name ...) returns then "c:/plink!albinus <at> 192.168.178.30!/home/albinus/tmp/123".
Unexpected, indeed. I believe, this must be fixed, because "c:" is
converted to "/drive_c" later on. The final backup name is
"c:/Users/lb01177/AppData/Roaming/.emacs.d/backup/!drive_c!plink!!albinus <at> 192.168.178.30!!!home!albinus!tmp!123.~3~"
Eli?
Best regards, Michael.
This bug report was last modified 7 years and 184 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.