From 195618bcf36a4ee2fe6f038d6d27936f1c1f22df Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 31 Jan 2022 00:54:53 -0600 Subject: Random stuff --- lisp/+setup.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lisp/+setup.el') diff --git a/lisp/+setup.el b/lisp/+setup.el index 367fb01..d8e9bb8 100644 --- a/lisp/+setup.el +++ b/lisp/+setup.el @@ -94,5 +94,22 @@ replace itself with the RECIPE's package." :indent 1 :shorthand #'+setup-straight-shorthand) + +;;; Redefines of `setup' forms + +(setup-define :bind-into + (lambda (feature-or-map &rest rest) + (cl-loop for f/m in (ensure-list feature-or-map) + collect (if (string-match-p "-map\\'" (symbol-name f/m)) + `(:with-map ,f/m (:bind ,@rest)) + `(:with-feature ,f/m (:bind ,@rest))) + into forms + finally return `(progn ,@forms))) + :documentation "Bind into keys into the map(s) of FEATURE-OR-MAP. +FEATURE-OR-MAP can be a feature or map name or a list of them. +The arguments REST are handled as by `:bind'." + :debug '(sexp &rest form sexp) + :indent 1) + (provide '+setup) ;;; +setup.el ends here -- cgit 1.4.1-21-gabe81