From: Noam Postavsky Date: Fri, 5 Aug 2016 22:43:34 +0000 (-0400) Subject: Don't allow implicit package name arg for binders X-Git-Tag: emacs-29.0.90~1306^2~15^2~275^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9688d2f64bd01b86a98ccd87138e6fc0a345e62b;p=emacs.git Don't allow implicit package name arg for binders It's unlikely that (use-package foopkg :bind "") intendes to bind to 'foopkg command. --- diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index 96137c3c78d..f99a3767777 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -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 ( . )" + " 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)))) diff --git a/test/lisp/use-package/use-package-tests.el b/test/lisp/use-package/use-package-tests.el index d3deef995b1..00682e9e0fc 100644 --- a/test/lisp/use-package/use-package-tests.el +++ b/test/lisp/use-package/use-package-tests.el @@ -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