mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
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:
@ -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
|
||||||
|
Reference in New Issue
Block a user