From 32ed338843935a257bfae23ca9cfe905dff0b9a0 Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Tue, 22 Feb 2022 09:52:17 +0800 Subject: Set emacs auto save directory --- .emacs.d/lisp/init-misc.el | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.emacs.d/lisp/init-misc.el b/.emacs.d/lisp/init-misc.el index 71a5d7e..0a0bdf7 100644 --- a/.emacs.d/lisp/init-misc.el +++ b/.emacs.d/lisp/init-misc.el @@ -4,8 +4,18 @@ (when (version<= "26.0.50" emacs-version) (global-display-line-numbers-mode)) (setq vc-follow-symlinks t) -(setq backup-directory-alist - `(("." . ,(concat user-emacs-directory "backups")))) + +(setq + backup-by-copying t + delete-old-versions t + kept-new-versions 10 + kept-old-versions 2 + version-control t + backup-directory-alist `(("." . ,(concat user-emacs-directory "backups")))) + +(setq auto-save-file-name-transforms + `((".*" "~/.emacs.d/backups/" t))) + (setq-default fill-column 72) (menu-bar-mode -1) (xterm-mouse-mode 1) ;; Enable mouse -- cgit v1.2.3