From 0b16c662a1a7804b89ea2ef568d4d16d20cf6a23 Mon Sep 17 00:00:00 2001 From: Jessie Hildebrandt Date: Mon, 2 Mar 2020 03:15:05 -0500 Subject: [PATCH] Replace static references to emacs user directory --- init.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/init.el b/init.el index ac26f1f..f88d0f3 100644 --- a/init.el +++ b/init.el @@ -45,12 +45,10 @@ scroll-preserve-screen-position 1 ; Don't move cursor while scrolling scroll-conservatively 101 ; Only scroll one line at a time scroll-margin 5 ; Maintain a margin of 5 lines while scrolling - custom-file "~/.emacs.d/custom.el" ; Use separate custom-vars file ) ;; Set backup behavior. (setq-default - backup-directory-alist '(("." . "~/.emacs.d/backup")) ; Set backup file directory backup-by-copying t ; Don't delink hardlinks version-control t ; Use version numbers on backups delete-old-versions t ; Do not keep old backups @@ -58,6 +56,14 @@ kept-old-versions 3 ; Keep 3 old versions ) +;; Configure user directory and file locations. +(defconst custom-backup-dir (concat user-emacs-directory "backups")) +(setq-default + custom-file (concat user-emacs-directory "custom.el") ; Use separate custom-vars file + backup-directory-alist `((".*" . ,custom-backup-dir)) ; Set backup file directory + auto-save-file-name-transforms `((".*" ,custom-backup-dir t)) ; Set autosave file directory + ) + ;; Enable uniquify for better unique buffer names. (require 'uniquify) (setq