all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Radon Rosborough <radon.neon@gmail.com>
To: emacs-devel <emacs-devel@gnu.org>
Subject: Re: [PATCH] Fix `early-init-file' value when file is missing
Date: Tue, 22 Jan 2019 19:47:13 -0800	[thread overview]
Message-ID: <CADB4rJF_bqZ+32cLcV7u=VaCfx5NybUNAv0pV_s+KCOgWUBZAw@mail.gmail.com> (raw)
In-Reply-To: <CADB4rJHCFepPc=Ts8UNrn6_one99v+7qKb_7nY2Tzz42TExDyw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 596 bytes --]

> In Emacs 27, when Emacs starts up without an early init-file (located
> by default at ~/.emacs.d/early-init.el), the value of
> `early-init-file' is set to ~/.emacs.d/early-init (note the missing
> file extension). When the early init-file does exist, the variable is
> set to the correct value. I have attached a patch which fixes this
> bug.
>
> Feedback is welcome. Please copy me on replies, since I am not
> subscribed to emacs-devel.

I am following up on this message since it has been one week with no
reply, and I would like to see the patch either merged or discussed.

Thanks,
Radon

[-- Attachment #1.2: Type: text/html, Size: 791 bytes --]

[-- Attachment #2: 0001-Fix-early-init-file-value-when-file-is-missing.patch --]
[-- Type: application/octet-stream, Size: 1964 bytes --]

From cca8239869acf0de37cd5ae0b81a6a103be354f0 Mon Sep 17 00:00:00 2001
From: Radon Rosborough <radon.neon@gmail.com>
Date: Sun, 13 Jan 2019 21:55:42 -0700
Subject: [PATCH] Fix `early-init-file' value when file is missing

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.
---
 lisp/startup.el | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/lisp/startup.el b/lisp/startup.el
index 1011d5f953..cd1e296686 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -923,7 +923,17 @@ load-user-init-file
               ;; user-init-file conclusively.  Don't let it be
               ;; set from default.el.
               (when (eq user-init-file t)
-                (setq user-init-file init-file-name)))
+                (setq user-init-file
+                      ;; If the init-file doesn't exist, default to
+                      ;; the .el version, not the bare filename.
+                      ;; (Practically, this means that
+                      ;; `early-init-file' will be set to the value
+                      ;; "early-init.el" rather than the more
+                      ;; confusing value "early-init" during startup
+                      ;; if the file does not exist.)
+                      (concat
+                       (file-name-sans-extension init-file-name)
+                       ".el"))))
 
             ;; If we loaded a compiled file, set `user-init-file' to
             ;; the source version if that exists.
-- 
2.20.1


  reply	other threads:[~2019-01-23  3:47 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16  5:54 [PATCH] Fix `early-init-file' value when file is missing Radon Rosborough
2019-01-23  3:47 ` Radon Rosborough [this message]
2019-01-29 17:24   ` Radon Rosborough
2019-01-29 17:46     ` Eli Zaretskii
2019-02-01  9:11     ` Eli Zaretskii
2019-02-01 23:10       ` Radon Rosborough
2019-02-08  7:32         ` Eli Zaretskii
2019-02-08 17:34           ` Radon Rosborough
2019-02-08 21:52             ` Eli Zaretskii
2019-02-10 23:04               ` Radon Rosborough
2019-02-10 23:14                 ` Stefan Monnier
2019-02-11 16:05                 ` Eli Zaretskii
2019-02-12  5:38                   ` Radon Rosborough
2019-02-12 16:14                     ` Eli Zaretskii
2019-02-13  2:36                       ` Radon Rosborough
2019-02-13 17:56                         ` Eli Zaretskii
2019-02-16  0:47                           ` Radon Rosborough
2019-02-16  7:17                             ` Eli Zaretskii
2019-02-16 20:26                               ` Radon Rosborough

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADB4rJF_bqZ+32cLcV7u=VaCfx5NybUNAv0pV_s+KCOgWUBZAw@mail.gmail.com' \
    --to=radon.neon@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.