Correct the modus-themes-toggle behaviour to match its doc string

I want to prompt for a theme only if modus-themes-to-toggle is not
right.

Thanks Morten Kjeldgaard for bringing this matter to my attention in
issue 44 in the ef-themes repository (those are built on top of the
modus-themes): <https://github.com/protesilaos/ef-themes/issues/44>.
This commit is contained in:
Protesilaos Stavrou 2026-03-20 08:15:02 +02:00
parent 5e1621d638
commit 83501bcd50
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA

View file

@ -4125,10 +4125,9 @@ Disable other themes per `modus-themes-disable-other-themes'."
(interactive)
(if-let* ((themes (modus-themes-known-p modus-themes-to-toggle))
(one (car themes))
(two (cadr themes))
(current (modus-themes-get-current-theme)))
(modus-themes-load-theme (if (eq current one) two one))
(modus-themes-load-theme (modus-themes-select-prompt "No valid theme to toggle; select other"))))
(two (cadr themes)))
(modus-themes-load-theme (if (eq (modus-themes-get-current-theme) one) two one))
(modus-themes-load-theme (modus-themes-select-prompt "No two valid themes to toggle; select other"))))
;;;;; Rotate through a list of themes