From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.bugs Subject: bug#38812: 28.0.50; Custom: Problem with reverting some session's customizations Date: Tue, 31 Dec 2019 11:22:27 -0300 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="00000000000045f1f4059b00b1ae" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="34127"; mail-complaints-to="usenet@blaine.gmane.org" To: 38812@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 31 15:23:12 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1imIQR-0008my-Ur for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 Dec 2019 15:23:12 +0100 Original-Received: from localhost ([::1]:43232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1imIQQ-0002N4-SE for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 Dec 2019 09:23:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33222) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1imIQK-0002MV-Ce for bug-gnu-emacs@gnu.org; Tue, 31 Dec 2019 09:23:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1imIQI-0001Ji-0Y for bug-gnu-emacs@gnu.org; Tue, 31 Dec 2019 09:23:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56155) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1imIQH-0001Id-Ra for bug-gnu-emacs@gnu.org; Tue, 31 Dec 2019 09:23:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1imIQH-0006e3-MM for bug-gnu-emacs@gnu.org; Tue, 31 Dec 2019 09:23:01 -0500 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: Tue, 31 Dec 2019 14:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38812 X-GNU-PR-Package: emacs Original-Received: via spool by 38812-submit@debbugs.gnu.org id=B38812.157780216825519 (code B ref 38812); Tue, 31 Dec 2019 14:23:01 +0000 Original-Received: (at 38812) by debbugs.gnu.org; 31 Dec 2019 14:22:48 +0000 Original-Received: from localhost ([127.0.0.1]:33893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1imIQ3-0006dV-Ur for submit@debbugs.gnu.org; Tue, 31 Dec 2019 09:22:48 -0500 Original-Received: from mail-lf1-f50.google.com ([209.85.167.50]:46138) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1imIQ2-0006dG-5B for 38812@debbugs.gnu.org; Tue, 31 Dec 2019 09:22:46 -0500 Original-Received: by mail-lf1-f50.google.com with SMTP id f15so27092455lfl.13 for <38812@debbugs.gnu.org>; Tue, 31 Dec 2019 06:22:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=AzAlDC5he0bhGNyXiGFMiw3VuvkclQDy4YQlGWgwLMc=; b=Cd3ppeV5EgpcKPf6Fa6x1+xbOdenqLui+yCmX3db8FE0yJmpw8hJBXiTbNtHa2Qere 7bugeGNBuvRm2D0mvY7SECowJ2fV5AfEqP7TePM/OZjdkZ5FQckDj2p+Sbup6OybgVEE gE2Un/PG2nEUseQSRgOHKrUvGiSaS5ebQ0MKITtL8W5OES2BWb/9oHTLzLEkQ4mQ63F6 eyY72upGYENFJBBk1KiA7+QAoQ7FI/H2iRQFgFY167OirFzfnNFtkhs09EnAHcLfDuO+ Yfgox18wTF5sWfO2FalM8uyAp1ITyUx0oHBwgXzRx/Vqhw9+aQFR2z6KHdbhWsPLLylY DIng== 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; bh=AzAlDC5he0bhGNyXiGFMiw3VuvkclQDy4YQlGWgwLMc=; b=kHi35SrRQ27yGijn19vdNDTI3bw4BsjxJzgavWJBFCgyAmGlgC6FQwn5Q34fS0GNdd LAwFNqxvg80jQHV4vbwg6g8gLssRs+24TTFvnzfTA1BZqqdgidA+CKw542kW6/8Yh7Dk 45WC044terBJwb1yejfRoff6vv8vPWuhkETPIJEDpFla+nE8XV+9MO4OfI7VyDlUuzRv aeEhpmgwMRsJfmJ+Vv1Q23LCOozJYXQBVpoitnSCWsAgk2GKFBEznafL7JtqC1xxtKbv 7Z1Gt/kuo6apEFmObBAlQt5+qic+AjprW9Nj9rlHa9De1BU+TCATrT+6lCS6flz9uJmH yp7A== X-Gm-Message-State: APjAAAX0jViLdocc6EdbDed+br6WPs4x+NzCL5dleuWssP/ue7r4ovwC wHHe5YzSeD2fbcVq/IIU/EWPDddUra4/7GyPIfTdsdXc0vk= X-Google-Smtp-Source: APXvYqwyuZPKnPA1DhhQxmbcx26pBEnHpg2ME/AwT+gCa5eDKmrvPREHJ2R53h32I4gRjX3MAK8d85e3VTF1xkOOFUE= X-Received: by 2002:a05:6512:c7:: with SMTP id c7mr42697040lfp.120.1577802160003; Tue, 31 Dec 2019 06:22:40 -0800 (PST) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:173984 Archived-At: --00000000000045f1f4059b00b1ae Content-Type: multipart/alternative; boundary="00000000000045f1f1059b00b1ac" --00000000000045f1f1059b00b1ac Content-Type: text/plain; charset="UTF-8" tags 38812 patch thanks > This bug affects the customizations that happen before customizing > custom-enabled-themes, that's why in the init file is necessary to have one > customization before and one after, to be able to compare the results. > Since custom maintains the arguments to custom-set-variables in alphabetic > order, all variables that would be sorted before custom-enabled-themes > are affected by this bug. When custom-enabled-themes is customized, its set function enable the themes. When that happens, custom recalculates the value of the variables, according to the enabled themes, with custom-theme-recalc-variable. For variables that already have a theme-value property (i.e., the variables that were customized with custom-set-variables before customizing custom-enabled-themes), custom-theme-recalc-variable ends up putting in the 'saved-value property the same cons cell that is in the 'theme-value property. Customizing in a session changes the 'theme-value property of the customized variable, and the above has the effect of changing the 'saved-value property as well. A possible fix is to make custom-variable-theme-value return a new list. I attach a patch that does that. Best regards, Mauro. --00000000000045f1f1059b00b1ac Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
tags 38812 patch
thanks

