fix(cli): inability to find user-emacs-directory
user-emacs-directory is nil in batch sessions, which early-init.el wasn't expecting, which caused bin/doom to refuse to run out of a non-standard location. Fix: #6777
This commit is contained in:
parent
c5e88d229f
commit
108158876c
1 changed files with 6 additions and 0 deletions
|
@ -44,6 +44,12 @@
|
||||||
;; PERF: `file-name-handler-alist' is consulted often. Unsetting it offers a
|
;; PERF: `file-name-handler-alist' is consulted often. Unsetting it offers a
|
||||||
;; notable saving in startup time.
|
;; notable saving in startup time.
|
||||||
(let (file-name-handler-alist)
|
(let (file-name-handler-alist)
|
||||||
|
;; FIX: If this file was loaded via -batch or bin/doom, then
|
||||||
|
;; `user-emacs-directory' won't be set. As a starting point, let's assume
|
||||||
|
;; it's the directory this early-init.el file lives in.
|
||||||
|
(unless user-emacs-directory
|
||||||
|
(setq user-emacs-directory (file-name-directory (file-truename load-file-name))))
|
||||||
|
|
||||||
;; FEAT: First, we process --init-directory and --profile to detect what
|
;; FEAT: First, we process --init-directory and --profile to detect what
|
||||||
;; `user-emacs-directory' to load from. I avoid using
|
;; `user-emacs-directory' to load from. I avoid using
|
||||||
;; `command-switch-alist' to process --profile and --init-directory because
|
;; `command-switch-alist' to process --profile and --init-directory because
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue