[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bind-map d7aee3c6ab 09/97: Note helper funcs in README
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bind-map d7aee3c6ab 09/97: Note helper funcs in README |
Date: |
Thu, 20 Jan 2022 07:58:51 -0500 (EST) |
branch: elpa/bind-map
commit d7aee3c6ab82dbc4803113dd44c124df600154e1
Author: justbur <justin@burkett.cc>
Commit: justbur <justin@burkett.cc>
Note helper funcs in README
---
README.org | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/README.org b/README.org
index 5ed28071cf..9c867e80b1 100644
--- a/README.org
+++ b/README.org
@@ -28,3 +28,28 @@ in a series of keymaps separate from built-in mode maps. You
can simply add keys
using the built-in =define-key= to =my-lisp-map= for example, and a declaration
like the one above will take care of ensuring that these bindings are available
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.
+
+#+BEGIN_SRC emacs-lisp
+(bind-map-set-keys my-lisp-map
+ "c" 'compile
+ "C" 'check
+ ;; ...
+ )
+(bind-map-set-key-defaults my-lisp-map
+ "c" 'compile
+ "C" 'check
+ ;; ...
+ )
+#+END_SRC
+
+The second function only adds the bindings if there is no existing binding for
+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.
- [nongnu] branch elpa/bind-map created (now 510a24138d), ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 6e19e536fc 03/97: Add link to evil-leader, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map f2f7dfefbd 07/97: Assume :keys and :evil-keys are lists, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 3a2f1d8074 01/97: Initial commit, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 115e0459bf 05/97: Bring back set-keys function, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map d7aee3c6ab 09/97: Note helper funcs in README,
ELPA Syncer <=
- [nongnu] elpa/bind-map a8a2937ecc 38/97: Minor tweak to previous commit, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map faaa33d909 77/97: Prefer eval-after-load to require for evil funcs, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 61fe55e097 17/97: Can't simply use cl-pushnew, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 5508980148 69/97: Account for multiple declarations of the same map, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map b05ea98102 37/97: Add option to use local state maps, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 7d20946692 04/97: Add autoloads, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 7de08fe592 43/97: Move a defvar and reword docstring, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map bb7a8b2258 59/97: Remove declare-function from previous commit, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 6d05297e3c 20/97: Add another example and more detail to README, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map d47be94d23 63/97: Don't try to bind keys that are nil or "", ELPA Syncer, 2022/01/20