From a29041735c79625edc2ce8be5552f27c22a56203 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 25 Sep 2022 16:28:58 +0200 Subject: [PATCH] tweak(cli): read $DOOMPATH like $EMACSLOADPATH $EMACSLOADPATH is read to pre-fill load-path. Empty entries therein are substituted with the default value of load-path. I am mirroring this behavior with the $DOOMPATH variable. --- lisp/doom-cli.el | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lisp/doom-cli.el b/lisp/doom-cli.el index ec6bc9ea5..57917dea3 100644 --- a/lisp/doom-cli.el +++ b/lisp/doom-cli.el @@ -79,9 +79,15 @@ ;;; Variables (defvar doom-cli-load-path - (append (ignore-errors (split-string (getenv "DOOMPATH") path-separator)) - (list (doom-path (file-name-directory load-file-name) "cli"))) - "A list of paths to search for autoloaded CLIs on.") + (let ((paths (split-string (or (getenv "DOOMPATH") "") path-separator))) + (if (member "" paths) + (cl-substitute (doom-path (dir!) "cli/") "" paths :test #'equal) + paths)) + "A list of paths to search for autoloaded Doom CLIs. + +It is prefilled by the DOOMPATH envvar (a colon-separated list on Linux/macOS, +semicolon otherwise). Empty entries in DOOMPATH are replaced with the +$EMACSDIR/cli/.") (defvar doom-cli-argument-types '(&args