bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#24727: 25.1; Editing custom theme removes undefined variables and fa


From: Mauro Aranda
Subject: bug#24727: 25.1; Editing custom theme removes undefined variables and faces
Date: Fri, 4 Sep 2020 10:02:43 -0300

Allen Li <vianchielfaura@gmail.com> writes:

> When using `customize-create-theme' to visit and edit an existing theme,
> undefined variables and faces get removed on save (for example, for a
> package whose autoload hasn't been triggered yet).
>

To test this, I used the following theme:
(deftheme tbb-test
  "A test theme.")

(custom-theme-set-variables
 'tbb-test
 '(column-number-mode t)
 '(foo-undefined 'foo))

(provide-theme 'tbb-test)

And put it under custom-theme-directory, with name tbb-test-theme.el.
Then:
M-x custom-theme-visit-theme RET tbb-test

And clicked Save Theme.

Then I visited tbb-test-theme.el and confirmed that the entry for
foo-undefined wasn't there anymore.

There is a check in custom-theme-write-variables for a bound symbol, and
a check in custom-theme-write-faces for a known face, and I wonder why,
because that should not be a concern for these functions.

Note that still editing a theme with custom-theme-visit-theme is
somewhat buggy, because if you click to show the variable foo-undefined
you end up with a lot of errors, and you can't hide it back.

But at least removing the checks makes it less rude, and undefined
variables or faces stay in the file.

Here's my proposed patch.

Attachment: 0001-Do-not-remove-unbound-variables-or-faces-when-modify.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]