From a79dee2bcba67c105911c8a3e3822bd774686d5f Mon Sep 17 00:00:00 2001 From: JenChieh Date: Sun, 26 Nov 2023 00:36:40 -0800 Subject: [PATCH] define dot emacs file --- lisp/_prepare.el | 11 ++++++----- lisp/core/status.el | 29 ++++++++++++++--------------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lisp/_prepare.el b/lisp/_prepare.el index b8b4ce56..01a826dc 100644 --- a/lisp/_prepare.el +++ b/lisp/_prepare.el @@ -68,6 +68,9 @@ package-archives nil ; Leave it to custom use package-archive-priorities nil) +(defvar eask-dot-emacs-file nil + "Variable hold .emacs file location.") + (defun eask--load--adv (fnc &rest args) "Prevent `_prepare.el' loading twice. @@ -1045,6 +1048,7 @@ This uses function `locate-dominating-file' to look up directory tree." `(let* ((user-emacs-directory (expand-file-name (concat ".eask/" emacs-version "/") ,dir)) (package-user-dir (expand-file-name "elpa" user-emacs-directory)) (early-init-file (locate-user-emacs-file "early-init.el")) + (eask-dot-emacs-file (locate-user-emacs-file ".emacs")) (user-init-file (locate-user-emacs-file "init.el")) (custom-file (locate-user-emacs-file "custom.el"))) ,@body)) @@ -1058,10 +1062,7 @@ This uses function `locate-dominating-file' to look up directory tree." (unless inhibit-config (when (version<= "27" emacs-version) (load early-init-file t)) - (load (if (boundp 'dot-emacs-file) - dot-emacs-file - (locate-user-emacs-file "../.emacs")) - t) + (load eask-dot-emacs-file t) (load user-init-file t))) (ansi-green (if inhibit-config "skipped ✗" "done ✓"))))) @@ -1076,7 +1077,7 @@ This uses function `locate-dominating-file' to look up directory tree." (cond ((eask-config-p) (let ((early-init-file (locate-user-emacs-file "early-init.el")) - (dot-emacs-file (locate-user-emacs-file "../.emacs")) + (eask-dot-emacs-file (locate-user-emacs-file "../.emacs")) (user-init-file (locate-user-emacs-file "init.el"))) ;; We accept Eask-file in `config' scope, but it shouldn't be used ;; for the sandbox. diff --git a/lisp/core/status.el b/lisp/core/status.el index 1847dbfb..1dd2378e 100644 --- a/lisp/core/status.el +++ b/lisp/core/status.el @@ -91,21 +91,20 @@ ("System type" ,system-type))) (eask--print-title "Environment:") - (let ((dot-emacs-file (locate-user-emacs-file "../.emacs"))) - (eask--print-infos - `(("Emacs directory" ,(expand-file-name user-emacs-directory) - ,(eask--status-file-dir user-emacs-directory)) - ("ELPA directory" ,(expand-file-name package-user-dir) - ,(eask--status-file-dir package-user-dir)) - ("early-init.el" ,(expand-file-name early-init-file) - ,(eask--status-file-dir early-init-file)) - (".emacs" ,(expand-file-name dot-emacs-file) - ,(eask--status-file-dir dot-emacs-file)) - ("init.el" ,(expand-file-name user-init-file) - ,(eask--status-file-dir user-init-file)) - ("custom.el" ,(if custom-file (expand-file-name custom-file) - "nil") - ,(when custom-file (eask--status-file-dir custom-file)))))) + (eask--print-infos + `(("Emacs directory" ,(expand-file-name user-emacs-directory) + ,(eask--status-file-dir user-emacs-directory)) + ("ELPA directory" ,(expand-file-name package-user-dir) + ,(eask--status-file-dir package-user-dir)) + ("early-init.el" ,(expand-file-name early-init-file) + ,(eask--status-file-dir early-init-file)) + (".emacs" ,(expand-file-name eask-dot-emacs-file) + ,(eask--status-file-dir eask-dot-emacs-file)) + ("init.el" ,(expand-file-name user-init-file) + ,(eask--status-file-dir user-init-file)) + ("custom.el" ,(if custom-file (expand-file-name custom-file) + "nil") + ,(when custom-file (eask--status-file-dir custom-file))))) (eask--print-title "Eask-file:") (eask--print-infos