Change use-package to use bind-keys and bind-keys*

Fixes https://github.com/jwiegley/use-package/issues/129
This commit is contained in:
John Wiegley 2015-03-21 03:46:26 -05:00
parent 012c37d722
commit 8c00f108bf
2 changed files with 28 additions and 31 deletions

View file

@ -633,19 +633,13 @@ manually updated package."
(defun use-package-handler/:bind
(name-symbol keyword arg rest state &optional override)
(let* (commands
(form (mapcar
#'(lambda (binding)
(push (cdr binding) commands)
`(,(if override
'bind-key*
'bind-key) ,(car binding) #',(cdr binding))) arg)))
(let ((commands (mapcar #'cdr arg)))
(use-package-concat
(use-package-process-keywords name-symbol
(use-package-sort-keywords
(use-package-plist-maybe-put rest :defer t))
(use-package-plist-append state :commands commands))
`((ignore ,@form)))))
`((ignore (,(if override 'bind-keys* 'bind-keys) ,@arg))))))
(defun use-package-handler/:bind* (name-symbol keyword arg rest state)
(use-package-handler/:bind name-symbol keyword arg rest state t))