about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--init.el23
1 files changed, 9 insertions, 14 deletions
diff --git a/init.el b/init.el index b083ece..dbb2943 100644 --- a/init.el +++ b/init.el
@@ -21,15 +21,6 @@
21 (balance-windows) 21 (balance-windows)
22 (other-window 1)) 22 (other-window 1))
23 23
24(defun acdw/full-auto-save ()
25 "Save all buffers that (a) have files associated and (b) are modified."
26 (interactive)
27 (save-excursion
28 (dolist (buf (buffer-list))
29 (set-buffer buf)
30 (if (and (buffer-file-name) (buffer-modified-p))
31 (basic-save-buffer)))))
32
33(defun acdw/kill-this-buffer () 24(defun acdw/kill-this-buffer ()
34 "Kill the current buffer." 25 "Kill the current buffer."
35 (interactive) 26 (interactive)
@@ -156,7 +147,6 @@
156 ("C-x K" . kill-buffer) 147 ("C-x K" . kill-buffer)
157 :hook 148 :hook
158 (prog-mode-hook . prettify-symbols-mode) 149 (prog-mode-hook . prettify-symbols-mode)
159 ((auto-save-hook focus-out-hook) . acdw/full-auto-save)
160 (before-save-hook . delete-trailing-whitespace) 150 (before-save-hook . delete-trailing-whitespace)
161 (minibuffer-setup-hook . acdw/stop-gc) 151 (minibuffer-setup-hook . acdw/stop-gc)
162 (minibuffer-exit-hook . acdw/start-gc)) 152 (minibuffer-exit-hook . acdw/start-gc))
@@ -223,10 +213,7 @@
223 :config 213 :config
224 (setq custom-file (no-littering-expand-etc-file-name "custom.el")) 214 (setq custom-file (no-littering-expand-etc-file-name "custom.el"))
225 (setq backup-directory-alist 215 (setq backup-directory-alist
226 `((".*" . ,(no-littering-expand-var-file-name "backup/")))) 216 `((".*" . ,(no-littering-expand-var-file-name "backup/")))))
227 (setq auto-save-file-name-transforms
228 `((".*" ,(no-littering-expand-var-file-name "auto-save/") t)))
229 (auto-save-mode))
230 217
231;;;; Uniquily name buffers 218;;;; Uniquily name buffers
232(use-package uniquify 219(use-package uniquify
@@ -289,6 +276,14 @@
289 276
290;;; General-ish Packages 277;;; General-ish Packages
291;;;; General improvements 278;;;; General improvements
279;;;;; Better auto-save
280(use-package super-save
281 :custom
282 (auto-save-default nil)
283 (super-save-auto-save-when-idle t)
284 (super-save-exclude '(".gpg"))
285 :hook
286 (after-init-hook . super-save-mode))
292;;;;; Restart emacs /from within/ emacs 287;;;;; Restart emacs /from within/ emacs
293(use-package restart-emacs) 288(use-package restart-emacs)
294 289