emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 2208c01: * lisp/startup.el (load--user-init-file):


From: Eli Zaretskii
Subject: [Emacs-diffs] master 2208c01: * lisp/startup.el (load--user-init-file): Support early-init.elc as well.
Date: Sat, 16 Feb 2019 09:53:35 -0500 (EST)

branch: master
commit 2208c01264cb9fe95c857eb57dafa9ea8570b325
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    * lisp/startup.el (load--user-init-file): Support early-init.elc as well.
---
 lisp/startup.el | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/lisp/startup.el b/lisp/startup.el
index 55ebd4d..a9b58c5 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -906,11 +906,17 @@ init-file, or to a default value if loading is not 
possible."
               ;; the name of the file that it loads into
               ;; `user-init-file'.
               (setq user-init-file t)
-              (load init-file-name 'noerror 'nomessage)
+              (load (if (equal (file-name-extension init-file-name)
+                               "el")
+                        (file-name-sans-extension init-file-name)
+                      init-file-name)
+                    'noerror 'nomessage)
 
               (when (and (eq user-init-file t) alternate-filename-function)
-                (load (funcall alternate-filename-function)
-                      'noerror 'nomessage))
+                (let ((alt-file (funcall alternate-filename-function)))
+                  (and (equal (file-name-extension alt-file) "el")
+                       (setq alt-file (file-name-sans-extension alt-file)))
+                  (load alt-file 'noerror 'nomessage)))
 
               ;; If we did not find the user's init file, set
               ;; user-init-file conclusively.  Don't let it be



reply via email to

[Prev in Thread] Current Thread [Next in Thread]