Don't allow implicit package name arg for binders
It's unlikely that
(use-package foopkg :bind "<some-key>")
intendes to bind <some-key> to 'foopkg command.
This commit is contained in:
@@ -712,6 +712,10 @@ If RECURSED is non-nil, recurse into sublists."
|
||||
(defun use-package-normalize-binder (name keyword args)
|
||||
(use-package-as-one (symbol-name keyword) args
|
||||
(lambda (label arg)
|
||||
(unless (consp arg)
|
||||
(use-package-error
|
||||
(concat label " a (<string or vector> . <symbol or string>)"
|
||||
" or list of these")))
|
||||
(use-package-normalize-pairs (lambda (k) (or (stringp k) (vectorp k)))
|
||||
(lambda (b) (or (symbolp b) (stringp b)))
|
||||
name label arg))))
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
(should (equal (use-package-normalize-binder
|
||||
'foopkg :bind good-values)
|
||||
good-values)))
|
||||
(should-error (use-package-normalize-binder
|
||||
'foopkg :bind '("foo")))
|
||||
(should-error (use-package-normalize-binder
|
||||
'foopkg :bind '("foo" . 99)))
|
||||
(should-error (use-package-normalize-binder
|
||||
|
||||
Reference in New Issue
Block a user