From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Fix `early-init-file' value when file is missing Date: Fri, 08 Feb 2019 09:32:55 +0200 Message-ID: <83bm3mrazc.fsf@gnu.org> References: <8336p7zxdf.fsf@gnu.org> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="29547"; mail-complaints-to="usenet@blaine.gmane.org" Cc: emacs-devel@gnu.org To: Radon Rosborough Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Feb 08 08:33:37 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gs0fI-0007a9-Ib for ged-emacs-devel@m.gmane.org; Fri, 08 Feb 2019 08:33:36 +0100 Original-Received: from localhost ([127.0.0.1]:52523 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gs0fH-00026i-KL for ged-emacs-devel@m.gmane.org; Fri, 08 Feb 2019 02:33:35 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gs0eg-00026X-TJ for emacs-devel@gnu.org; Fri, 08 Feb 2019 02:32:59 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40603) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gs0eg-0003bo-Qs; Fri, 08 Feb 2019 02:32:58 -0500 Original-Received: from [176.228.60.248] (port=1965 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gs0eg-0002v5-C7; Fri, 08 Feb 2019 02:32:58 -0500 In-reply-to: (message from Radon Rosborough on Fri, 1 Feb 2019 15:10:24 -0800) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:233107 Archived-At: > From: Radon Rosborough > Date: Fri, 1 Feb 2019 15:10:24 -0800 > Cc: emacs-devel > > > This patch has the (possibly unintended) consequence that if ~/.emacs > > doesn't exist, user-init-file is set to "~/.emacs.el", something I > > don't think we want. Can you propose a change that will affect only > > early-init-file, not any other init file? > > Sure, no problem. I apologize for the oversight. > > A revised patch which implements the same bugfix without changing the > value of `user-init-file' is attached. > > Previously, if no early init-file existed in `user-emacs-directory', > then the value of `early-init-file' after startup would be > ~/.emacs.d/early-init (note the missing extension). This commit > adjusts that value to ~/.emacs.d/early-init.el as desired, while not > changing other behavior. Note that when the early init-file did > exist, then the value of `early-init-file' after startup was already > correct; this commit fixes a bug that occurred only when the file did > not exist. > > lisp/startup.el (load-user-init-file): Update logic. Thanks. However, I would prefer to have this solved outside load-user-init-file, if feasible. This function is too central to Emacs to make non-trivial changes there for such a minor problem's sake. Especially since we don't have a test suite for startup functionalities. I think the change outside of the function will also be much simpler and thus easier to grasp.