unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 38812@debbugs.gnu.org
Subject: bug#38812: 28.0.50; Custom: Problem with reverting some session's customizations
Date: Tue, 31 Dec 2019 14:21:09 -0300	[thread overview]
Message-ID: <CABczVwdTESaNAzO=uox+SxAsY8zX7vmapiu=S+i8Er3D-pq-4w@mail.gmail.com> (raw)
In-Reply-To: <83o8volbvf.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1215 bytes --]

Eli Zaretskii <eliz@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.

[-- Attachment #2: Type: text/html, Size: 1467 bytes --]

  reply	other threads:[~2019-12-31 17:21 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
2019-12-31 16:04   ` Eli Zaretskii
2019-12-31 17:21     ` Mauro Aranda [this message]
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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CABczVwdTESaNAzO=uox+SxAsY8zX7vmapiu=S+i8Er3D-pq-4w@mail.gmail.com' \
    --to=maurooaranda@gmail.com \
    --cc=38812@debbugs.gnu.org \
    --cc=eliz@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 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).