[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/setup c707965 10/25: Handle symbols in :global, :bind,
From: |
Stefan Monnier |
Subject: |
[elpa] externals/setup c707965 10/25: Handle symbols in :global, :bind, :unbind and :rebind |
Date: |
Wed, 14 Apr 2021 18:49:01 -0400 (EDT) |
branch: externals/setup
commit c7079651d6bc17192238d451648543a5a91f53ab
Author: Philip K <philipk@posteo.net>
Commit: Philip K <philipk@posteo.net>
Handle symbols in :global, :bind, :unbind and :rebind
---
setup.el | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/setup.el b/setup.el
index 82463cb..b1a4724 100644
--- a/setup.el
+++ b/setup.el
@@ -266,7 +266,9 @@ the first FEATURE."
(setup-define :global
(lambda (key command)
`(global-set-key
- ,(if (stringp key) (kbd key) key)
+ ,(cond ((stringp key) (kbd key))
+ ((symbolp key) `(kbd ,key))
+ (t key))
#',command))
:documentation "Globally bind KEY to COMMAND."
:debug '(form sexp)
@@ -275,7 +277,9 @@ the first FEATURE."
(setup-define :bind
(lambda (key command)
`(define-key (symbol-value setup-map)
- ,(if (stringp key) (kbd key) key)
+ ,(cond ((stringp key) (kbd key))
+ ((symbolp key) `(kbd ,key))
+ (t key))
#',command))
:documentation "Bind KEY to COMMAND in current map."
:after-loaded t
@@ -285,7 +289,9 @@ the first FEATURE."
(setup-define :unbind
(lambda (key)
`(define-key (symbol-value setup-map)
- ,(if (stringp key) (kbd key) key)
+ ,(cond ((stringp key) (kbd key))
+ ((symbolp key) `(kbd ,key))
+ (t key))
nil))
:documentation "Unbind KEY in current map."
:after-loaded t
@@ -298,7 +304,9 @@ the first FEATURE."
(dolist (key (where-is-internal ',command (symbol-value setup-map)))
(define-key (symbol-value setup-map) key nil))
(define-key (symbol-value setup-map)
- ,(if (stringp key) (kbd key) key)
+ ,(cond ((stringp key) (kbd key))
+ ((symbolp key) `(kbd ,key))
+ (t key))
#',command)))
:documentation "Unbind the current key for COMMAND, and bind it to KEY."
:after-loaded t
- [elpa] externals/setup 7562f2f 12/25: Prevent :option values from being saved in the user theme, (continued)
- [elpa] externals/setup 7562f2f 12/25: Prevent :option values from being saved in the user theme, Stefan Monnier, 2021/04/14
- [elpa] externals/setup 9a67209 14/25: Always call custom-load-symbol before customizing an option, Stefan Monnier, 2021/04/14
- [elpa] externals/setup f764229 15/25: Explain how :with-feature sets an implicit mode, Stefan Monnier, 2021/04/14
- [elpa] externals/setup 439b4a8 02/25: Raise an error if lexical binding is not enabled, Stefan Monnier, 2021/04/14
- [elpa] externals/setup a77d9f2 03/25: Don't apply kbd to symbols in :global, :bind, :unbind and :rebind, Stefan Monnier, 2021/04/14
- [elpa] externals/setup ec23802 04/25: Check for duplicate elements with append/remove, Stefan Monnier, 2021/04/14
- [elpa] externals/setup df6f6eb 13/25: Add note on modifying option names, Stefan Monnier, 2021/04/14
- [elpa] externals/setup 7e3d025 05/25: Update documentation for :option and :local-set, Stefan Monnier, 2021/04/14
- [elpa] externals/setup e1d51a3 07/25: Add (remove VAR) form for :option, Stefan Monnier, 2021/04/14
- [elpa] externals/setup 7699c78 08/25: Reindent commentary examples, Stefan Monnier, 2021/04/14
- [elpa] externals/setup c707965 10/25: Handle symbols in :global, :bind, :unbind and :rebind,
Stefan Monnier <=
- [elpa] externals/setup ea52eb1 17/25: Add note that :option does not manipulate user theme., Stefan Monnier, 2021/04/14
- [elpa] externals/setup 2503ad0 25/25: Expand load path for :load-from, Stefan Monnier, 2021/04/14
- [elpa] externals/setup d44d333 20/25: Add :load-from macro, Stefan Monnier, 2021/04/14
- [elpa] externals/setup 5728369 18/25: Fix shell example in README and Commentary section, Stefan Monnier, 2021/04/14
- [elpa] externals/setup 22b5312 23/25: Add :file-match macro, Stefan Monnier, 2021/04/14
- [elpa] externals/setup f7d5906 16/25: Replace customize-set-variable with the necessary parts, Stefan Monnier, 2021/04/14
- [elpa] externals/setup b7aa594 19/25: Allow :hook-into to also use hook names, Stefan Monnier, 2021/04/14
- [elpa] externals/setup 757de04 21/25: Replace yasnippet example with dired, Stefan Monnier, 2021/04/14
- [elpa] externals/setup bc0edb4 24/25: Handle argument list for :load-from properly, Stefan Monnier, 2021/04/14
- [elpa] externals/setup 32e4f7f 22/25: Fix syntax in examples, Stefan Monnier, 2021/04/14