Skip to content

Commit

Permalink
refactor: move constants to me-vars
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Dec 19, 2023
1 parent 8452ff5 commit 1d7aeb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 5 additions & 0 deletions core/me-vars.el
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ environment variable \"$MINEMACS_IGNORE_USER_CONFIG\".")
(const :tag "Log" 3)
(const :tag "Debug" 4)))

(defconst minemacs-directory-arg-p
(let ((args (cdr command-line-args))) (cl-some #'file-directory-p args)))

(defconst minemacs-file-arg-p (and (cdr command-line-args) t))

;; Derive the root directory from this file path
(defconst minemacs-root-dir (abbreviate-file-name (file-name-directory (directory-file-name (file-name-directory (file-truename load-file-name))))))
(defconst minemacs-core-dir (concat minemacs-root-dir "core/"))
Expand Down
5 changes: 1 addition & 4 deletions modules/me-files.el
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@

;;; Code:

(defconst minemacs-started-with-directory-p
(let ((args (cdr command-line-args))) (cl-some #'file-directory-p args)))

(use-package dirvish
:straight t
:demand minemacs-started-with-directory-p
:demand minemacs-directory-arg-p
:custom
(dirvish-attributes '(subtree-state nerd-icons file-size vc-state git-msg))
(dirvish-cache-dir (+directory-ensure minemacs-cache-dir "dirvish/"))
Expand Down

0 comments on commit 1d7aeb7

Please sign in to comment.