Subject: bug#19999: 24.4; Selecting Mutiple Custom Themes

From: Mauro Aranda <[email-masked]>
Date: Mon, 6 Jan 2020 11:55:16 -0300

tags 19999 patch
thanks

Daniel E. Doherty <[email-masked]> writes:

> (customize-themes)
> Check "Select more than one theme at a time"
> Check "leuven"
> Check "wombat"
> Click "Save Theme Settings"
>
> Open custom.el
>
> Only one of the themes is enabled.

I'm able to reproduce this on the release branch.

enable-theme, which is called while setting custom-enabled-themes,
destructively modifies custom-enabled-themes, thus affecting what will
be stored in the 'saved-value property of custom-enabled-themes when
saving it with custom-theme-save.

One possible fix is to make the updating of custom-enabled-themes in
enable-theme side-effect free, as the attached patch does.

Best regards,
Mauro.
From b60438f1933a36e5af55745d7cc21990a06c6a62 Mon Sep 17 00:00:00 2001
From: Mauro Aranda <[email-masked]>
Date: Mon, 6 Jan 2020 11:04:29 -0300
Subject: [PATCH] Fix saving multiple themes

* lisp/custom.el (enable-theme): Be side-effect free when modifying
custom-enabled-themes.  (Bug#19999)
---
 lisp/custom.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/custom.el b/lisp/custom.el
index 037f6c5..885c486 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -1381,7 +1381,7 @@ enable-theme
 	    (custom-theme-recalc-variable symbol)))))))
   (unless (eq theme 'user)
     (setq custom-enabled-themes
-	  (cons theme (delq theme custom-enabled-themes)))
+	  (cons theme (remq theme custom-enabled-themes)))
     ;; Give the `user' theme the highest priority.
     (enable-theme 'user)))
 
-- 
2.7.4