* bug#32188: custom-theme-set-variables evals custom-set-variables in the init files?
@ 2018-07-17 16:22 Shuguang Sun
2020-09-05 12:27 ` Mauro Aranda
0 siblings, 1 reply; 3+ messages in thread
From: Shuguang Sun @ 2018-07-17 16:22 UTC (permalink / raw)
To: 32188
[-- Attachment #1: Type: text/plain, Size: 918 bytes --]
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
[-- Attachment #2: Type: text/html, Size: 1074 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#32188: custom-theme-set-variables evals custom-set-variables in the init files?
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
2021-02-04 9:21 ` Lars Ingebrigtsen
0 siblings, 1 reply; 3+ messages in thread
From: Mauro Aranda @ 2020-09-05 12:27 UTC (permalink / raw)
To: Shuguang Sun; +Cc: 32188
[-- 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 --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#32188: custom-theme-set-variables evals custom-set-variables in the init files?
2020-09-05 12:27 ` Mauro Aranda
@ 2021-02-04 9:21 ` Lars Ingebrigtsen
0 siblings, 0 replies; 3+ messages in thread
From: Lars Ingebrigtsen @ 2021-02-04 9:21 UTC (permalink / raw)
To: Mauro Aranda; +Cc: Shuguang Sun, 32188
Mauro Aranda <maurooaranda@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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-02-04 9:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2021-02-04 9:21 ` Lars Ingebrigtsen
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).