mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-10 16:20:17 -08:00
Allow :custom (foo1 bar1) (foo2 bar2) etc
Fixes https://github.com/jwiegley/use-package/issues/518
This commit is contained in:
parent
4ad4a59685
commit
2ebf076733
1 changed files with 9 additions and 14 deletions
|
|
@ -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 <symbol> or a (<symbol> . <symbol or function>)"
|
||||
(concat label " a <symbol> or (<symbol or list of symbols> . <symbol or function>)"
|
||||
" 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 (<symbol> <value> [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 (<symbol> <value> [comment])"
|
||||
" or list of these")))
|
||||
arg)))
|
||||
|
||||
(defun use-package-handler/:custom (name keyword args rest state)
|
||||
"Generate use-package custom keyword code."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue