Enhance support for non interactive mode

This commit is contained in:
James Cherti
2026-03-13 21:40:30 -04:00
parent 2fdc134822
commit 314b8a1850
2 changed files with 11 additions and 5 deletions

View File

@@ -69,6 +69,8 @@ Startup speed depends on hardware and disk speed. For consistent comparisons, te
- [jeenajeena on Reddit](https://www.reddit.com/r/emacs/comments/1p9y8h4/comment/nrfk13i/): "Thank you. Plenty of inspiring settings. Worth to be read line by line." - [jeenajeena on Reddit](https://www.reddit.com/r/emacs/comments/1p9y8h4/comment/nrfk13i/): "Thank you. Plenty of inspiring settings. Worth to be read line by line."
- [uutangohotel on Reddit](https://www.reddit.com/r/emacs/comments/1p9y8h4/comment/nrg5kja/): "I get a lot out of minimal-emacs.d — thank you! I use stow to manage my dotfiles in a git repo. I created a submodule in one dir for minimal-emacs.d and another for my “overrides”, e.g. post-init.el. Easy and works great." - [uutangohotel on Reddit](https://www.reddit.com/r/emacs/comments/1p9y8h4/comment/nrg5kja/): "I get a lot out of minimal-emacs.d — thank you! I use stow to manage my dotfiles in a git repo. I created a submodule in one dir for minimal-emacs.d and another for my “overrides”, e.g. post-init.el. Easy and works great."
- [sunng on Reddit](https://www.reddit.com/r/emacs/comments/1p9y8h4/comment/ns1nehi/): "Nice work! I just created a nix flake to using it on my dev servers" - [sunng on Reddit](https://www.reddit.com/r/emacs/comments/1p9y8h4/comment/ns1nehi/): "Nice work! I just created a nix flake to using it on my dev servers"
- [zackattackz287 on Reddit](https://www.reddit.com/r/emacs/comments/1rsmaut/comment/oa8okca/): "Congrats and thank you (and the community around minimal.d) for your work! I've been using it for quite a while now and I've not ever had any breakages when merging changes from main..."
- [utility on Reddit](https://www.reddit.com/r/emacs/comments/1rsmaut/comment/oa8wrap/): "Excellent. I use this and I'm very happy with it!"
Please share your configuration. It could serve as inspiration for other users. Please share your configuration. It could serve as inspiration for other users.
@@ -365,11 +367,11 @@ The recentf, savehist, saveplace, and auto-revert built-in packages are already
:hook :hook
(after-init . global-auto-revert-mode) (after-init . global-auto-revert-mode)
:init :init
;; (setq auto-revert-verbose t)
(setq auto-revert-interval 3) (setq auto-revert-interval 3)
(setq auto-revert-remote-files nil) (setq auto-revert-remote-files nil)
(setq auto-revert-use-notify t) (setq auto-revert-use-notify t)
(setq auto-revert-avoid-polling nil) (setq auto-revert-avoid-polling nil))
(setq auto-revert-verbose t))
;; Recentf is an Emacs package that maintains a list of recently ;; Recentf is an Emacs package that maintains a list of recently
;; accessed files, making it easier to reopen files you have worked on ;; accessed files, making it easier to reopen files you have worked on

View File

@@ -124,8 +124,10 @@ Note that this should end with a directory separator.")
(error "Emacs ignored loading 'init.el'. Please ensure that files such as ~/.emacs or ~/.emacs.el do not exist, as they may be preventing Emacs from loading the 'init.el' file")) (error "Emacs ignored loading 'init.el'. Please ensure that files such as ~/.emacs or ~/.emacs.el do not exist, as they may be preventing Emacs from loading the 'init.el' file"))
(t (t
(error "Configuration error. Debug by starting Emacs with: emacs --debug-init"))))) (error "Configuration error. Debug by starting Emacs with: --debug-init")))))
(add-hook 'emacs-startup-hook #'minimal-emacs--check-success 102)
(unless noninteractive
(add-hook 'emacs-startup-hook #'minimal-emacs--check-success 102))
(defvar minimal-emacs-load-compiled-init-files nil (defvar minimal-emacs-load-compiled-init-files nil
"If non-nil, attempt to load byte-compiled .elc for init files. "If non-nil, attempt to load byte-compiled .elc for init files.
@@ -174,7 +176,9 @@ pre-early-init.el, and post-early-init.el.")
(defun minimal-emacs--restore-gc () (defun minimal-emacs--restore-gc ()
"Restore garbage collection settings." "Restore garbage collection settings."
(if (bound-and-true-p minimal-emacs-gc-cons-threshold-restore-delay) (if (and (bound-and-true-p minimal-emacs-gc-cons-threshold-restore-delay)
;; In noninteractive mode, the event loop does not run
(not noninteractive))
;; Defer garbage collection during initialization to avoid 2 collections. ;; Defer garbage collection during initialization to avoid 2 collections.
(run-with-timer minimal-emacs-gc-cons-threshold-restore-delay nil (run-with-timer minimal-emacs-gc-cons-threshold-restore-delay nil
#'minimal-emacs--restore-gc-values) #'minimal-emacs--restore-gc-values)