GNU bug report logs - #20766
24.5; disable-theme leaves lingering effects

Previous Next

Package: emacs;

Reported by: Anders Papitto <anderspapitto <at> gmail.com>

Date: Mon, 8 Jun 2015 01:21:02 UTC

Severity: minor

Found in version 24.5

Fixed in version 28.1

Done: Mauro Aranda <maurooaranda <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Anders Papitto <anderspapitto <at> gmail.com>
Cc: 20766 <at> debbugs.gnu.org
Subject: bug#20766: 24.5; disable-theme leaves lingering effects
Date: Fri, 6 Nov 2020 09:26:36 -0300
[Message part 1 (text/plain, inline)]
Anders Papitto <anderspapitto <at> gmail.com> writes:

> When I run these commands from a fresh Emacs instance
>
> M-x load-theme RET solarized-light RET
> M-x disable-theme RET solarized-light RET
> M-x term RET RET
>
> the text background color in term-mode stays what it was set to by the
> solarized-light theme. A very similar invocation does not have this
> behavior:
>
> M-x term RET RET
> C-c k RET yes RET
> M-x load-theme RET solarized-light RET
> M-x disable-theme RET solarized-light RET
> M-x term RET RET
>
> i.e. If term mode gets to run before loading the theme, no bug.
>

This bug is still present.

It looks like solarized still sets the obsoleted variables
term-default-fg-color and term-default-bg-color, but still, the bug is
in custom.el and it's related to Bug#21355.

Here's a recipe:
Save this theme into test-bug20766-theme.el, and arrange to load it.
(deftheme test-bug20766)

(custom-theme-set-variables
 'test-bug20766
 '(test-option 'foo))

(provide-theme 'test-bug20766)

emacs -Q

M-x load-theme RET test-bug20766
test-option is not yet known, so custom stores the theme setting under
the saved-value property of test-option.

M-x disable-theme RET test-bug20766
The saved-value property should be nil, because the theme setting is no
longer relevant.  However, it's still ('foo).

Then eval the following defcustom:
(defcustom test-option 'bar "..."
:type 'symbol
:group 'emacs)

M-: test-option ==> foo, which is wrong.

In the original recipe, that is how term-default-fg-color and
term-default-bg-color get the solarized theme setting after loading
term.
[Message part 2 (text/html, inline)]

This bug report was last modified 132 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.