From e5eaabadb7fe6fbb3b4d36d5d246277e4e68254c Mon Sep 17 00:00:00 2001 From: James Cherti <60946298+jamescherti@users.noreply.github.com> Date: Fri, 13 Mar 2026 11:07:08 -0400 Subject: [PATCH] Update CLI settings, auto-save, and backup --- README.md | 2 +- init.el | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index dbc93bf..c4f4763 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ The **minimal-emacs.d** project is a **fast and lightweight** minimal Emacs starter kit (`init.el` and `early-init.el`) that **gives you full control over your configuration**. It provides better defaults, an optimized startup, and a clean foundation for building your own vanilla Emacs setup. -In just a few minutes of applying what's in this README.md file, you will have a fully functional, high-performance Emacs configuration ready for work. You will bypass hours of configuration and the heavy overhead of frameworks like Doom or Spacemacs, gaining access to optimized garbage collection, sensible UI defaults, and a fast startup. +In just a few minutes of applying what's in this README.md file, you will have a fully functional, high-performance Emacs configuration ready for work. You will bypass hours of configuration and the heavy overhead of frameworks like Doom or Spacemacs, gaining access to optimized garbage collection, sensible defaults, and a fast startup. If this helps your workflow, please show your support by **⭐ starring minimal-emacs.d on GitHub** to help more Emacs users discover its benefits. diff --git a/init.el b/init.el index fc8b058..b7c5ab5 100644 --- a/init.el +++ b/init.el @@ -197,8 +197,16 @@ ;;; Backup files -;; Avoid backups or lockfiles to prevent creating world-readable copies of files +;; Disable the creation of lockfiles (e.g., .#filename). +;; Modern workflows rely on `global-auto-revert-mode' to handle external file +;; changes gracefully, making the restrictive nature of lockfiles unnecessary. (setq create-lockfiles nil) + +;; Disable backup files (e.g., filename~). Note that `auto-save-default' +;; remains enabled by default. Even with `make-backup-files' backups disabled, +;; Emacs will still generate temporary recovery files (e.g., #filename#) for +;; unsaved buffers. This protects your active work from sudden crashes while +;; ensuring the file system is cleaned up immediately upon a successful save. (setq make-backup-files nil) (setq backup-directory-alist @@ -214,7 +222,6 @@ ;;; VC (setq vc-git-print-log-follow t) -(setq vc-make-backup-files nil) ; Do not backup version controlled files (setq vc-git-diff-switches '("--histogram")) ; Faster algorithm for diffing. ;;; Auto save @@ -222,9 +229,14 @@ ;; 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 nil) +(setq auto-save-default t) (setq auto-save-no-message t) +(when noninteractive + ;; The command line interface + (setq enable-dir-local-variables nil) + (setq case-fold-search nil)) + ;; Do not auto-disable auto-save after deleting large chunks of ;; text. (setq auto-save-include-big-deletions t)