From the commentary: This package helps you to keep identical copies of files in more than one place – possibly on different machines. When you save a file, it checks whether it is on the list of files with “shadows”, and if so, it tries to copy it when you exit Emacs.
I use the following to copy my ~/NOTES file to a fileserver at the end of the day on a Windows machine. Since the fileshare is mounted as a separate drive, I have to provide my own machine name as the “host”.
(require 'shadowfile)
(setq shadow-literal-groups
'(("/asc@BSIZUG04:h:/Alex Schröder/NOTES"
"/asc@BSIZUG04:~/NOTES")))To be honest, I also (prefer-coding-system 'utf-8), so that I’m using the control character \366 instead of the ö in the filename. ;) – AlexSchroeder
Probably the most annoying thing about how this package is written is that the hostname MUST match exactly the return value of the system-name function. This really needs to be documented in the info manual for the package as I just spent hours figuring out how to get this to work (had to run the source code though the debugger and everything).
Basically I wanted to copy my .emacs file to a location where I have a git repository. I have a Windows 7 machine using ntemacs. My computer name is Sam-PC.
I had set my shadow-literal-groups via this elisp:
(setq shadow-literal-groups
'(("/Sam@Sam-PC:~/.emacs" "/Sam@Sam-PC:~/../../Documents/site/.emacs")))I could not for the life of me figure out why it wouldn’t work. I finally discovered it was because (system-name) returned “SAM-PC” not “Sam-PC”.
Case normalization should be used against the (system-name) command, and localhost ought to be interpreted as an alias of (system-name) when matching the hostname.
All in all a nice feature but its documentation needs improvement. – SamPeterson?
Why not file a bug? `M-x report-emacs-bug’ – DrewAdams