aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2019-02-16 16:52:53 +0200
committerEli Zaretskii2019-02-16 16:52:53 +0200
commit2208c01264cb9fe95c857eb57dafa9ea8570b325 (patch)
treea78535ed48c25920339e5d735dbd6e2d7ccde9bf
parent6b7b85b60e76c5e867f77387e7c57d49f4c0a2cd (diff)
downloademacs-2208c01264cb9fe95c857eb57dafa9ea8570b325.tar.gz
emacs-2208c01264cb9fe95c857eb57dafa9ea8570b325.zip
* lisp/startup.el (load--user-init-file): Support early-init.elc as well.
-rw-r--r--lisp/startup.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/startup.el b/lisp/startup.el
index 55ebd4d38c8..a9b58c5e013 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."
906 ;; the name of the file that it loads into 906 ;; the name of the file that it loads into
907 ;; `user-init-file'. 907 ;; `user-init-file'.
908 (setq user-init-file t) 908 (setq user-init-file t)
909 (load init-file-name 'noerror 'nomessage) 909 (load (if (equal (file-name-extension init-file-name)
910 "el")
911 (file-name-sans-extension init-file-name)
912 init-file-name)
913 'noerror 'nomessage)
910 914
911 (when (and (eq user-init-file t) alternate-filename-function) 915 (when (and (eq user-init-file t) alternate-filename-function)
912 (load (funcall alternate-filename-function) 916 (let ((alt-file (funcall alternate-filename-function)))
913 'noerror 'nomessage)) 917 (and (equal (file-name-extension alt-file) "el")
918 (setq alt-file (file-name-sans-extension alt-file)))
919 (load alt-file 'noerror 'nomessage)))
914 920
915 ;; If we did not find the user's init file, set 921 ;; If we did not find the user's init file, set
916 ;; user-init-file conclusively. Don't let it be 922 ;; user-init-file conclusively. Don't let it be