[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/bind-map fb234332ff 32/97: Signal error if supplied map is
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/bind-map fb234332ff 32/97: Signal error if supplied map is not a keymap |
Date: |
Thu, 20 Jan 2022 07:59:12 -0500 (EST) |
branch: elpa/bind-map
commit fb234332ff995a75dcc7553e35b09825aeb49be0
Author: justbur <justin@burkett.cc>
Commit: justbur <justin@burkett.cc>
Signal error if supplied map is not a keymap
Also rename a local variable
---
bind-map.el | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/bind-map.el b/bind-map.el
index 05cfa1c05c..7fbce67721 100644
--- a/bind-map.el
+++ b/bind-map.el
@@ -132,7 +132,7 @@ unspecified the bindings are global.
:prefix-cmd COMMAND-NAME
Declare a prefix command for MAP named COMMAND-NAME."
- (let* ((root-map-sym (intern (format "%s-root-map" map)))
+ (let* ((root-map (intern (format "%s-root-map" map)))
(major-mode-list (intern (format "%s-major-modes" map)))
(activate (intern (format "%s-activate" map)))
(activate-func (intern (format "%s-activate-function" map)))
@@ -146,19 +146,21 @@ Declare a prefix command for MAP named COMMAND-NAME."
(major-modes (plist-get args :major-modes)))
`(progn
(defvar ,map (make-sparse-keymap))
+ (unless (keymapp ,map)
+ (error "bind-map: %s is not a keymap" ,map))
(setq ,prefix-cmd ,map)
(setf (symbol-function ',prefix-cmd) ,map)
(when ',minor-modes
- (defvar ,root-map-sym (make-sparse-keymap))
+ (defvar ,root-map (make-sparse-keymap))
(dolist (mode ',minor-modes)
- (push (cons mode ,root-map-sym) minor-mode-map-alist)))
+ (push (cons mode ,root-map) minor-mode-map-alist)))
(when ',major-modes
- (defvar ,root-map-sym (make-sparse-keymap))
+ (defvar ,root-map (make-sparse-keymap))
(defvar ,major-mode-list '())
(defvar-local ,activate nil)
- (push (cons ',activate ,root-map-sym) minor-mode-map-alist)
+ (push (cons ',activate ,root-map) minor-mode-map-alist)
(setq ,major-mode-list (append ,major-mode-list ',major-modes))
(defun ,activate-func ()
(setq ,activate (not (null (member major-mode ,major-mode-list)))))
@@ -168,10 +170,10 @@ Declare a prefix command for MAP named COMMAND-NAME."
;;bind keys in root-map
(progn
(dolist (key ',keys)
- (define-key ,root-map-sym key ',prefix-cmd))
+ (define-key ,root-map key ',prefix-cmd))
(when ',evil-keys
(bind-map-evil-define-key
- ',evil-states ,root-map-sym ',evil-keys ',prefix-cmd)))
+ ',evil-states ,root-map ',evil-keys ',prefix-cmd)))
;;bind in global maps
(dolist (key ',keys)
(global-set-key key ',prefix-cmd))
- [nongnu] elpa/bind-map 21f972e52d 08/97: Clarify some parts of README, (continued)
- [nongnu] elpa/bind-map 21f972e52d 08/97: Clarify some parts of README, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map d609a7d784 12/97: Add cl-lib requirement, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 27ed3304d2 19/97: Revert one of the changes in the previous commit, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 9f88b251f1 14/97: Fix typo, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 5077cb72cb 39/97: Add :override-minor-modes option for :keys, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 07eef581ef 15/97: Add URL, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map ce4e8e7f64 21/97: Fix typos in docstrings, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map f46bf57d7f 52/97: Add major-mode test, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map e3fa3cc383 26/97: Fix compiler warning, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 4489504e47 29/97: Check evil-keys before calling evil-define-*, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map fb234332ff 32/97: Signal error if supplied map is not a keymap,
ELPA Syncer <=
- [nongnu] elpa/bind-map 3f6eba7b5b 56/97: Make sure active-var is bound before setting, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 99236303f6 84/97: Rename bind-map-for-modes-derived, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 96802ece2b 76/97: Increment version, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 4ceb7deb3a 90/97: Remove messages from tests, ELPA Syncer, 2022/01/20
- [nongnu] elpa/bind-map 3b5a27e429 47/97: Tweak docstrings, ELPA Syncer, 2022/01/20