From 625f95c8ae39f6ff67df6e192ba7ce41493e336d Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 7 Jul 2022 23:08:43 -0500 Subject: Move from super-save -> auto-save-visited-mode --- lisp/+emacs.el | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'lisp') diff --git a/lisp/+emacs.el b/lisp/+emacs.el index b4742da..d6071a3 100644 --- a/lisp/+emacs.el +++ b/lisp/+emacs.el @@ -33,12 +33,14 @@ Do this only if the buffer is not visiting a file." async-shell-command-buffer 'new-buffer async-shell-command-display-buffer nil auto-hscroll-mode 'current-line - auto-revert-verbose nil - auto-save-file-name-transforms `((".*" ,(.etc "auto-save/" t) t)) - auto-save-interval 60 + auto-revert-verbose t + auto-save-default nil + auto-save-file-name-transforms `((".*" ,(.etc "auto-save/") ,(car (secure-hash-algorithms))) + (".*" ,(.etc "auto-save/") t)) + auto-save-interval 30 auto-save-list-file-prefix (.etc "auto-save/.saves-" t) - auto-save-timeout 60 - auto-save-visited-interval 60 + auto-save-timeout 30 + auto-save-visited-interval 5 auto-window-vscroll nil backup-by-copying t backup-directory-alist `((".*" . ,(.etc "backup/" t))) @@ -105,6 +107,7 @@ Do this only if the buffer is not visiting a file." regexp-search-ring-max 100 regexp-search-ring-max 200 save-interprogram-paste-before-kill t + save-some-buffers-default-predicate #'+save-some-buffers-p scroll-conservatively 101 scroll-down-aggressively 0.01 scroll-margin 2 @@ -190,6 +193,7 @@ Do this only if the buffer is not visiting a file." file-name-shadow-mode minibuffer-electric-default-mode delete-selection-mode + auto-save-visited-mode ;; column-number-mode )) (when (fboundp enable-mode) @@ -291,6 +295,13 @@ ARG is passed to `backward-kill-word'." (advice-add #'yank :after #'+yank@indent) (advice-add #'yank-pop :after #'+yank@indent) + +;;; Extra functions + +(defun +save-some-buffers-p () + "Predicate for `save-some-buffers-default-predicate'. +It returns nil with remote files." + (not (file-remote-p (buffer-file-name)))) ;;; Bindings -- cgit 1.4.1-21-gabe81