From 053a1514a1ec1690b4a5e4c07618fc8c4b083359 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 13 Apr 2014 23:59:36 -0400 Subject: [PATCH 1/3] fix typo Actually the reader accepts (list 'a'b) = (list 'a 'b); it still looks wrong. --- lisp/use-package/bind-key.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/use-package/bind-key.el b/lisp/use-package/bind-key.el index 5ef7570cdef..bb4bf13f518 100644 --- a/lisp/use-package/bind-key.el +++ b/lisp/use-package/bind-key.el @@ -186,7 +186,7 @@ function symbol (unquoted)." `(progn ,@(when prefix-map `((defvar ,prefix-map) - ,@(when doc `((put ',prefix-map'variable-documentation ,doc))) + ,@(when doc `((put ',prefix-map 'variable-documentation ,doc))) (define-prefix-command ',prefix-map) (bind-key ,prefix ',prefix-map ,@(when map (list map))))) ,@(mapcar (lambda (form) `(bind-key ,(if prefix From 869ff53ab906e818d92656f315ad2113118ea49e Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Mon, 14 Apr 2014 00:01:28 -0400 Subject: [PATCH 2/3] bind-keys: ,@(when map (list map)) => map Omitting map is same as passing nil. --- lisp/use-package/bind-key.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/use-package/bind-key.el b/lisp/use-package/bind-key.el index bb4bf13f518..bd8aa626cba 100644 --- a/lisp/use-package/bind-key.el +++ b/lisp/use-package/bind-key.el @@ -188,12 +188,12 @@ function symbol (unquoted)." `((defvar ,prefix-map) ,@(when doc `((put ',prefix-map 'variable-documentation ,doc))) (define-prefix-command ',prefix-map) - (bind-key ,prefix ',prefix-map ,@(when map (list map))))) + (bind-key ,prefix ',prefix-map ,map))) ,@(mapcar (lambda (form) `(bind-key ,(if prefix (concat prefix " " (car form)) (car form)) ',(cdr form) - ,@(when map (list map)))) + ,map)) key-bindings)))) (defun get-binding-description (elem) From 01196c81ac8aa530781d2d0f30e41621b2c7a3f2 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 13 Apr 2014 23:55:06 -0400 Subject: [PATCH 3/3] bind-keys: bind directly to prefix-map instead of constructing equivalent key sequence by string concatenation. This allows specifying vector key sequences, as in bind-key (since f0776c2aeb3f7f0af66597e10a3e4469ca26629d). --- lisp/use-package/bind-key.el | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lisp/use-package/bind-key.el b/lisp/use-package/bind-key.el index bd8aa626cba..d2a21f3986b 100644 --- a/lisp/use-package/bind-key.el +++ b/lisp/use-package/bind-key.el @@ -189,11 +189,9 @@ function symbol (unquoted)." ,@(when doc `((put ',prefix-map 'variable-documentation ,doc))) (define-prefix-command ',prefix-map) (bind-key ,prefix ',prefix-map ,map))) - ,@(mapcar (lambda (form) `(bind-key ,(if prefix - (concat prefix " " (car form)) - (car form)) - ',(cdr form) - ,map)) + ,@(mapcar (lambda (form) + `(bind-key ,(car form) ',(cdr form) + ,(or prefix-map map))) key-bindings)))) (defun get-binding-description (elem)