diff --git a/README.md b/README.md index 4d89e8f..aa240b7 100644 --- a/README.md +++ b/README.md @@ -931,7 +931,7 @@ To prevent Emacs from saving customization information to a custom file, set `cu (add-hook 'dired-mode-hook #'dired-omit-mode) ;; Enable on-the-fly spell checking (Flyspell mode). -(add-hook text-mode-hook #'flyspell-mode) +(add-hook 'text-mode-hook #'flyspell-mode) ``` It is also recommended to read the following articles: diff --git a/early-init.el b/early-init.el index 8f536f9..8eb7c1f 100644 --- a/early-init.el +++ b/early-init.el @@ -71,18 +71,29 @@ minimalistic appearance during startup.") ;;; Load pre-early-init.el +(defvar minimal-emacs--success nil) +(defvar minimal-emacs--stage "early-init.el") +(defun minimal-emacs--check-success () + "Verify that the Emacs configuration has loaded successfully." + (unless minimal-emacs--success + (error (concat "Configuration error in: '%s'. Debug by starting Emacs " + "with: emacs --debug-init") + minimal-emacs--stage))) +(add-hook 'emacs-startup-hook #'minimal-emacs--check-success 102) + ;; Prefer loading newer compiled files (setq load-prefer-newer t) (defun minimal-emacs-load-user-init (filename) "Execute a file of Lisp code named FILENAME." - (let ((user-init-file - (expand-file-name filename - minimal-emacs-user-directory))) - (when (file-exists-p user-init-file) - (load user-init-file nil t t)))) + (let ((init-file (expand-file-name filename + minimal-emacs-user-directory))) + (when (file-exists-p init-file) + (setq minimal-emacs--stage init-file) + (load init-file nil t t)))) (minimal-emacs-load-user-init "pre-early-init.el") +(setq minimal-emacs--stage "early-init.el") (setq custom-theme-directory (expand-file-name "themes/" minimal-emacs-user-directory)) diff --git a/init.el b/init.el index a6fc989..62046e3 100644 --- a/init.el +++ b/init.el @@ -16,6 +16,7 @@ ;;; Load pre-init.el (minimal-emacs-load-user-init "pre-init.el") +(setq minimal-emacs--stage "init.el") ;;; Before package @@ -542,6 +543,7 @@ ;;; Load post init (minimal-emacs-load-user-init "post-init.el") +(setq minimal-emacs--success t) (provide 'init) ;;; init.el ends here