aboutsummaryrefslogtreecommitdiff
path: root/modules/system-defaults.el
diff options
context:
space:
mode:
Diffstat (limited to 'modules/system-defaults.el')
-rw-r--r--modules/system-defaults.el35
1 files changed, 18 insertions, 17 deletions
diff --git a/modules/system-defaults.el b/modules/system-defaults.el
index eccc6c353..6d9c811a6 100644
--- a/modules/system-defaults.el
+++ b/modules/system-defaults.el
@@ -101,8 +101,11 @@ Used to disable functionality with defalias \='somefunc \='cj/disabled)."
;; CUSTOMIZATIONS
;; All customizations should be declared in Emacs init files.
;; Add accidental customizations via the customization interface to a temp file that's never read.
-(setq custom-file (make-temp-file
- "emacs-customizations-trashbin-"))
+;; Guarded so a batch module load (make validate-modules, byte-compile) doesn't
+;; create a throwaway temp file on every run.
+(unless noninteractive
+ (setq custom-file (make-temp-file
+ "emacs-customizations-trashbin-")))
(defun cj/--warn-customize-discarded (&rest _)
"Warn once that Customize edits land in a throwaway `custom-file'.
@@ -137,7 +140,9 @@ appears only once per session."
;; -------------------------------- Emacs Server -------------------------------
;; Start server so emacsclient can connect (needed for pinentry-emacs in terminal)
-(unless (or (daemonp) (server-running-p))
+;; noninteractive guard: a raw module load under --batch (make validate-modules
+;; on a machine with no daemon socket) would otherwise start a server.
+(unless (or noninteractive (daemonp) (server-running-p))
(server-start))
(setq system-time-locale "C") ;; use en_US locale to format time.
@@ -200,24 +205,20 @@ appears only once per session."
(setq confirm-nonexistent-file-or-buffer nil) ;; don't ask if a file I visit with C-x C-f or C-x b doesn't exist
(setq ad-redefinition-action 'accept) ;; silence warnings about advised functions getting redefined.
(setq large-file-warning-threshold nil) ;; open files regardless of size
-(fset 'yes-or-no-p 'y-or-n-p) ;; require a single letter for binary answers
-(setq use-short-answers t) ;; same as above with Emacs 28+
+(setq use-short-answers t) ;; single-key y/n for ordinary yes-or-no-p prompts
+ ;; (irreversible actions use `cj/confirm-strong', which
+ ;; forces a typed "yes" by binding this nil for that call)
(setq auto-revert-verbose nil) ;; turn off auto revert messages
(setq custom-safe-themes t) ;; treat all themes as safe (stop asking)
(setq server-client-instructions nil) ;; I already know what to do when done with the frame
-;; ------------------ Reduce Garbage Collections In Minibuffer -----------------
-
-(defun cj/minibuffer-setup-hook ()
- "Hook to prevent garbage collection while user's in minibuffer."
- (setq gc-cons-threshold most-positive-fixnum))
-
-(defun cj/minibuffer-exit-hook ()
- "Hook to trigger garbage collection when exiting minibuffer."
- (setq gc-cons-threshold 800000))
-
-(add-hook 'minibuffer-setup-hook #'cj/minibuffer-setup-hook)
-(add-hook 'minibuffer-exit-hook #'cj/minibuffer-exit-hook)
+;; ----------------------------- Garbage Collection ----------------------------
+;; GC is managed by gcmh in modules/gcmh-config.el: it keeps gc-cons-threshold
+;; high during activity and collects on idle, replacing the old stock-800KB
+;; scheme (an early-init restore plus a minibuffer setup/exit bump). gcmh lives
+;; in its own module rather than here because system-defaults.el is pre-loaded
+;; by the comp-errors test harness, which has no package system -- an `:ensure'
+;; package loaded here would error at load time and break those tests.
;; ----------------------------- Bookmark Settings -----------------------------