diff options
| author | Stefan Kangas | 2025-03-02 03:59:22 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2025-03-02 04:07:48 +0100 |
| commit | 38782e684bf5f67e2d8f69daeeb17f37cf4b2c3f (patch) | |
| tree | 800f8c075f8a18f1878b6ac5fc2c08b734038462 | |
| parent | be8a7c9c882540dd7267f9046166cb680f10fd9d (diff) | |
| download | emacs-38782e684bf5f67e2d8f69daeeb17f37cf4b2c3f.tar.gz emacs-38782e684bf5f67e2d8f69daeeb17f37cf4b2c3f.zip | |
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)
| -rw-r--r-- | lisp/use-package/use-package-core.el | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lisp/use-package/use-package-core.el b/lisp/use-package/use-package-core.el index 9d03d6d3021..84ff637435a 100644 --- a/lisp/use-package/use-package-core.el +++ b/lisp/use-package/use-package-core.el | |||
| @@ -1893,6 +1893,15 @@ Usage: | |||
| 1893 | :vc Install the package directly from a version control system | 1893 | :vc Install the package directly from a version control system |
| 1894 | (using `package-vc.el')." | 1894 | (using `package-vc.el')." |
| 1895 | (declare (indent defun)) | 1895 | (declare (indent defun)) |
| 1896 | (when (stringp name) | ||
| 1897 | (user-error "String where there should be a symbol. \ | ||
| 1898 | Try this instead: `(use-package %s ...)'" | ||
| 1899 | name)) | ||
| 1900 | (when (and (consp name) (eq (car name) 'quote)) | ||
| 1901 | (user-error "Quoted symbol where it should be unquoted. \ | ||
| 1902 | Try this instead: `(use-package %s ...)'" | ||
| 1903 | (symbol-name (cadr name)))) | ||
| 1904 | (cl-check-type name symbol) | ||
| 1896 | (unless (memq :disabled args) | 1905 | (unless (memq :disabled args) |
| 1897 | (macroexp-progn | 1906 | (macroexp-progn |
| 1898 | (use-package-concat | 1907 | (use-package-concat |