From 55e9037aa6bf3dfcfaa8e42b5955ea5bc62fd6a6 Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Fri, 16 Feb 2024 12:44:50 +0000 Subject: [PATCH] Add support for custom emacs.d location via FG42_EMACSD --- fg42-config.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fg42-config.el b/fg42-config.el index a1d6f66..3fd01cd 100644 --- a/fg42-config.el +++ b/fg42-config.el @@ -31,11 +31,13 @@ (setq tab-width 2) -(setq custom-file (format "%s/.fg42.custom.el" (getenv "HOME"))) -(setq user-emacs-directory "~/.fg42/emacs.d") -(setq user-init-file - (format "%s/.fg42.el" - (getenv "HOME"))) +(let ((emacsd (or (getenv "FG42_EMACSD") "~/.fg42/emacs.d"))) + (setq custom-file (format "%s/.fg42.custom.el" emacsd)) + (setq user-emacs-directory emacsd) + (setq user-init-file + (or (getenv "FG42_CONFIG_FILE") + (format "%s/.fg42.el" + (getenv "HOME")))))) ;; Load the customization file. In FG42 it is different than