From 884343deb4c9c7837356b27968c1e594d8730d49 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 12 Mar 2021 17:32:13 -0600 Subject: Add `:set', `:local', `:require' keywords to `acdw/pkg' --- lisp/acdw.el | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'lisp') diff --git a/lisp/acdw.el b/lisp/acdw.el index 6641e9b..002f8f6 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el @@ -191,13 +191,21 @@ KEYMAP can be nil." ARGS can include the following keywords: -:now FORMS .. run forms immediately. - Good for settings and auxiliary functions. -:then FORMS .. run forms after loading PACKAGE, using `with-eval-after-load'. -:binds BINDS .. run `acdw/bind-after-map' on BINDS. -:hooks HOOKS .. run `acdw/hooks-after' on HOOKS." +:local BOOL .. if BOOL is non-nil, don't run `straight-use-package' on + PACKAGE. Good for using `acdw/pkg' on local features. +:require BOOL .. if BOOL is non-nil, run `require' on PACKAGE before anything. +:now FORMS .. run FORMS immediately. +:then FORMS .. run FORMS after loading PACKAGE, using `with-eval-after-load'. +:set SETTINGS .. pass SETTINGS to `acdw/set', right after `:now' forms. + SETTINGS should be properly quoted, just like they'd be passed + to the function. +:binds BINDS .. run `acdw/bind-after-map' on BINDS. +:hooks HOOKS .. run `acdw/hooks' on HOOKS." (declare (indent 1)) - (let ((now-forms (plist-get args :now)) + (let ((local-pkg (plist-get args :local)) + (require-pkg (plist-get args :require)) + (now-forms (plist-get args :now)) + (settings (plist-get args :set)) (binds (plist-get args :binds)) (hooks (plist-get args :hooks)) (then-forms (plist-get args :then)) @@ -212,9 +220,14 @@ ARGS can include the following keywords: (when binds (push `(acdw/bind-after-map ,(symbol-name requirement) nil ,binds) final-form)) + (when settings + (push `(acdw/set ,settings) final-form)) (when now-forms (push `(progn ,@now-forms) final-form)) - (push `(straight-use-package ',package) final-form) + (unless local-pkg + (push `(straight-use-package ',package) final-form)) + (when require-pkg + (push `(require ',requirement) final-form)) `(progn ,@final-form))) -- cgit 1.4.1-21-gabe81