GNU bug report logs - #32188
custom-theme-set-variables evals custom-set-variables in the init files?

Previous Next

Package: emacs;

Reported by: "Shuguang Sun" <shuguang79 <at> qq.com>

Date: Tue, 17 Jul 2018 16:24:02 UTC

Severity: normal

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

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 32188 in the body.
You can then email your comments to 32188 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#32188; Package emacs. (Tue, 17 Jul 2018 16:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Shuguang Sun" <shuguang79 <at> qq.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 17 Jul 2018 16:24:03 GMT) Full text and rfc822 format available.

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

From: "Shuguang Sun" <shuguang79 <at> qq.com>
To: "bug-gnu-emacs" <bug-gnu-emacs <at> gnu.org>
Subject: custom-theme-set-variables evals custom-set-variables in the init
 files?
Date: Wed, 18 Jul 2018 00:22:45 +0800
[Message part 1 (text/plain, inline)]
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?


GNU Emacs 27.0.50 (build 2, x86_64-w64-mingw32) of 2018-07-11




Best Regards,
Shuguang Sun
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32188; Package emacs. (Sat, 05 Sep 2020 12:28:02 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Shuguang Sun <shuguang79 <at> qq.com>
Cc: 32188 <at> debbugs.gnu.org
Subject: Re: bug#32188: custom-theme-set-variables evals custom-set-variables
 in the init files?
Date: Sat, 5 Sep 2020 09:27:27 -0300
[Message part 1 (text/plain, inline)]
"Shuguang Sun" <shuguang79 <at> 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.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32188; Package emacs. (Thu, 04 Feb 2021 09:22:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: Shuguang Sun <shuguang79 <at> qq.com>, 32188 <at> debbugs.gnu.org
Subject: Re: bug#32188: custom-theme-set-variables evals
 custom-set-variables in the init files?
Date: Thu, 04 Feb 2021 10:21:42 +0100
Mauro Aranda <maurooaranda <at> gmail.com> writes:

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

If I read this correctly, then there isn't anything to fix here?  So I'm
closing this bug report.  If there is something to be worked on here,
please respond to the debbugs address, and we'll reopen.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 32188 <at> debbugs.gnu.org and "Shuguang Sun" <shuguang79 <at> qq.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 04 Feb 2021 09:22: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. (Thu, 04 Mar 2021 12:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 54 days ago.

Previous Next


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