From e4cfdc7fcb843361480244fd35d5a3ef67f02641 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 22 Jun 2018 01:48:04 +0200 Subject: [PATCH] Use :when instead of (when ...) block For loading dash docsets in feature/lookup module. Fixes 'Cannot find package' load errors during byte-compilation. --- modules/feature/lookup/config.el | 33 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/modules/feature/lookup/config.el b/modules/feature/lookup/config.el index 03432aecd..5f0431a4b 100644 --- a/modules/feature/lookup/config.el +++ b/modules/feature/lookup/config.el @@ -122,23 +122,24 @@ argument: the identifier at point.") ;; Dash docset integration ;; -(when (featurep! +docsets) - ;; Both packages depend on helm-dash - (def-package! helm-dash - :defer t - :init - (setq helm-dash-enable-debugging doom-debug-mode - helm-dash-browser-func #'eww) - :config - (unless (file-directory-p helm-dash-docsets-path) - (setq helm-dash-docsets-path (concat doom-etc-dir "docsets/"))) - (unless (file-directory-p helm-dash-docsets-path) - (make-directory helm-dash-docsets-path t))) +;; Both packages depend on helm-dash, for now +(def-package! helm-dash + :defer t + :when (featurep! +docsets) + :init + (setq helm-dash-enable-debugging doom-debug-mode + helm-dash-browser-func #'eww) + :config + (unless (file-directory-p helm-dash-docsets-path) + (setq helm-dash-docsets-path (concat doom-etc-dir "docsets/"))) + (unless (file-directory-p helm-dash-docsets-path) + (make-directory helm-dash-docsets-path t))) - (def-package! counsel-dash - :when (featurep! :completion ivy) - :commands counsel-dash-install-docset - :config (setq counsel-dash-min-length 2))) +(def-package! counsel-dash + :when (and (featurep! +docsets) + (featurep! :completion ivy)) + :commands counsel-dash-install-docset + :config (setq counsel-dash-min-length 2)) ;;