summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2021-01-08 09:35:05 +0200
committerEli Zaretskii <eliz@gnu.org>2021-01-08 09:35:05 +0200
commit74d18957b898e687dcc07ba86559367c8d8ba482 (patch)
treebc10be17c04a661461e57c5efcaaf869dc1661de
parent5d76288660279c2affa4bed45956efd311eaf53d (diff)
downloademacs-74d18957b898e687dcc07ba86559367c8d8ba482.tar.gz
Fix inhibiting the default.el loading in user init file
* lisp/startup.el (startup--load-user-init-file): Test the value of 'inhibit-default-init', not just the LOAD-DEFAULTS argument, because loading the user's init file could have set the value of the former. (command-line): Call 'startup--load-user-init-file' with last arg t: there's no longer any need to test the value of 'inhibit-default-init' here, as it will be tested by the called function. (Bug#45708)
-rw-r--r--lisp/startup.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/startup.el b/lisp/startup.el
index cdf4eea1c3a..b60c13e4487 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -927,7 +927,8 @@ the name of the init-file to load. If this file cannot be
loaded, and ALTERNATE-FILENAME-FUNCTION is non-nil, then it is
called with no arguments and should return the name of an
alternate init-file to load. If LOAD-DEFAULTS is non-nil, then
-load default.el after the init-file.
+load default.el after the init-file, unless `inhibit-default-init'
+is non-nil.
This function sets `user-init-file' to the name of the loaded
init-file, or to a default value if loading is not possible."
@@ -983,8 +984,8 @@ init-file, or to a default value if loading is not possible."
(sit-for 1))
(setq user-init-file source))))
- (when load-defaults
-
+ (when (and load-defaults
+ (not inhibit-default-init))
;; Prevent default.el from changing the value of
;; `inhibit-startup-screen'.
(let ((inhibit-startup-screen nil))
@@ -1390,7 +1391,7 @@ please check its value")
(expand-file-name
"init"
startup-init-directory))
- (not inhibit-default-init))
+ t)
(when (and deactivate-mark transient-mark-mode)
(with-current-buffer (window-buffer)