From 9788bbe115a56d37ea25e5836fb42f7935f6871a Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 1 Nov 2025 13:07:25 -0500 Subject: chore:system-utils: Fix indentation and update history persistence Fix inconsistent indentation in dired-mode section to improve code readability. Enhance history persistence settings by configuring 'savehist' to include additional variables and set history length limits, ensuring better session management. --- modules/system-utils.el | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/modules/system-utils.el b/modules/system-utils.el index eef20718..2b39d862 100644 --- a/modules/system-utils.el +++ b/modules/system-utils.el @@ -63,7 +63,7 @@ fully detached from Emacs." (let* ((file (cond ;; In dired/dirvish mode, get file at point ((derived-mode-p 'dired-mode) - (dired-get-file-for-visit)) + (dired-get-file-for-visit)) ;; In a regular file buffer (buffer-file-name buffer-file-name) @@ -134,13 +134,40 @@ Logs output and exit code to buffer *external-open.log*." (keymap-global-set "C-" #'cj/server-shutdown) ;;; ---------------------------- History Persistence ---------------------------- -;; Persist history over Emacs restarts (use-package savehist :ensure nil ; built-in :config - (savehist-mode) - (setq savehist-file "~/.emacs.d/.emacs-history")) + (setq kill-ring-max 50 + history-length 50) + + (setq savehist-additional-variables + '(kill-ring + command-history + set-variable-value-history + custom-variable-history + query-replace-history + read-expression-history + minibuffer-history + read-char-history + face-name-history + bookmark-history + file-name-history)) + + (put 'minibuffer-history 'history-length 50) + (put 'file-name-history 'history-length 50) + (put 'set-variable-value-history 'history-length 25) + (put 'custom-variable-history 'history-length 25) + (put 'query-replace-history 'history-length 25) + (put 'read-expression-history 'history-length 25) + (put 'read-char-history 'history-length 25) + (put 'face-name-history 'history-length 25) + (put 'bookmark-history 'history-length 25) + + (setq history-delete-duplicates t) + (let (message-log-max) + (savehist-mode)) + ) ;;; ------------------------ List Buffers With Nerd Icons ----------------------- -- cgit v1.2.3