From: John Wiegley Date: Tue, 28 Nov 2017 22:16:13 +0000 (-0800) Subject: Allow :custom (foo1 bar1) (foo2 bar2) etc X-Git-Tag: emacs-29.0.90~1306^2~15^2~245 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2ebf0767332f0b56647085392adcc533904b96ef;p=emacs.git Allow :custom (foo1 bar1) (foo2 bar2) etc Fixes https://github.com/jwiegley/use-package/issues/518 --- diff --git a/lisp/use-package/use-package.el b/lisp/use-package/use-package.el index 648e2c7c8ae..f6c21e0a903 100644 --- a/lisp/use-package/use-package.el +++ b/lisp/use-package/use-package.el @@ -1420,7 +1420,7 @@ deferred until the prefix key sequence is pressed." (lambda (label arg) (unless (or (symbolp arg) (consp arg)) (use-package-error - (concat label " a or a ( . )" + (concat label " a or ( . )" " or list of these"))) (use-package-normalize-pairs #'(lambda (k) @@ -1463,20 +1463,15 @@ deferred until the prefix key sequence is pressed." ;;; :custom ;; -(defun use-package-normalize/:custom (name-symbol keyword args) +(defun use-package-normalize/:custom (name keyword args) "Normalize use-package custom keyword." - (cond - ((and (= (length args) 1) - (listp (car args)) - (listp (car (car args)))) - (car args)) - ((and (= (length args) 1) - (listp (car args))) - args) - (t - (use-package-error - (concat label " a ( [comment])" - " or list of these"))))) + (use-package-as-one (symbol-name keyword) args + (lambda (label arg) + (unless (listp arg) + (use-package-error + (concat label " a ( [comment])" + " or list of these"))) + arg))) (defun use-package-handler/:custom (name keyword args rest state) "Generate use-package custom keyword code."