all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: 38812@debbugs.gnu.org
Subject: bug#38812: 28.0.50; Custom: Problem with reverting some session's customizations
Date: Tue, 31 Dec 2019 11:22:27 -0300	[thread overview]
Message-ID: <CABczVweDUwsFWHPPZ7XVjGHOzePaFp-jtEpfgE4zydALARJi_Q@mail.gmail.com> (raw)
In-Reply-To: <CABczVwdF2thO5zDbrFXXe+WKFJESzyOkfumF2odNKP4vWYx=gw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1229 bytes --]

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.

[-- Attachment #1.2: Type: text/html, Size: 1446 bytes --]

[-- Attachment #2: 0001-Preserve-the-saved-value-property-when-doing-session.patch --]
[-- Type: text/x-patch, Size: 1053 bytes --]

From 9b62de6aada7c41ef23441e02d48b262082bee5c Mon Sep 17 00:00:00 2001
From: Mauro Aranda <maurooaranda@gmail.com>
Date: Mon, 30 Dec 2019 11:37:02 -0300
Subject: [PATCH] Preserve the 'saved-value property when doing session's
 customizations

* lisp/custom.el (custom-variable-theme-value): Return a new list with
the value of variable, so the values of the properties 'theme-value
and 'saved-value are not shared.  (Bug#38812)
---
 lisp/custom.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/custom.el b/lisp/custom.el
index 26bdaae..e9bb0d3 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -1483,8 +1483,8 @@ custom-variable-theme-value
 
 This function returns nil if no custom theme specifies a value for VARIABLE."
   (let ((theme-value (get variable 'theme-value)))
-    (if theme-value
-	(cdr (car theme-value)))))
+    (if theme-value ; ((THEME VALUE))
+	(list (cadar theme-value)))))
 
 (defun custom-theme-recalc-variable (variable)
   "Set VARIABLE according to currently enabled custom themes."
-- 
2.7.4


  reply	other threads:[~2019-12-31 14:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-30 14:11 bug#38812: 28.0.50; Custom: Problem with reverting some session's customizations Mauro Aranda
2019-12-31 14:22 ` Mauro Aranda [this message]
2019-12-31 16:04   ` Eli Zaretskii
2019-12-31 17:21     ` Mauro Aranda
2019-12-31 17:25       ` Eli Zaretskii
2019-12-31 17:38         ` Mauro Aranda
2020-01-01 17:51           ` Eli Zaretskii

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABczVweDUwsFWHPPZ7XVjGHOzePaFp-jtEpfgE4zydALARJi_Q@mail.gmail.com \
    --to=maurooaranda@gmail.com \
    --cc=38812@debbugs.gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.