all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mauro Aranda <maurooaranda@gmail.com>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: Eli Zaretskii <eliz@gnu.org>, wyuenho@gmail.com, 63891@debbugs.gnu.org
Subject: bug#63891: 29.0.91; customize-save-variable should not save all variables if a custom file exists
Date: Sat, 28 Oct 2023 06:58:02 -0300	[thread overview]
Message-ID: <0ec5d535-c4e5-401f-8db7-fc4eb54f8517@gmail.com> (raw)
In-Reply-To: <874jicgu5w.fsf@gmx.de>

Hi Michael,

I looked at this more deeply, and I think I still don't understand
what's being asked of Custom in this use case.

First, let me just say that I'm aware of some problems with the
custom-save-all approach to modify the custom-file.  It was reported in
Bug#14150, but, while a different approach to fix Bug#14150 could also
solve this bug, I'm still not sure if the use case in files-x.el is a
supported one.

Both functions, connection-local-set-profile-variables and
connection-local-set-profiles modify 2 defcustoms, and want to tell
Custom that a change has happened.  The usual way to do that is to call
customize-set-variable, because the assumption is that the user used
some command provided by a package to modify the option.  And the
setting lasts for the session, of course.  But the surprise in Bug#62106
was that the users weren't requesting these changes in the options.  It
was done without a choice.

So, the code was changed to use custom-set-variables, which is used in
the custom-file and which means all the settings here should persist
from session to session.  So, in addition to modifying the user option
without a choice, the code then said that these modifications should be
saved.  That's even worse, which should show that custom-set-variables
is just the wrong tool here.  Of course, there's the workaround of
resetting saved-value to nil if possible.  But that just means that if
the user has a saved setting, he/she could possibly end up with all
settings added by a package too.  Of course, if Custom had other
approach for saving the settings, that would not happen, but it wouldn't
happen if the code weren't lying to Custom either.  And please note that
a similar workaround could be added if the code used
customize-set-variable still.

But here is my first question, if packages are going to be changing this
2 options without asking the user about it, why do the packages need to
lie to Custom saying that the user asked for that? Why don't just setq,
add-to-list or modify it some other way? At least that way Custom would
know the truth, the setting was changed outside of Customize.

That's why I don't understand what is the expectation about Custom here
(apart from being less naive when saving the custom-file).  The code is
modifying a user option and tells Custom that it was upon the user
request, when in fact it hasn't.

Finally, have you considered the approach of having the user option plus
another variable which packages should modify when desired? Then the
code could merge the user settings with the package settings.





  parent reply	other threads:[~2023-10-28  9:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <ae449be5-9a4c-4e7e-b624-deae8a27fbbb@gmail.com>
2023-10-27 10:57 ` bug#63891: 29.0.91; customize-save-variable should not save all variables if a custom file exists Mauro Aranda
2023-10-27 11:51   ` Michael Albinus
2023-10-27 15:44     ` Mauro Aranda
2023-10-28  9:58     ` Mauro Aranda [this message]
2023-10-28 18:22       ` Drew Adams
2023-10-28 22:32         ` Mauro Aranda
2023-10-29  2:20           ` Drew Adams
2023-10-29 10:33             ` Mauro Aranda
2023-10-29 11:07               ` Michael Albinus
2023-10-29 11:50                 ` Mauro Aranda
2023-06-04 12:36 Jimmy Yuen Ho Wong
2023-06-04 12:56 ` Eli Zaretskii
2023-06-04 13:02   ` Jimmy Wong
2023-06-04 13:23     ` Eli Zaretskii
2023-06-04 14:00       ` Jimmy Wong
2023-06-04 14:26         ` Eli Zaretskii
2023-06-04 16:49           ` Jimmy Wong
2023-06-06 12:01           ` Michael Albinus
2023-06-06 12:20             ` Eli Zaretskii
2023-06-06 12:36               ` Michael Albinus

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=0ec5d535-c4e5-401f-8db7-fc4eb54f8517@gmail.com \
    --to=maurooaranda@gmail.com \
    --cc=63891@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=wyuenho@gmail.com \
    /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.