1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Improve argument type error in load-theme

* lisp/custom.el (load-theme): Improve error message when passing in a
non-symbol THEME argument.
This commit is contained in:
Stefan Kangas 2025-03-03 18:37:39 +01:00
parent 29a9fd4f4b
commit eeda2a8ab1

View file

@ -1326,6 +1326,8 @@ Return t if THEME was successfully loaded, nil otherwise."
(mapcar #'symbol-name
(custom-available-themes))))
nil nil))
(unless (symbolp theme)
(signal 'wrong-type-argument (list 'symbolp theme)))
(unless (custom-theme-name-valid-p theme)
(error "Invalid theme name `%s'" theme))
;; If THEME is already enabled, re-enable it after loading, even if