From 2e9802aceb9e2e77dd91f54a7727177038a35aec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20T=C3=A9choueyres?= Date: Thu, 31 Mar 2022 21:16:42 +0200 Subject: [PATCH] Filter modus themes on modus-themes--current-theme When custom-enabled-themes contains many themes, we're only interrested by the first modus-* one. This avoid a crash when modus-themes--palette is called which complains that the first theme returned by modus-themes--current-theme isn't either modus-operandi or modus-vivendi (pcase use). --- modus-themes.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modus-themes.el b/modus-themes.el index 3f0e098..3a9a26e 100644 --- a/modus-themes.el +++ b/modus-themes.el @@ -3191,8 +3191,9 @@ Those are stored in `modus-themes-faces' and (custom-theme-set-variables ',name ,@modus-themes-custom-variables)))) (defun modus-themes--current-theme () - "Return current theme." - (car custom-enabled-themes)) + "Return current modus theme." + (car (seq-filter (lambda (arg) (string-match-p "^modus" (symbol-name arg))) + custom-enabled-themes))) ;; Helper functions that are meant to ease the implementation of the ;; above customization variables. -- 2.35.1