From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.bugs Subject: bug#32188: custom-theme-set-variables evals custom-set-variables in the init files? Date: Sat, 5 Sep 2020 09:27:27 -0300 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006c2dac05ae901c58" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40350"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 32188@debbugs.gnu.org To: Shuguang Sun Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Sep 05 14:28:18 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kEXIo-000AOj-1C for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Sep 2020 14:28:18 +0200 Original-Received: from localhost ([::1]:47226 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kEXIn-0005h3-3F for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 05 Sep 2020 08:28:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39882) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kEXIY-0005gY-NI for bug-gnu-emacs@gnu.org; Sat, 05 Sep 2020 08:28:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58430) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kEXIY-0007PK-EV for bug-gnu-emacs@gnu.org; Sat, 05 Sep 2020 08:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kEXIY-0003LN-Bh for bug-gnu-emacs@gnu.org; Sat, 05 Sep 2020 08:28:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 Sep 2020 12:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32188 X-GNU-PR-Package: emacs Original-Received: via spool by 32188-submit@debbugs.gnu.org id=B32188.159930886812833 (code B ref 32188); Sat, 05 Sep 2020 12:28:02 +0000 Original-Received: (at 32188) by debbugs.gnu.org; 5 Sep 2020 12:27:48 +0000 Original-Received: from localhost ([127.0.0.1]:41743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kEXIK-0003Kv-0n for submit@debbugs.gnu.org; Sat, 05 Sep 2020 08:27:48 -0400 Original-Received: from mail-wm1-f51.google.com ([209.85.128.51]:39841) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kEXIG-0003Kg-N4 for 32188@debbugs.gnu.org; Sat, 05 Sep 2020 08:27:46 -0400 Original-Received: by mail-wm1-f51.google.com with SMTP id b79so9135304wmb.4 for <32188@debbugs.gnu.org>; Sat, 05 Sep 2020 05:27:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=OGStLjuPF/LqOiTJRp8dJnlITcWlpiEqP+AQsxcUpa8=; b=HoCJ/IS7cqxWh8LI6HevwzD9IEOOS/09IXOwdZX/5sUUN1WYWkxB5SNBENYxPaNxgT IiRvy/Q889xawgqHqpcYIEb3RK2pWooNCkutsW2FCJ0oGSYh4PAci5MSW3VW5WNdI9BW LhR/tIp2venSuCJgBMmjpqQpgNkxvXbP8wZ+fbp0SkIDrP/bdLHjYmUCnmqddwO77LUr 4VEjiRJaBDAczxQV6dM4pn1EPM/WvFvujWDSEVZfiItXIsasnBXq2Or0DhB+LVLFdJhV Nni+aKn08RUU43i0l8uVovi+xKRsD0Dmc1nney3+vlzp95Y3OAoI1MVAWjcCieGs1UHF F/Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=OGStLjuPF/LqOiTJRp8dJnlITcWlpiEqP+AQsxcUpa8=; b=QeIx7ss/3OiMBf6kO00u3ODzIEUDdUaxc+NNfuCKidchf8n1+yagrVRrXd2hT3trWR 2cR+tCM0LIjgflRY+Y+qa8fYOpBMkLNHAvPcNvnCa09VXIMsaFyK+sjmRB3qu9kncFYd d+0oTGcXMV4WzJH0Qo8ScbX6yuR/1foUeNE6RYCsOC1ziNng8arYG4vDCwB0OqndFjiT rG3le3CR0bWZhMXL9bZEI5ymj1aJ1oY5+jmFUds66NvmrC1zkFC2hHauEAdAXIB5juFD zLEFu27vcvvv1JGjs05RS/8J9rQtzwVeqylUvCumKqTnvZFjUanm9qI+UNp2Ed1pzerG M3uQ== X-Gm-Message-State: AOAM5302GviFZ4sEEymjm7NDRfohZDPnJF9x2BUCJoVuZqDVnaG1A+Ky Lh08mxbZrcl3t5OupLg3GNwzhfFBYWmhpQzvZUw= X-Google-Smtp-Source: ABdhPJyoZOxe2dl3tHNXTvhZ6kLsAQVumbVd+tkxg8tcKEjDv8rxGyHVBRrfSRX9xelJALDUeF07Ljsi/es1iQ890gA= X-Received: by 2002:a1c:a9c2:: with SMTP id s185mr12381811wme.100.1599308858927; Sat, 05 Sep 2020 05:27:38 -0700 (PDT) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:187219 Archived-At: --0000000000006c2dac05ae901c58 Content-Type: text/plain; charset="UTF-8" "Shuguang Sun" 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. --0000000000006c2dac05ae901c58 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
"Shuguang Sun" <shuguang79@qq.com> writes:

> Hi,
>
> H= ow 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-var= iables, but it doesn't inlcude
> org-capture-templates, and org-c= apture-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
> cus= tom-set-variables of my dot emacs file
>
> It looks like the lo= ad-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 on= ly
> eval custimize the variables in custom-theme-set-variables?
&= gt;

What happens is that when custom sets the variable with
custo= m-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 ha= ve active.

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

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

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


--0000000000006c2dac05ae901c58--