I know I can edit a remote file over SSH by opening a file path of the form /ssh:user@host:/path/to/file
.
However, right now I'm working on a kernel module in a Linux VM. Since my kernel module might brick/corrupt my VM (if I make a stupid mistake), I'm worried about losing my remote source files for the kernel module.
I'd like Emacs to save a local copy of the file I'm editing, just to make sure I don't lose my latest work if I ruin my VM*. Ideally the local copy won't have name mangling applied (i.e. appending ~
to the name, like Emacs does normally for backup files).
*Yes, I'm using source control, but I don't want to have commit and push for every single change. I'm rather new to kernel module hacking, so I'll be making lots of little edits and testing my module a lot as I go. Constantly committing and pushing half-baked changes is far from ideal.
Is there an easy way to get Emacs to save a local copy of a file when editing a remote file? I'm looking at the docs (Remote Files, Auto Save Files, Backup Files, Singled or Numbered Backups) and can't see how do to this.
tramp-backup-directory-alist
-- emacswiki.org/emacs/BackupDirectory