[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bind-map ce11d259bf 42/97: Update commentary to match READ
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bind-map ce11d259bf 42/97: Update commentary to match README |
Date: |
Thu, 20 Jan 2022 07:59:18 -0500 (EST) |
branch: elpa/bind-map
commit ce11d259bf6b6f5feae454716fca9c339c201c7b
Author: justbur <justin@burkett.cc>
Commit: justbur <justin@burkett.cc>
Update commentary to match README
---
bind-map.el | 86 ++++++++++++++++++++++++++++++++++++++++---------------------
1 file changed, 56 insertions(+), 30 deletions(-)
diff --git a/bind-map.el b/bind-map.el
index ee49b23299..f27a173f7c 100644
--- a/bind-map.el
+++ b/bind-map.el
@@ -23,60 +23,83 @@
;;; Commentary:
-;; bind-map is an Emacs package providing the macro `bind-map' which can be
used
+;; bind-map is an Emacs package providing the macro bind-map which can be used
;; to make a keymap available across different "leader keys" including ones
tied
;; to evil states. It is essentially a generalization of the idea of a leader
;; key as used in vim or the Emacs https://github.com/cofi/evil-leader package,
;; and allows for an arbitrary number of "leader keys". This is probably best
;; explained with an example.
-;; (bind-map my-lisp-map
+;; (bind-map my-base-leader-map
;; :keys ("M-m")
;; :evil-keys ("SPC")
-;; :evil-states (normal visual)
+;; :evil-states (normal motion visual))
+
+;; (bind-map my-elisp-map
+;; :keys ("M-m m" "M-RET")
+;; :evil-keys ("SPC m" ",")
+;; :major-modes (emacs-lisp-mode
+;; lisp-interaction-mode))
+
+;; This will make my-base-leader-map (automatically creating the map if it's
not
+;; defined yet) available under the prefixes (or leaders) M-m and SPC, where
the
+;; latter is only bound in evil's normal, motion or visual states. The second
+;; declaration makes my-elisp-map available under the specified keys when one
of
+;; the specified major modes is active. In the second case, the evil states
used
+;; are also normal motion and visual because this is the default as specified
in
+;; bind-map-default-evil-states. It is possible to make the bindings
conditional
+;; on minor modes being loaded, or a mix of major and minor modes. Since the
+;; symbols of the modes are used, it is not necessary to ensure that any of the
+;; mode's packages are loaded prior to this declaration. See the docstring of
+;; bind-map for more options.
+
+;; This package will only make use of evil if one of the evil related keywords
+;; is specified. This declaration, for example, makes no use of the evil
+;; package.
+
+;; (bind-map my-elisp-map
+;; :keys ("M-m m" "M-RET")
;; :major-modes (emacs-lisp-mode
-;; lisp-interaction-mode
-;; lisp-mode))
-
-;; This will take my-lisp-map and make it available under the prefixes (or
-;; leaders) M-m and SPC, where the latter is only bound in evil's normal or
-;; visual state (defaults in `bind-map-default-evil-states') when one of the
-;; specified major mode is active (there is no need to make sure the respective
-;; modes' packages are loaded before this declaration). It is also possible to
-;; make the bindings conditional on minor modes being loaded, or a mix of major
-;; and minor modes. If no modes are specified, the relevant global maps are
-;; used. See the docstring of `bind-map' for more options.
+;; lisp-interaction-mode))
;; The idea behind this package is that you want to organize your personal
;; bindings 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,
+;; simply add keys using the built-in define-key to my-elisp-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) 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.
-
-;; (bind-map-set-keys my-lisp-map
-;; "c" 'compile
-;; "C" 'check
+;; You may use the built-in define-key which will function as intended.
bind-key
+;; (part of https://github.com/jwiegley/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.
+
+;; (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)
;; ;; ...
-;; )
-;; (bind-map-set-key-defaults my-lisp-map
-;; "c" 'compile
-;; "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))
;; ;; ...
-;; )
;; 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.
+;; passed to kbd before binding them.
;;; Code:
@@ -102,6 +125,9 @@ the bindings on major and/or minor modes being active. The
options are controlled through the keyword arguments ARGS, all of
which are optional.
+The package evil is only required if one of the :evil-keys is
+specified.
+
:keys (KEY1 KEY2 ...)
The keys to use for the leader binding. These are strings
- [nongnu] elpa/bind-map c8fa049b70 13/97: Update Commentary section to match README, (continued)
- [nongnu] elpa/bind-map c8fa049b70 13/97: Update Commentary section to match README, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 281a56c332 16/97: Fix major-mode-list, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map db9d72efcd 31/97: Better version of bind-map-key, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 76f742191b 24/97: Add gitignore, ELPA Syncer, 2022/01/20
- [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 <=
- [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, 2022/01/20
- [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