From ed8fc556da84df10ebe9dde1a96fbcb7adbee7f9 Mon Sep 17 00:00:00 2001 From: Wieland Hoffmann Date: Wed, 15 Apr 2020 10:19:10 +0200 Subject: [PATCH] Make spacemacs/cycle-spacemacs-theme work with themes with keywords Themes can now contain keywords in addition to just the theme name like dotspacemacs-themes '((name :location (recipe :fetcher github :repo "user/repo")) solarized-light solarized-dark) However, for theme cycling, we first try to detect whether the current theme (spacemacs--cur-theme) is in the list of cycleable themes and go on from there. Since spacemacs--cur-theme is just a name, this fails when spacemacs--cur-theme is the name of a theme that's specified with additional keywords in dotspacemacs-themes. To fix this, check if spacemacs--cur-theme is in the list of theme names. --- core/core-themes-support.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/core-themes-support.el b/core/core-themes-support.el index 317922a2f..103e73b9e 100644 --- a/core/core-themes-support.el +++ b/core/core-themes-support.el @@ -390,7 +390,8 @@ THEME." "Cycle through themes defined in `dotspacemacs-themes'. When BACKWARD is non-nil, or with universal-argument, cycle backwards." (interactive "P") - (let* ((themes (if backward (reverse dotspacemacs-themes) dotspacemacs-themes)) + (let* ((theme-names (mapcar 'spacemacs//get-theme-name dotspacemacs-themes)) + (themes (if backward (reverse theme-names) theme-names)) (next-theme (car (or (cdr (memq spacemacs--cur-theme themes)) ;; if current theme isn't in cycleable themes, start ;; over