From 2f33fc011b6f514dbd6bcc80aad30c557af92874 Mon Sep 17 00:00:00 2001 From: Mauro Aranda Date: Wed, 26 Aug 2020 10:22:11 -0300 Subject: [PATCH] Do not remove unbound variables or faces when modifying a custom-theme * lisp/cus-theme.el (custom-theme-write-variables custom-theme-write-faces): Remove check for a bound symbol or for a face name, so saving a theme does not remove not yet defined variables or faces. (Bug#24727). --- lisp/cus-theme.el | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lisp/cus-theme.el b/lisp/cus-theme.el index b0decfe7b7..dc463e05f9 100644 --- a/lisp/cus-theme.el +++ b/lisp/cus-theme.el @@ -419,14 +419,13 @@ custom-theme-write-variables (widget-value child) ;; Child is null if the widget is closed (hidden). (car (widget-get widget :shown-value))))) - (when (boundp symbol) - (unless (bolp) - (princ "\n")) - (princ " '(") - (prin1 symbol) - (princ " ") - (prin1 (custom-quote value)) - (princ ")"))))) + (unless (bolp) + (princ "\n")) + (princ " '(") + (prin1 symbol) + (princ " ") + (prin1 (custom-quote value)) + (princ ")")))) (if (bolp) (princ " ")) (princ ")") @@ -454,7 +453,7 @@ custom-theme-write-faces ;; Child is null if the widget is closed (hidden). ((widget-get widget :shown-value)) (t (custom-face-get-current-spec symbol))))) - (when (and (facep symbol) value) + (when value (princ (if (bolp) " '(" "\n '(")) (prin1 symbol) (princ " ") -- 2.28.0