GNU bug report logs - #38812
28.0.50; Custom: Problem with reverting some session's customizations

Previous Next

Package: emacs;

Reported by: Mauro Aranda <maurooaranda <at> gmail.com>

Date: Mon, 30 Dec 2019 14:12:02 UTC

Severity: normal

Tags: patch

Found in version 28.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 38812 <at> debbugs.gnu.org
Subject: Re: bug#38812: 28.0.50;
 Custom: Problem with reverting some session's customizations
Date: Tue, 31 Dec 2019 14:21:09 -0300
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

>>  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)))))
>
> This will look strange without some comment explaining why we do this.

True.  I can add that comment.

> And I have a question is: isn't it better not to use setcar in
> custom-push-theme instead?

I thought of doing that, and use setf with alist-get to make the change
instead.  But I think we'll be better off if we avoid sharing the cons
cell inadvertedly, since that is prone to have bugs like this one.

Alternatively, we could create the list in custom-theme-recalc-variable,
to accomplish the same thing without changing the return value of
custom-variable-theme-value.  In that case, I think it would be
convenient to change the doc string of custom-variable-theme-value, to
say it returns some cdr.

To me, either the patch I posted (with an additional explanatory
comment, of course) or the latter option sound better, but I won't argue
too much if you think otherwise.

Best regards,
Mauro.
[Message part 2 (text/html, inline)]

This bug report was last modified 5 years and 198 days ago.

Previous Next


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