From 2ebf0767332f0b56647085392adcc533904b96ef Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 28 Nov 2017 14:16:13 -0800 Subject: [PATCH] Allow :custom (foo1 bar1) (foo2 bar2) etc Fixes https://github.com/jwiegley/use-package/issues/518 --- lisp/use-package/use-package.el | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) 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." -- 2.39.2