unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: Anders Papitto <anderspapitto@gmail.com>
Cc: 20766@debbugs.gnu.org
Subject: bug#20766: 24.5; disable-theme leaves lingering effects
Date: Fri, 6 Nov 2020 09:26:36 -0300	[thread overview]
Message-ID: <CABczVwez6NKOVkKMmVOWbXBGAqvvwmvQARJmf7h0db8Ofy9Bbg@mail.gmail.com> (raw)
In-Reply-To: <CAD1XNaoXi6YZf2LADD+xOODFDvJHCMGF+HT8z58pnW1xtLH=Rw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1587 bytes --]

Anders Papitto <anderspapitto@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.

[-- Attachment #2: Type: text/html, Size: 1950 bytes --]

      reply	other threads:[~2020-11-06 12:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-08  1:09 bug#20766: 24.5; disable-theme leaves lingering effects Anders Papitto
2020-11-06 12:26 ` Mauro Aranda [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABczVwez6NKOVkKMmVOWbXBGAqvvwmvQARJmf7h0db8Ofy9Bbg@mail.gmail.com \
    --to=maurooaranda@gmail.com \
    --cc=20766@debbugs.gnu.org \
    --cc=anderspapitto@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).