[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/setup 616ff73 1/4: Add :bind-into macro
From: |
ELPA Syncer |
Subject: |
[elpa] externals/setup 616ff73 1/4: Add :bind-into macro |
Date: |
Mon, 1 Nov 2021 14:57:41 -0400 (EDT) |
branch: externals/setup
commit 616ff73e22d748c6483c1762c686f600bb858188
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Add :bind-into macro
The motivation behind adding this macro is to demonstrate how setup
macros can build on other macros.
---
setup.el | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/setup.el b/setup.el
index 7609c8b..e6ca202 100644
--- a/setup.el
+++ b/setup.el
@@ -45,6 +45,7 @@
;; - Move macros :hide-mode, :advise, :needs, :if-host and :load-from
;; to EmacsWiki.
;; - Revert the indentation spec change for `setup-define'
+;; - Add :bind-into macro
;;
;;;; Version 1.1.0:
;;
@@ -453,6 +454,14 @@ the first FEATURE."
:debug '(form sexp)
:repeatable t)
+(setup-define :bind-into
+ (lambda (feature &rest rest)
+ `(:with-feature ,feature (:bind ,@rest)))
+ :documentation "Bind into keys into the map of FEATURE.
+The arguments REST are handled as by `:bind'."
+ :debug '(sexp &rest form sexp)
+ :indent 1)
+
(setup-define :hook
(lambda (function)
`(add-hook ',(setup-get 'hook) ,(setup-ensure-function function)))