unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: Shuguang Sun <shuguang79@qq.com>
Cc: 32188@debbugs.gnu.org
Subject: bug#32188: custom-theme-set-variables evals custom-set-variables in the init files?
Date: Sat, 5 Sep 2020 09:27:27 -0300	[thread overview]
Message-ID: <CABczVwcCVs3o4hXFTn58qM1YsNsZewCuvKSLKp4PS0Ox-mmXEQ@mail.gmail.com> (raw)
In-Reply-To: <tencent_2E63DD99532E4B0898C214984E8BDFEB9C05@qq.com>

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

"Shuguang Sun" <shuguang79@qq.com> writes:

> Hi,
>
> How to repeat it:
> 1. I have org-capture-templates with 2 commands in the
custom-set-variables of my dot
> emacs file
> 2. I use add-to-list adding another 4 commands to org-capture-templates
in other file, so
> that finally I have 6 commands in org-capture-templates for org-capture
> 3. I customized a theme which involves custom-theme-set-variables, but it
doesn't inlcude
> org-capture-templates, and org-capture-templates is not in the theme any
where
> 4. After I load the theme, it leave only the 2 commands for org-capture
with in the
> custom-set-variables of my dot emacs file
>
> It looks like the load-theme with custom-theme-set-variables will eval
> custom-theme-set-variables? Is it a bug of feature? Is there an option to
disable it and only
> eval custimize the variables in custom-theme-set-variables?
>

What happens is that when custom sets the variable with
custom-set-variables, it stores the value in the custom-set-variables
form in a theme called user, which takes precedence over any other theme
you have active.

When later you add to the list new values, custom doesn't get notified
about that, so the value stored in the user theme is the same as before,
the one from the custom-set-variables form.

When you enable a theme, custom will "re-enable" the user theme, so the
settings in the user theme take precedence over the other theme.  While
doing that, it will set the list to the value stored in the user theme,
and that's how it is overwriting your settings.

I would recommend against setting org-capture-templates both in
custom-set-variables and after with add-to-list.  Is there any reason
why you do that? In any case, if you want to keep the configuration
as it is, you can add
(customize-mark-as-set 'org-capture-templates)
*after* adding to the list, and that way you effectively notify custom
of the new value, and it won't override your settings when loading other
theme.

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

  reply	other threads:[~2020-09-05 12:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-17 16:22 bug#32188: custom-theme-set-variables evals custom-set-variables in the init files? Shuguang Sun
2020-09-05 12:27 ` Mauro Aranda [this message]
2021-02-04  9:21   ` Lars Ingebrigtsen

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=CABczVwcCVs3o4hXFTn58qM1YsNsZewCuvKSLKp4PS0Ox-mmXEQ@mail.gmail.com \
    --to=maurooaranda@gmail.com \
    --cc=32188@debbugs.gnu.org \
    --cc=shuguang79@qq.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).