From 944c74ef6a11ea1c7832922184e2112c83b888a2 Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Thu, 6 Mar 2025 07:54:14 -0500 Subject: [PATCH] Disable auto-save and document it in README.md --- README.md | 13 +++++++++++++ init.el | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7680a01..9d548cf 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ The author uses *minimal-emacs.d* as his `early-init.el` and `init.el`, alongsid - [How to prevent minimal-emacs.d from saving custom.el?](#how-to-prevent-minimal-emacsd-from-saving-customel) - [Optimization: Native Compilation](#optimization-native-compilation) - [How to activate recentf, savehist, saveplace, and auto-revert?](#how-to-activate-recentf-savehist-saveplace-and-auto-revert) + - [Activating autosave](#activating-autosave) - [Code completion with corfu](#code-completion-with-corfu) - [Configuring Vertico, Consult, and Embark](#configuring-vertico-consult-and-embark) - [Code Folding](#code-folding) @@ -208,6 +209,18 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already (add-hook 'after-init-hook #'save-place-mode) ``` +### Activating autosave + +Auto-save helps prevent data loss in case of crashes. You can restore auto-saved data using the `recover-file` or `recover-session` functions. + +To enable autosave, add the following to `~/.emacs.d/post-init.el`: + +```emacs-lisp +;; Enable auto-save to prevent data loss. Use `recover-file` or +;; `recover-session` to restore unsaved changes. +(setq auto-save-default t) +``` + ### Code completion with corfu Corfu enhances in-buffer completion by displaying a compact popup with current candidates, positioned either below or above the point. Candidates can be selected by navigating up or down. diff --git a/init.el b/init.el index 4fec987..a6fc989 100644 --- a/init.el +++ b/init.el @@ -181,7 +181,7 @@ ;; Enable auto-save to safeguard against crashes or data loss. The ;; `recover-file' or `recover-session' functions can be used to restore ;; auto-saved data. -(setq auto-save-default t) +(setq auto-save-default nil) (setq auto-save-no-message t) ;; Do not auto-disable auto-save after deleting large chunks of