diff --git a/configuration.org b/configuration.org index 9b1cd94..bfa25aa 100644 --- a/configuration.org +++ b/configuration.org @@ -105,8 +105,8 @@ Taken from [[http://ergoemacs.org/emacs/emacs_set_backup_into_a_directory.html][ #+BEGIN_SRC emacs-lisp (defun xah/backup-file-name (fpath) "Return a new file path for FPATH under `user-emacs-cache-directory'" - (let* ((backup-root-dir (concat user-emacs-cache-directory "/backup")) - (file-path (replace-regexp-in-string "[A-Za-z]:" "")) + (let* ((backup-root-dir (expand-file-name "backup" user-emacs-cache-directory)) + (file-path (replace-regexp-in-string "[A-Za-z]:" "" fpath)) (backup-file-path (replace-regexp-in-string "//" "/" (concat backup-root-dir file-path "~")))) (make-directory (file-name-directory backup-file-path) (file-name-directory backup-file-path)) backup-file-path))