1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-12 09:00:40 -08:00

Allow :custom (foo1 bar1) (foo2 bar2) etc

Fixes https://github.com/jwiegley/use-package/issues/518
This commit is contained in:
John Wiegley 2017-11-28 14:16:13 -08:00
parent 4ad4a59685
commit 2ebf076733

View file

@ -1420,7 +1420,7 @@ deferred until the prefix key sequence is pressed."
(lambda (label arg) (lambda (label arg)
(unless (or (symbolp arg) (consp arg)) (unless (or (symbolp arg) (consp arg))
(use-package-error (use-package-error
(concat label " a <symbol> or a (<symbol> . <symbol or function>)" (concat label " a <symbol> or (<symbol or list of symbols> . <symbol or function>)"
" or list of these"))) " or list of these")))
(use-package-normalize-pairs (use-package-normalize-pairs
#'(lambda (k) #'(lambda (k)
@ -1463,20 +1463,15 @@ deferred until the prefix key sequence is pressed."
;;; :custom ;;; :custom
;; ;;
(defun use-package-normalize/:custom (name-symbol keyword args) (defun use-package-normalize/:custom (name keyword args)
"Normalize use-package custom keyword." "Normalize use-package custom keyword."
(cond (use-package-as-one (symbol-name keyword) args
((and (= (length args) 1) (lambda (label arg)
(listp (car args)) (unless (listp arg)
(listp (car (car args)))) (use-package-error
(car args)) (concat label " a (<symbol> <value> [comment])"
((and (= (length args) 1) " or list of these")))
(listp (car args))) arg)))
args)
(t
(use-package-error
(concat label " a (<symbol> <value> [comment])"
" or list of these")))))
(defun use-package-handler/:custom (name keyword args rest state) (defun use-package-handler/:custom (name keyword args rest state)
"Generate use-package custom keyword code." "Generate use-package custom keyword code."