Skip to content

Commit 4e229dd

Browse files
committed
tweak(core): add new env vars to disable user config
1 parent 3cd0eac commit 4e229dd

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

early-init.el

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@
5555

5656
;; Load the user early configuration file from "$MINEMACSDIR/early-config.el"
5757
;; if it exists.
58-
(let ((early-config-path (concat minemacs-config-dir "early-config.el")))
59-
(when (file-exists-p early-config-path)
60-
(load early-config-path nil (not minemacs-verbose))))
58+
(unless (or (getenv "MINEMACS_IGNORE_USER_CONFIG") (getenv "MINEMACS_EARLY_CONFIG_EL"))
59+
(let ((early-config-path (concat minemacs-config-dir "early-config.el")))
60+
(when (file-exists-p early-config-path)
61+
(load early-config-path nil (not minemacs-verbose)))))
6162

6263
;;; early-init.el ends here

init.el

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,10 @@
123123
(+load minemacs-loaddefs-file)
124124

125125
;; Load user init tweaks from "$MINEMACSDIR/init-tweaks.el" when available
126-
(let ((user-init-tweaks (concat minemacs-config-dir "init-tweaks.el")))
127-
(when (file-exists-p user-init-tweaks)
128-
(+load user-init-tweaks)))
126+
(unless (or (getenv "MINEMACS_IGNORE_USER_CONFIG") (getenv "MINEMACS_IGNORE_INIT_TWEAKS_EL"))
127+
(let ((user-init-tweaks (concat minemacs-config-dir "init-tweaks.el")))
128+
(when (file-exists-p user-init-tweaks)
129+
(+load user-init-tweaks))))
129130

130131
;; HACK: When Emacs is launched from the terminal (in GNU/Linux), it inherits
131132
;; the terminal's environment variables, which can be useful specially for
@@ -198,10 +199,11 @@
198199
;; Load the default list of enabled modules (`minemacs-modules' and `minemacs-core-modules')
199200
(+load minemacs-core-dir "me-modules.el")
200201

201-
;; The modules.el file can override minemacs-modules and minemacs-core-modules
202-
(let ((user-conf-modules (concat minemacs-config-dir "modules.el")))
203-
(when (file-exists-p user-conf-modules)
204-
(+load user-conf-modules))))
202+
(unless (or (getenv "MINEMACS_IGNORE_USER_CONFIG") (getenv "MINEMACS_IGNORE_MODULES_EL"))
203+
;; The modules.el file can override minemacs-modules and minemacs-core-modules
204+
(let ((user-conf-modules (concat minemacs-config-dir "modules.el")))
205+
(when (file-exists-p user-conf-modules)
206+
(+load user-conf-modules)))))
205207

206208
;; Load fonts early (they are read from the default `minemacs-default-fonts').
207209
(+set-fonts)
@@ -245,9 +247,10 @@
245247
(+load custom-file))
246248

247249
;; Load user configuration from "$MINEMACSDIR/config.el" when available
248-
(let ((user-config (concat minemacs-config-dir "config.el")))
249-
(when (file-exists-p user-config)
250-
(+load user-config)))
250+
(unless (or (getenv "MINEMACS_IGNORE_USER_CONFIG") (getenv "MINEMACS_IGNORE_CONFIG_EL"))
251+
(let ((user-config (concat minemacs-config-dir "config.el")))
252+
(when (file-exists-p user-config)
253+
(+load user-config))))
251254

252255
(+lazy-when! (featurep 'native-compile)
253256
(+info! "Trying to clean outdated native compile cache")

0 commit comments

Comments
 (0)