From 54d180b37674aa449275be80a6c1eca02a2d7284 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 15 Apr 2019 03:47:24 -0400 Subject: [PATCH] Ensure user-emacs-directory in doctor Also allow it to be customized with EMACSDIR envvar --- bin/doom-doctor | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/doom-doctor b/bin/doom-doctor index 748193f75..98144dcf3 100755 --- a/bin/doom-doctor +++ b/bin/doom-doctor @@ -13,8 +13,11 @@ ;; are limited to very basic standard library calls (e.g. avoid cl, subr-x, and ;; any Doom dependencies). -;; In really old versions of Emacs `user-emacs-directory' isn't defined -(defvar user-emacs-directory (expand-file-name "../" (file-name-directory load-file-name))) +;; Ensure Doom doctor always runs out of the current Emacs directory (optionally +;; specified by the EMACSDIR envvar) +(setq user-emacs-directory + (or (getenv "EMACSDIR") + (expand-file-name "../" (file-name-directory load-file-name)))) (unless (file-directory-p user-emacs-directory) (error "Couldn't find a Doom config!"))