From 18b9bf18ad5c14dccaf0448768b0ad0435c3a93e Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 28 Nov 2017 11:16:12 -0800 Subject: [PATCH] Don't allow :commands, :bind, etc., to be given an empty list This makes the following an error: :commands :commands nil :commands () Fixes https://github.com/jwiegley/use-package/issues/512 --- lisp/use-package/use-package.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index 26ede8483fd..77c2aebdc10 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -828,12 +828,12 @@ If the package is installed, its entry is removed from (defun use-package-as-one (label args f) "Call F on the first element of ARGS if it has one element, or all of ARGS." (declare (indent 1)) - (if (and (listp args) (listp (cdr args))) + (if (and (not (null args)) (listp args) (listp (cdr args))) (if (= (length args) 1) (funcall f label (car args)) (funcall f label args)) (use-package-error - (concat label " wants a list")))) + (concat label " wants a non-empty list")))) (put 'use-package-as-one 'lisp-indent-function 'defun) -- 2.39.2