diff options
author | John Wiegley <johnw@newartisans.com> | 2015-07-31 23:30:30 -0700 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2015-07-31 23:30:30 -0700 |
commit | 282241cf7dea694ad649f9e240813ba7affca421 (patch) | |
tree | 2e89f98b31eaa89b314cce3da3ad6dc73e969581 /lisp/use-package/use-package.el | |
parent | 269b1080ae3a11819dd33ebe3359952f7d5fd797 (diff) | |
parent | 1cbcd66ebe98f7fab83aa3b4239bcb073029e74e (diff) | |
download | emacs-282241cf7dea694ad649f9e240813ba7affca421.tar.gz emacs-282241cf7dea694ad649f9e240813ba7affca421.tar.bz2 emacs-282241cf7dea694ad649f9e240813ba7affca421.zip |
Merge pull request from nickalcock/master
Support :bind (:map '(...)).
GitHub-reference: https://github.com/jwiegley/use-package/issues/235
Diffstat (limited to 'lisp/use-package/use-package.el')
-rw-r--r-- | lisp/use-package/use-package.el | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index 78abd9f776f..36360632813 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -629,11 +629,13 @@ manually updated package." ((use-package-is-sympair arg allow-vector) (list arg)) ((and (not recursed) (listp arg) (listp (cdr arg))) - (mapcar #'(lambda (x) (car (use-package-normalize-pairs - name-symbol label x t allow-vector))) arg)) - (t - (use-package-error - (concat label " wants a string, (string . symbol) or list of these"))))) + (mapcar #'(lambda (x) + (let ((ret (use-package-normalize-pairs + name-symbol label x t allow-vector))) + (if (listp ret) + (car ret) + ret))) arg)) + (t arg))) (defun use-package-normalize-binder (name-symbol keyword args) (use-package-as-one (symbol-name keyword) args @@ -645,7 +647,10 @@ manually updated package." (defun use-package-handler/:bind (name-symbol keyword arg rest state &optional override) - (let ((commands (mapcar #'cdr arg))) + (let ((commands (remq nil (mapcar #'(lambda (arg) + (if (listp arg) + (cdr arg) + nil)) arg)))) (use-package-concat (use-package-process-keywords name-symbol (use-package-sort-keywords |