Remove minimal-emacs--stage

This commit is contained in:
James Cherti
2025-03-12 16:46:30 -04:00
parent 383f61046d
commit 10f65a60b1
2 changed files with 3 additions and 11 deletions

View File

@@ -75,21 +75,16 @@ When set to non-nil, Emacs will automatically call `package-initialize' and
(setq debug-on-error minimal-emacs-debug) (setq debug-on-error minimal-emacs-debug)
(defvar minimal-emacs--success nil) (defvar minimal-emacs--success nil)
(defvar minimal-emacs--stage "early-init.el")
(defun minimal-emacs--check-success () (defun minimal-emacs--check-success ()
"Verify that the Emacs configuration has loaded successfully." "Verify that the Emacs configuration has loaded successfully."
(unless minimal-emacs--success (unless minimal-emacs--success
(cond (cond
((and (or (string= minimal-emacs--stage "pre-early-init.el") ((or (file-exists-p (expand-file-name "~/.emacs.el"))
(string= minimal-emacs--stage "early-init.el") (file-exists-p (expand-file-name "~/.emacs")))
(string= minimal-emacs--stage "post-early-init.el"))
(or (file-exists-p (expand-file-name "~/.emacs.el"))
(file-exists-p (expand-file-name "~/.emacs"))))
(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 in: '%s'. Debug by starting Emacs with: emacs --debug-init" (error "Configuration error. Debug by starting Emacs with: emacs --debug-init")))))
minimal-emacs--stage)))))
(add-hook 'emacs-startup-hook #'minimal-emacs--check-success 102) (add-hook 'emacs-startup-hook #'minimal-emacs--check-success 102)
(defun minimal-emacs-load-user-init (filename) (defun minimal-emacs-load-user-init (filename)
@@ -99,7 +94,6 @@ When set to non-nil, Emacs will automatically call `package-initialize' and
(load init-file :no-error :no-message))) (load init-file :no-error :no-message)))
(minimal-emacs-load-user-init "pre-early-init") (minimal-emacs-load-user-init "pre-early-init")
(setq minimal-emacs--stage "early-init.el")
(setq custom-theme-directory (setq custom-theme-directory
(expand-file-name "themes/" minimal-emacs-user-directory)) (expand-file-name "themes/" minimal-emacs-user-directory))

View File

@@ -15,11 +15,9 @@
;;; Code: ;;; Code:
;;; Load pre-init.el ;;; Load pre-init.el
(setq minimal-emacs--stage "init.el")
(if (fboundp 'minimal-emacs-load-user-init) (if (fboundp 'minimal-emacs-load-user-init)
(minimal-emacs-load-user-init "pre-init") (minimal-emacs-load-user-init "pre-init")
(error "The early-init.el file failed to loaded")) (error "The early-init.el file failed to loaded"))
(setq minimal-emacs--stage "init.el")
;;; Before package ;;; Before package