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.
This commit is contained in:
Henrik Lissner 2022-09-25 16:28:58 +02:00
parent 1a1e7b808b
commit a29041735c
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -79,9 +79,15 @@
;;; Variables ;;; Variables
(defvar doom-cli-load-path (defvar doom-cli-load-path
(append (ignore-errors (split-string (getenv "DOOMPATH") path-separator)) (let ((paths (split-string (or (getenv "DOOMPATH") "") path-separator)))
(list (doom-path (file-name-directory load-file-name) "cli"))) (if (member "" paths)
"A list of paths to search for autoloaded CLIs on.") (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 (defvar doom-cli-argument-types
'(&args '(&args