> This bug affects the customizations that happen before customizi= ng
> custom-enabled-themes, that's why in the init file is necess= ary to have one
> customization before and one after, to be able to c= ompare the results.
> Since custom maintains the arguments to custom-= set-variables in alphabetic
> order, all variables that would be sort= ed before custom-enabled-themes
> are affected by this bug.
=C2=A0=
When custom-enabled-themes is customized, its set function enable thethemes.=C2=A0 When that happens, custom recalculates the value of the
= variables, according to the enabled themes, with
custom-theme-recalc-var= iable.=C2=A0 For variables that already have a
theme-value property (i.e= ., the variables that were customized with
custom-set-variables before c= ustomizing custom-enabled-themes),
custom-theme-recalc-variable ends up = putting in the 'saved-value
property the same cons cell that is in t= he 'theme-value property.

Customizing in a session changes the &= #39;theme-value property of the
customized variable, and the above has t= he effect of changing the
'saved-value property as well.

A po= ssible fix is to make custom-variable-theme-value return a new list.
<= div>I attach a patch that does that.

Best regards,=
Mauro.
--00000000000045f1f1059b00b1ac-- --00000000000045f1f4059b00b1ae Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Preserve-the-saved-value-property-when-doing-session.patch" Content-Disposition: attachment; filename="0001-Preserve-the-saved-value-property-when-doing-session.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_k4tym90i0 RnJvbSA5YjYyZGU2YWFkYTdjNDFlZjIzNDQxZTAyZDQ4YjI2MjA4MmJlZTVjIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBNYXVybyBBcmFuZGEgPG1hdXJvb2FyYW5kYUBnbWFpbC5jb20+ CkRhdGU6IE1vbiwgMzAgRGVjIDIwMTkgMTE6Mzc6MDIgLTAzMDAKU3ViamVjdDogW1BBVENIXSBQ cmVzZXJ2ZSB0aGUgJ3NhdmVkLXZhbHVlIHByb3BlcnR5IHdoZW4gZG9pbmcgc2Vzc2lvbidzCiBj dXN0b21pemF0aW9ucwoKKiBsaXNwL2N1c3RvbS5lbCAoY3VzdG9tLXZhcmlhYmxlLXRoZW1lLXZh bHVlKTogUmV0dXJuIGEgbmV3IGxpc3Qgd2l0aAp0aGUgdmFsdWUgb2YgdmFyaWFibGUsIHNvIHRo ZSB2YWx1ZXMgb2YgdGhlIHByb3BlcnRpZXMgJ3RoZW1lLXZhbHVlCmFuZCAnc2F2ZWQtdmFsdWUg YXJlIG5vdCBzaGFyZWQuICAoQnVnIzM4ODEyKQotLS0KIGxpc3AvY3VzdG9tLmVsIHwgNCArKy0t CiAxIGZpbGUgY2hhbmdlZCwgMiBpbnNlcnRpb25zKCspLCAyIGRlbGV0aW9ucygtKQoKZGlmZiAt LWdpdCBhL2xpc3AvY3VzdG9tLmVsIGIvbGlzcC9jdX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