mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-24 07:20:37 +00:00
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
This commit is contained in:
parent
4ddf42185a
commit
18b9bf18ad
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user