emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/consult 2c784a9: consult-theme: Restore to saved theme


From: ELPA Syncer
Subject: [elpa] externals/consult 2c784a9: consult-theme: Restore to saved theme if candidate is unknown
Date: Sat, 24 Jul 2021 03:57:07 -0400 (EDT)

branch: externals/consult
commit 2c784a9f64af1035e92b8545e976c2895580d2d6
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    consult-theme: Restore to saved theme if candidate is unknown
    
    Before this change the default theme was selected.
---
 consult.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/consult.el b/consult.el
index ae19b85..c346c83 100644
--- a/consult.el
+++ b/consult.el
@@ -3496,11 +3496,14 @@ The command supports previewing the currently selected 
theme."
        :category 'theme
        :history 'consult--theme-history
        :lookup (lambda (_input _cands x)
-                 (and x (not (equal x "default")) (intern-soft x)))
+                 (unless (equal x "default")
+                   (or (when-let (cand (and x (intern-soft x)))
+                         (car (memq cand avail-themes)))
+                       saved-theme)))
        :state (lambda (cand restore)
-                (cond
-                 ((and restore (not cand)) (consult-theme saved-theme))
-                 ((memq cand avail-themes) (consult-theme cand))))
+                (consult-theme (if (and restore (not cand))
+                                   saved-theme
+                                 cand)))
        :default (symbol-name (or saved-theme 'default))))))
   (unless (eq theme (car custom-enabled-themes))
     (mapc #'disable-theme custom-enabled-themes)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]