GNU bug report logs - #45708
27.1; (setq inhibit-default-init t) not working

Previous Next

Package: emacs;

Reported by: Leo Liu <sdl.web <at> gmail.com>

Date: Thu, 7 Jan 2021 05:35:02 UTC

Severity: normal

Found in version 27.1

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 45708 in the body.
You can then email your comments to 45708 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#45708; Package emacs. (Thu, 07 Jan 2021 05:35:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo Liu <sdl.web <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 07 Jan 2021 05:35:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo Liu <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.1; (setq inhibit-default-init t) not working
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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45708; Package emacs. (Thu, 07 Jan 2021 14:01:02 GMT) Full text and rfc822 format available.

Message #8 received at 45708 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Leo Liu <sdl.web <at> gmail.com>
Cc: 45708 <at> debbugs.gnu.org
Subject: Re: 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 <at> 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)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45708; Package emacs. (Fri, 08 Jan 2021 04:23:02 GMT) Full text and rfc822 format available.

Message #11 received at 45708 <at> debbugs.gnu.org (full text, mbox):

From: Leo Liu <sdl.web <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 45708 <at> debbugs.gnu.org
Subject: Re: bug#45708: 27.1; (setq inhibit-default-init t) not working
Date: Fri, 08 Jan 2021 12:22:10 +0800
On 2021-01-07 16:00 +0200, Eli Zaretskii wrote:
> Yes, this is an unintended consequence of refactoring some of the
> startup code to support the early-init file.

I see.

> Does the patch below fix the problem?

I load the patched startup.el in early-init and the problem goes away.
So yes it seems to work. Thanks.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 08 Jan 2021 07:37:01 GMT) Full text and rfc822 format available.

Notification sent to Leo Liu <sdl.web <at> gmail.com>:
bug acknowledged by developer. (Fri, 08 Jan 2021 07:37:02 GMT) Full text and rfc822 format available.

Message #16 received at 45708-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Leo Liu <sdl.web <at> gmail.com>
Cc: 45708-done <at> debbugs.gnu.org
Subject: Re: bug#45708: 27.1; (setq inhibit-default-init t) not working
Date: Fri, 08 Jan 2021 09:36:35 +0200
> From:  Leo Liu <sdl.web <at> gmail.com>
> Cc: 45708 <at> debbugs.gnu.org
> Date: Fri, 08 Jan 2021 12:22:10 +0800
> 
> On 2021-01-07 16:00 +0200, Eli Zaretskii wrote:
> > Yes, this is an unintended consequence of refactoring some of the
> > startup code to support the early-init file.
> 
> I see.
> 
> > Does the patch below fix the problem?
> 
> I load the patched startup.el in early-init and the problem goes away.
> So yes it seems to work. Thanks.

Thanks for testing.  I've now installed the change on the emacs-27
branch, and I'm marking this bug done.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45708; Package emacs. (Fri, 08 Jan 2021 11:57:01 GMT) Full text and rfc822 format available.

Message #19 received at 45708 <at> debbugs.gnu.org (full text, mbox):

From: Leo Liu <sdl.web <at> gmail.com>
To: 45708 <at> debbugs.gnu.org
Cc: eliz <at> gnu.org
Subject: Re: bug#45708: 27.1; (setq inhibit-default-init t) not working
Date: Fri, 08 Jan 2021 19:56:46 +0800
On 2021-01-08 09:36 +0200, Eli Zaretskii wrote:
> Thanks for testing.  I've now installed the change on the emacs-27
> branch, and I'm marking this bug done.

Having worked around this and http://debbugs.gnu.org/45610 I am running
Emacs 27.1 as my daily driver. So far so good.

Thanks for the hard work ;)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#45708; Package emacs. (Fri, 08 Jan 2021 12:36:02 GMT) Full text and rfc822 format available.

Message #22 received at 45708 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Leo Liu <sdl.web <at> gmail.com>
Cc: 45708 <at> debbugs.gnu.org
Subject: Re: bug#45708: 27.1; (setq inhibit-default-init t) not working
Date: Fri, 08 Jan 2021 14:35:11 +0200
> From:  Leo Liu <sdl.web <at> gmail.com>
> Cc: eliz <at> gnu.org
> Date: Fri, 08 Jan 2021 19:56:46 +0800
> 
> Having worked around this and http://debbugs.gnu.org/45610 I am running
> Emacs 27.1 as my daily driver. So far so good.
> 
> Thanks for the hard work ;)

Great, thanks for telling us.

I hope we will release Emacs 27.2 soon, which will include all those
fixes OOTB.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 06 Feb 2021 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 52 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.