Created
October 29, 2014 15:55
-
-
Save cwjohnston/e2e0e51829aa36eef27d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; Put autosave files (ie #foo#) in one place, *not* scattered all over the | |
| ;; file system! (The make-autosave-file-name function is invoked to determine | |
| ;; the filename of an autosave file.) | |
| (defvar autosave-dir "~/.emacs-dir/autosaves/") | |
| (make-directory autosave-dir t) | |
| (defun auto-save-file-name-p (filename) (string-match "^#.*#$" (file-name-nondirectory filename))) | |
| (defun make-auto-save-file-name () (concat autosave-dir (if buffer-file-name (concat "#" (file-name-nondirectory buffer-file-name) "#") (expand-file-name (concat "#%" (buffer-name) "#"))))) | |
| ;; Put backup files (ie foo~) in one place too. (The backup-directory-alist | |
| ;; list contains regexp=>directory mappings; filenames matching a regexp are | |
| ;; backed up in the corresponding directory. Emacs will mkdir it if necessary.) | |
| (defvar backup-dir (expand-file-name "~/.emacs-dir/backups/")) | |
| (setq backup-directory-alist (list (cons "." backup-dir))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment