branch: externals/consult
commit fd8ec29b799640706f76c16c9446a5a73445b88a
Author: Daniel Mendler <m...@daniel-mendler.de>
Commit: Daniel Mendler <m...@daniel-mendler.de>

    consult-theme: Guard against invalid themes (Fix #1217)
---
 consult.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/consult.el b/consult.el
index b39fb4e513..a495880661 100644
--- a/consult.el
+++ b/consult.el
@@ -4629,9 +4629,11 @@ The command supports previewing the currently selected 
theme."
   (unless (eq theme (car custom-enabled-themes))
     (mapc #'disable-theme custom-enabled-themes)
     (when theme
+      (unless (custom-theme-p theme)
+        (load-theme theme 'no-confirm 'no-enable))
       (if (custom-theme-p theme)
           (enable-theme theme)
-        (load-theme theme :no-confirm)))))
+        (consult--minibuffer-message "%s is not a valid theme")))))
 
 ;;;;; Command: consult-buffer
 

Reply via email to