Subject: 24.5; disable-theme leaves lingering effects

From: Anders Papitto <[email-masked]>
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))