Add vars to disable loading pre/post early-init/init files
This commit is contained in:
@@ -2098,6 +2098,14 @@ These modes are optional and can be added selectively to `~/.emacs.d/post-init.e
|
|||||||
("/info/attributes\\'" . gitattributes-mode)
|
("/info/attributes\\'" . gitattributes-mode)
|
||||||
("/git/attributes\\'" . gitattributes-mode)))
|
("/git/attributes\\'" . gitattributes-mode)))
|
||||||
|
|
||||||
|
;; Configure built-in sgml-mode to automatically enable
|
||||||
|
;; `sgml-electric-tag-pair-mode' in `html-mode' and `mhtml-mode', providing
|
||||||
|
;; automatic insertion of matching closing tags.
|
||||||
|
(use-package sgml-mode
|
||||||
|
:ensure nil
|
||||||
|
:commands (sgml-mode sgml-electric-tag-pair-mode)
|
||||||
|
:hook ((html-mode mhtml-mode) . sgml-electric-tag-pair-mode))
|
||||||
|
|
||||||
;; Support for YAML files.
|
;; Support for YAML files.
|
||||||
;;
|
;;
|
||||||
;; NOTE: Prefer the tree-sitter-based yaml-ts-mode over yaml-mode when
|
;; NOTE: Prefer the tree-sitter-based yaml-ts-mode over yaml-mode when
|
||||||
|
|||||||
@@ -95,6 +95,18 @@ of the progress or any relevant activities during startup.")
|
|||||||
"Directory beneath minimal-emacs.d files are placed.
|
"Directory beneath minimal-emacs.d files are placed.
|
||||||
Note that this should end with a directory separator.")
|
Note that this should end with a directory separator.")
|
||||||
|
|
||||||
|
(defvar minimal-emacs-load-pre-early-init t
|
||||||
|
"If non-nil, attempt to load `pre-early-init.el`.")
|
||||||
|
|
||||||
|
(defvar minimal-emacs-load-post-early-init t
|
||||||
|
"If non-nil, attempt to load `post-early-init.el`.")
|
||||||
|
|
||||||
|
(defvar minimal-emacs-load-pre-init t
|
||||||
|
"If non-nil, attempt to load `pre-init.el`.")
|
||||||
|
|
||||||
|
(defvar minimal-emacs-load-post-init t
|
||||||
|
"If non-nil, attempt to load `post-init.el`.")
|
||||||
|
|
||||||
;;; Load pre-early-init.el
|
;;; Load pre-early-init.el
|
||||||
|
|
||||||
;; Prefer loading newer compiled files
|
;; Prefer loading newer compiled files
|
||||||
@@ -143,7 +155,8 @@ pre-early-init.el, and post-early-init.el.")
|
|||||||
(setq init-file (minimal-emacs--remove-el-file-suffix init-file))
|
(setq init-file (minimal-emacs--remove-el-file-suffix init-file))
|
||||||
(load init-file :no-error (not minimal-emacs-debug)))))
|
(load init-file :no-error (not minimal-emacs-debug)))))
|
||||||
|
|
||||||
(minimal-emacs-load-user-init "pre-early-init.el")
|
(when minimal-emacs-load-pre-early-init
|
||||||
|
(minimal-emacs-load-user-init "pre-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))
|
||||||
@@ -454,7 +467,9 @@ this stage of initialization."
|
|||||||
("melpa-stable" . 50)))
|
("melpa-stable" . 50)))
|
||||||
|
|
||||||
;;; Load post-early-init.el
|
;;; Load post-early-init.el
|
||||||
(minimal-emacs-load-user-init "post-early-init.el")
|
|
||||||
|
(when minimal-emacs-load-post-early-init
|
||||||
|
(minimal-emacs-load-user-init "post-early-init.el"))
|
||||||
|
|
||||||
;; Local variables:
|
;; Local variables:
|
||||||
;; byte-compile-warnings: (not obsolete free-vars)
|
;; byte-compile-warnings: (not obsolete free-vars)
|
||||||
|
|||||||
11
init.el
11
init.el
@@ -22,9 +22,11 @@
|
|||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
;;; Load pre-init.el
|
;;; Load pre-init.el
|
||||||
|
|
||||||
(if (fboundp 'minimal-emacs-load-user-init)
|
(if (fboundp 'minimal-emacs-load-user-init)
|
||||||
(minimal-emacs-load-user-init "pre-init.el")
|
(when minimal-emacs-load-pre-init
|
||||||
(error "The early-init.el file failed to loaded"))
|
(minimal-emacs-load-user-init "pre-init.el"))
|
||||||
|
(error "The early-init.el file failed to load"))
|
||||||
|
|
||||||
;;; Before package
|
;;; Before package
|
||||||
|
|
||||||
@@ -562,8 +564,11 @@
|
|||||||
(put cmd 'disabled nil))
|
(put cmd 'disabled nil))
|
||||||
|
|
||||||
;;; Load post init
|
;;; Load post init
|
||||||
(when (fboundp 'minimal-emacs-load-user-init)
|
|
||||||
|
(when (and minimal-emacs-load-post-init
|
||||||
|
(fboundp 'minimal-emacs-load-user-init))
|
||||||
(minimal-emacs-load-user-init "post-init.el"))
|
(minimal-emacs-load-user-init "post-init.el"))
|
||||||
|
|
||||||
(setq minimal-emacs--success t)
|
(setq minimal-emacs--success t)
|
||||||
|
|
||||||
;; Local variables:
|
;; Local variables:
|
||||||
|
|||||||
Reference in New Issue
Block a user