aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2021-01-08 09:35:05 +0200
committerEli Zaretskii2021-01-08 09:35:05 +0200
commit74d18957b898e687dcc07ba86559367c8d8ba482 (patch)
treebc10be17c04a661461e57c5efcaaf869dc1661de
parent5d76288660279c2affa4bed45956efd311eaf53d (diff)
downloademacs-74d18957b898e687dcc07ba86559367c8d8ba482.tar.gz
emacs-74d18957b898e687dcc07ba86559367c8d8ba482.zip
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
927loaded, and ALTERNATE-FILENAME-FUNCTION is non-nil, then it is 927loaded, and ALTERNATE-FILENAME-FUNCTION is non-nil, then it is
928called with no arguments and should return the name of an 928called with no arguments and should return the name of an
929alternate init-file to load. If LOAD-DEFAULTS is non-nil, then 929alternate init-file to load. If LOAD-DEFAULTS is non-nil, then
930load default.el after the init-file. 930load default.el after the init-file, unless `inhibit-default-init'
931is non-nil.
931 932
932This function sets `user-init-file' to the name of the loaded 933This function sets `user-init-file' to the name of the loaded
933init-file, or to a default value if loading is not possible." 934init-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."
983 (sit-for 1)) 984 (sit-for 1))
984 (setq user-init-file source)))) 985 (setq user-init-file source))))
985 986
986 (when load-defaults 987 (when (and load-defaults
987 988 (not inhibit-default-init))
988 ;; Prevent default.el from changing the value of 989 ;; Prevent default.el from changing the value of
989 ;; `inhibit-startup-screen'. 990 ;; `inhibit-startup-screen'.
990 (let ((inhibit-startup-screen nil)) 991 (let ((inhibit-startup-screen nil))
@@ -1390,7 +1391,7 @@ please check its value")
1390 (expand-file-name 1391 (expand-file-name
1391 "init" 1392 "init"
1392 startup-init-directory)) 1393 startup-init-directory))
1393 (not inhibit-default-init)) 1394 t)
1394 1395
1395 (when (and deactivate-mark transient-mark-mode) 1396 (when (and deactivate-mark transient-mark-mode)
1396 (with-current-buffer (window-buffer) 1397 (with-current-buffer (window-buffer)