Fix 'early-init-file' value when file is missing
authorEli Zaretskii <eliz@gnu.org>
Sat, 16 Feb 2019 07:15:40 +0000 (09:15 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 16 Feb 2019 07:15:40 +0000 (09:15 +0200)
* lisp/startup.el (command-line): Pass 'early-init.el', with
an explicit .el extension, to load-user-init-file.
Reported by Radon Rosborough <radon.neon@gmail.com> in
http://lists.gnu.org/archive/html/emacs-devel/2019-01/msg00314.html.

lisp/startup.el

index f2410f6f2c3cb53ae15fe7e0de7a2a993af081ed..112b9b259613cf0e256273de96ee9b27838021fc 100644 (file)
@@ -1167,7 +1167,11 @@ please check its value")
   (load-user-init-file
    (lambda ()
      (expand-file-name
-      "early-init"
+      ;; We use an explicit .el extension here to force
+      ;; load-user-init-file to set user-init-file to "early-init.el",
+      ;; with the .el extension, if the file doesn't exist, not just
+      ;; "early-init" without an extension, as it does for ".emacs".
+      "early-init.el"
       (file-name-as-directory
        (concat "~" init-file-user "/.emacs.d")))))
   (setq early-init-file user-init-file)