From: Eli Zaretskii Date: Fri, 8 Jan 2021 07:35:05 +0000 (+0200) Subject: Fix inhibiting the default.el loading in user init file X-Git-Tag: emacs-27.1.91~18 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=74d18957b898e687dcc07ba86559367c8d8ba482;p=emacs.git 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) --- 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)