Currently, I'm able to redirect Emacs backup files (those ending in '~' and those starting in '#') to a central location using the code below (it renames them nicely also, encoding the file path in the file name (e.g., ~/tmp/emacs_autosaves/#!home!cbalz!.bashrc#
).
But how to preserve the functionality in that code, while also moving the files that Emacs makes that start with '.#' (those are often or always symlinks)?
Current working code - needs to be modified or augmented to work with files/symlinks starting with '.#' :
(defvar autosave-dir
(concat "~/tmp/emacs_autosaves/" (user-login-name) "/"))
(make-directory autosave-dir t)
(setq auto-save-file-name-transforms `(("\\(?:[^/]*/\\)*\\(.*\\)" ,(concat
autosave-dir "\\1") t))