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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20766 in the body.
You can then email your comments to 20766 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#20766; Package emacs. (Mon, 08 Jun 2015 01:21:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Anders Papitto <anderspapitto <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 08 Jun 2015 01:21:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Anders Papitto <anderspapitto <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.5; disable-theme leaves lingering effects
Date: Sun, 7 Jun 2015 18:09:04 -0700
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.

the 'solarized-light' theme was installed from melpa via M-x
package-list-packages, and is upstream at
https://github.com/bbatsov/solarized-emacs. I'm not certain whether the
behavior is specific to that theme or not.

What I have observed is that there seems to be an interaction with the
variables term-default-fg-color and term-default-bg-color. They start as
:not-bound. Solarized light sets them to some value when loaded, and
resets them to :not-bound when unloaded. However, term mode also sets
them when started (both to 'nil) and seems to never reset them to
:not-bound.

Note: I don't have Emacs configured to send email, so I copied the
following from the bug-submission utility.


In GNU Emacs 24.5.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.27)
 of 2015-05-13 on localhost
Windowing system distributor `The X.Org Foundation', version 11.0.11604000
Configured using:
 `configure --disable-dependency-tracking
 --prefix=/nix/store/wjlxah8xdid8qw12rsf3cjxvqj3zw69p-emacs-24.5
 --with-x-toolkit=gtk2 --with-xft'

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
delete-backward-char: Text is read-only

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util help-fns mail-prsvr mail-utils time-date tooltip electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 71068 7059)
 (symbols 48 17455 0)
 (miscs 40 39 163)
 (strings 32 9117 4368)
 (string-bytes 1 264156)
 (vectors 16 8912)
 (vector-slots 8 383152 18293)
 (floats 8 63 249)
 (intervals 56 166 16)
 (buffers 960 11)
 (heap 1024 12859 662))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20766; Package emacs. (Fri, 06 Nov 2020 12:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 20766 <at> debbugs.gnu.org (full text, mbox):

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Anders Papitto <anderspapitto <at> gmail.com>
Cc: 20766 <at> debbugs.gnu.org
Subject: Re: 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)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20766; Package emacs. (Sat, 08 Mar 2025 09:46:01 GMT) Full text and rfc822 format available.

Message #11 received at 20766 <at> debbugs.gnu.org (full text, mbox):

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: 20766 <at> debbugs.gnu.org
Cc: Anders Papitto <anderspapitto <at> gmail.com>
Subject: Re: bug#20766: 24.5; disable-theme leaves lingering effects
Date: Sat, 8 Mar 2025 06:45:35 -0300
close 20766 28.1
quit


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

> 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.

This is fixed since this commit:

commit 779c615f333a01d11ab930b030d61545fb048f3d
Author: Mauro Aranda <maurooaranda <at> gmail.com>
Date:   Mon May 10 13:33:32 2021 +0200

    Avoid saving session customizations in the custom-file

Closing.





bug marked as fixed in version 28.1, send any further explanations to 20766 <at> debbugs.gnu.org and Anders Papitto <anderspapitto <at> gmail.com> Request was from Mauro Aranda <maurooaranda <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 08 Mar 2025 09:46:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 05 Apr 2025 11:24:23 GMT) Full text and rfc822 format available.

This bug report was last modified 53 days ago.

Previous Next


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