diff options
-rw-r--r-- | lisp/use-package/use-package-core.el | 4 | ||||
-rw-r--r-- | test/lisp/use-package/use-package-tests.el | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index 52d7abd4cbb..53bc3ed2a42 100644 --- a/lisp/use-package/use-package-core.el +++ b/lisp/use-package/use-package-core.el @@ -1501,7 +1501,7 @@ no keyword implies `:all'." (defun use-package-normalize/:custom-face (name-symbol _keyword arg) "Normalize use-package custom-face keyword." (let ((error-msg - (format "%s wants a (<symbol> <face-spec>) or list of these" + (format "%s wants a (<symbol> <face-spec> [spec-type]) or list of these" name-symbol))) (unless (listp arg) (use-package-error error-msg)) @@ -1512,7 +1512,7 @@ no keyword implies `:all'." (spec (nth 1 def))) (when (or (not face) (not spec) - (> (length def) 2)) + (> (length def) 3)) (use-package-error error-msg)))))) (defun use-package-handler/:custom-face (name _keyword args rest state) diff --git a/test/lisp/use-package/use-package-tests.el b/test/lisp/use-package/use-package-tests.el index 7d98ca99e4a..185f7691ba9 100644 --- a/test/lisp/use-package/use-package-tests.el +++ b/test/lisp/use-package/use-package-tests.el @@ -1172,6 +1172,13 @@ (backquote (example-2-face ((t (:foreground "LightGreen")))))) (require 'example nil nil)))) +(ert-deftest use-package-test/:custom-face-3 () + (match-expansion + (use-package foo :custom-face (foo ((t (:background "#e4edfc"))) face-defspec-spec)) + `(progn + (apply #'face-spec-set (backquote (foo ((t (:background "#e4edfc"))) face-defspec-spec))) + (require 'foo nil nil)))) + (ert-deftest use-package-test/:init-1 () (match-expansion (use-package foo :init (init)) |