[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#45708: 27.1; (setq inhibit-default-init t) not working
From: |
Eli Zaretskii |
Subject: |
bug#45708: 27.1; (setq inhibit-default-init t) not working |
Date: |
Thu, 07 Jan 2021 16:00:14 +0200 |
> From: Leo Liu <sdl.web@gmail.com>
> Date: Thu, 07 Jan 2021 13:34:22 +0800
>
> I tried to move to 27.1 in Oct 2020 but my setup was badly broken.
>
> So I tried again today and I discovered the culprit seemed to be that
> default.el is loaded regardless of (setq inhibit-default-init t) in my
> emacs init file.
>
> My emacs setup has been working flawlessly since at least Emacs 24.
>
> This incompatibility seems unintentional because the elisp documentation
> specifically allows setting inhibit-default-init in user init file.
Yes, this is an unintended consequence of refactoring some of the
startup code to support the early-init file.
Does the patch below fix the problem?
diff --git a/lisp/startup.el b/lisp/startup.el
index cdf4eea..b60c13e 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -927,7 +927,8 @@ startup--load-user-init-file
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 @@ startup--load-user-init-file
(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 @@ command-line
(expand-file-name
"init"
startup-init-directory))
- (not inhibit-default-init))
+ t)
(when (and deactivate-mark transient-mark-mode)
(with-current-buffer (window-buffer)