From 18887163f969865cb5276fcd9e143f65408c3b0c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 7 Sep 2022 11:38:36 +0200 Subject: [PATCH] tweak(cli): add lisp/cli to doom-cli-load-path by default --- bin/doom | 7 ++----- lisp/doom-cli.el | 3 ++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/bin/doom b/bin/doom index 4ca9f5f71..473b05be2 100755 --- a/bin/doom +++ b/bin/doom @@ -236,12 +236,9 @@ SEE ALSO: ;; can do so in .doomrc or .doomproject. (load! doom-module-init-file doom-user-dir t) +;; There are a lot of CLIs, and some have expensive initialization, so best we +;; load them lazily. (let ((dir (doom-path doom-core-dir "cli"))) - ;; It'd be simple to just load these files directly, but because there could - ;; be a lot of them (and some of them have expensive dependencies), I use - ;; `defautoload!' to load them lazily. - (add-to-list 'doom-cli-load-path dir) - ;; Library for generating autoloads files for Doom modules & packages. (load! "autoloads" dir) diff --git a/lisp/doom-cli.el b/lisp/doom-cli.el index 0b15dbd3b..017fae7d8 100644 --- a/lisp/doom-cli.el +++ b/lisp/doom-cli.el @@ -84,7 +84,8 @@ ;;; Variables (defvar doom-cli-load-path - (ignore-errors (split-string (getenv "DOOMPATH") path-separator)) + (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.") (defvar doom-cli-argument-types