[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bind-map 6e1ba6edbd 94/97: Update README
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bind-map 6e1ba6edbd 94/97: Update README |
Date: |
Thu, 20 Jan 2022 07:59:32 -0500 (EST) |
branch: elpa/bind-map
commit 6e1ba6edbd5a29991698806e775288fb3de2b186
Author: Justin Burkett <justin@burkett.cc>
Commit: Justin Burkett <justin@burkett.cc>
Update README
---
README.org | 47 ++++++++++++++++++++++++++++++++++++-----------
1 file changed, 36 insertions(+), 11 deletions(-)
diff --git a/README.org b/README.org
index b1fd0681c8..dde188f520 100644
--- a/README.org
+++ b/README.org
@@ -50,29 +50,37 @@ in the correct places.
** Binding keys in the maps
You may use the built-in =define-key= which will function as intended.
=bind-key= (part of [[https://github.com/jwiegley/use-package][use-package]])
is another option. For those who want a
-different interface, the following functions are also provided, which both just
-use =define-key= internally, but allow for multiple bindings without much
-syntax.
+different interface, you may either use the =:bindings= keyword in the
+=bind-map= macro or the two provided functions =bind-map-set-keys= and
+=bind-map-set-key-defaults=, which both just use =define-key= internally, but
+allow for multiple bindings without much syntax.
#+BEGIN_SRC emacs-lisp
+ (bind-map my-base-leader-map
+ :keys ("M-m")
+ :evil-keys ("SPC")
+ :evil-states (normal motion visual)
+ :bindings ("c" 'compile
+ "C" 'check))
+
(bind-map-set-keys my-base-leader-map
"c" 'compile
"C" 'check
;; ...
)
- ;; is the same as
- ;; (define-key my-base-leader-map (kbd "c") 'compile)
- ;; (define-key my-base-leader-map (kbd "C") 'check)
- ;; ...
+ ;; is the same as
+ ;; (define-key my-base-leader-map (kbd "c") 'compile)
+ ;; (define-key my-base-leader-map (kbd "C") 'check)
+ ;; ...
(bind-map-set-key-defaults my-base-leader-map
"c" 'compile
;; ...
)
- ;; is the same as
- ;; (unless (lookup-key my-base-leader-map (kbd "c"))
- ;; (define-key my-base-leader-map (kbd "c") 'compile))
- ;; ...
+ ;; is the same as
+ ;; (unless (lookup-key my-base-leader-map (kbd "c"))
+ ;; (define-key my-base-leader-map (kbd "c") 'compile))
+ ;; ...
#+END_SRC
The second function only adds the bindings if there is no existing binding for
@@ -80,3 +88,20 @@ that key. It is probably only useful for shared
configurations, where you want
to provide a default binding but don't want that binding to overwrite one made
by the user. Note the keys in both functions are strings that are passed to
=kbd= before binding them.
+
+** Avoiding repetition
+If you use multiple =bind-map= declarations you might find yourself repeating
+properties like =:evil-keys= and =:evil-states=. You may use
+=bind-map-for-mode-inherit= to automatically pull these properties from a
parent
+map as the following example illustrates. See the docstring for more
+information.
+
+#+BEGIN_SRC emacs-lisp
+(bind-map my-leader-map
+ :keys ("M-m")
+ :evil-keys ("SPC")
+ :evil-states (normal motion visual))
+
+(bind-map-for-mode-inherit my-markdown-map my-leader-map
+ :major-modes (markdown-mode))
+#+END_SRC
- [nongnu] elpa/bind-map 74e9defb60 25/97: Fix doctrings for recent additions, (continued)
- [nongnu] elpa/bind-map 74e9defb60 25/97: Fix doctrings for recent additions, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 38dc69ab80 49/97: Make sure major-mode keys are activated initially, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map df2f5081e1 27/97: Use custom kbd command, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map b30c22f7f9 33/97: Report symbol name in previously added error msg, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 7ab7ae8dd3 62/97: Fix cask file, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 8e3df1f4cf 36/97: Use add-to-list for mm list and defvar prefix, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map ce11d259bf 42/97: Update commentary to match README, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 32a3361b3b 67/97: Bring back evil-define-minor-mode-key, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 56e4a914c2 82/97: Fix tests, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 797c2124f8 86/97: Restructure tests, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 6e1ba6edbd 94/97: Update README,
ELPA Syncer <=
- [nongnu] elpa/bind-map 873c26d467 89/97: Get basic inheritance tests working, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 6977e0fec5 96/97: Bump version to 1.1.2, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map b59d7bbab7 40/97: Add note about dependence on evil to README, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 5c6f17939c 28/97: Get rid of eval-after-loads to fix evil bindings, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 80c38c4052 61/97: Add badges, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 4cccf8fb82 23/97: Add configuration var for default map suffix, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 7a4d329a60 18/97: Correct wrong package names, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 4cf9dfd1cb 81/97: Fix declare form, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map ddce68ed1d 53/97: Move evil-local-mode hook next to var, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 2a5fcbd947 73/97: Revert "Fix incorrect check of override mode in local hook", ELPA Syncer, 2022/01/20