From 0b20ccd186fd63a6b1921a11b439a6c5d779defa Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 2 Mar 2025 03:59:22 +0100 Subject: [PATCH] Improve use-package error message on wrong type * lisp/use-package/use-package-core.el (use-package): Improve error message when passed the wrong type. (Bug#72160) (cherry picked from commit 38782e684bf5f67e2d8f69daeeb17f37cf4b2c3f) --- lisp/use-package/use-package-core.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index c457b531052..18181731231 100644 --- a/lisp/use-package/use-package-core.el +++ b/lisp/use-package/use-package-core.el @@ -1748,6 +1748,15 @@ Usage: :vc Install the package directly from a version control system (using `package-vc.el')." (declare (indent defun)) + (when (stringp name) + (user-error "String where there should be a symbol. \ +Try this instead: `(use-package %s ...)'" + name)) + (when (and (consp name) (eq (car name) 'quote)) + (user-error "Quoted symbol where it should be unquoted. \ +Try this instead: `(use-package %s ...)'" + (symbol-name (cadr name)))) + (cl-check-type name symbol) (unless (memq :disabled args) (macroexp-progn (use-package-concat -- 2.39.5