branch: elpa/bind-map commit 115e0459bf115775f2f928c12515f397cc541eb5 Author: justbur <jus...@burkett.cc> Commit: justbur <jus...@burkett.cc>
Bring back set-keys function The syntax is simpler than the alternatives I think. --- bind-map.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bind-map.el b/bind-map.el index e8ddaa278c..3c246f05da 100644 --- a/bind-map.el +++ b/bind-map.el @@ -165,6 +165,17 @@ MAPS, and KEYS." (evil-define-key state map key ,def)) (evil-global-set-key state key ,def))))))) +;;;###autoload +(defun bind-map-set-keys (map key def &rest bindings) + "Add a series of default bindings for LEADER. +Default bindings never override existing ones. BINDINGS is a +series of KEY DEF pairs. Each KEY should be a string suitable for +`kbd'." + (while key + (define-key map (kbd key) def) + (setq key (pop bindings) def (pop bindings)))) +(put 'bind-map-set-keys 'lisp-indent-function 'defun) + ;;;###autoload (defun bind-map-set-key-defaults (map key def &rest bindings) "Add a series of default bindings for LEADER. @@ -175,6 +186,7 @@ series of KEY DEF pairs. Each KEY should be a string suitable for (unless (lookup-key map (kbd key)) (define-key map (kbd key) def)) (setq key (pop bindings) def (pop bindings)))) +(put 'bind-map-set-key-defaults 'lisp-indent-function 'defun) (provide 'bind-map) ;;; olig.el ends here