fix to load early-init.el also if init is loaded via --load-file
This commit is contained in:
25
init
25
init
@@ -4,16 +4,27 @@
|
||||
;; Emacs Startup File --- initialization for Emacs
|
||||
;; https://blog.d46.us/advanced-emacs-startup/
|
||||
|
||||
;; Usage:
|
||||
;; "emacs --init-directory ~/repos/emacs-conf"
|
||||
;; "emacs --no-splash -q -l ~/repos/emacs-conf/init"
|
||||
|
||||
;; Requirements: git gnuplot ledger
|
||||
|
||||
;;; Code:
|
||||
;; Emacs 27.1 introduced early-init.el, which is run before init.el, before
|
||||
;; package and UI initialization happens, and before site files are loaded.
|
||||
;; In the case that early-init.el wasn't loaded (e.g. using old emacs? Or this
|
||||
;; file directly loaded?), we do it explicitly:
|
||||
(unless (version<= "27.1" emacs-version)
|
||||
(load (concat (file-name-directory (file-truename user-init-file)) "early-init.el")
|
||||
nil t))
|
||||
(require 'early-init
|
||||
(concat
|
||||
(file-name-directory (file-truename (or load-file-name
|
||||
"~/.config/emacs/init")))
|
||||
"early-init.el")
|
||||
t)
|
||||
;; Load early-init-el if not already
|
||||
;; - Emacs 27.1 introduced early-init.el, which is run before
|
||||
;; init.el, before package and UI initialization happens, and
|
||||
;; before site files are loaded. In the case that early-init.el
|
||||
;; wasn't loaded (e.g. using old emacs? Or this file directly
|
||||
;; loaded?), we do it explicitly
|
||||
;; - for org export async actions, e.g. as in
|
||||
;; emacs -l ~/.config/emacs/init -l /tmp/org-export-processXYZ
|
||||
(require 'pre-settings) ;; use-package delight functions variables
|
||||
(require 'which-key-settings) ;; https://melpa.org/#/which-key
|
||||
(require 'general-settings) ;; requires which-key
|
||||
|
||||
Reference in New Issue
Block a user