From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.bugs 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 Message-ID: <0ec5d535-c4e5-401f-8db7-fc4eb54f8517@gmail.com> References: <1f269cb9-2cdf-4499-b68d-756d27648673@gmail.com> <874jicgu5w.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24442"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: Eli Zaretskii , wyuenho@gmail.com, 63891@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 28 11:58:57 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qwg5o-0006Gy-Vp for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 28 Oct 2023 11:58:57 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwg5S-00005X-Hq; Sat, 28 Oct 2023 05:58:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qwg5O-0008WU-Cj for bug-gnu-emacs@gnu.org; Sat, 28 Oct 2023 05:58:30 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwg5O-0005xM-4r for bug-gnu-emacs@gnu.org; Sat, 28 Oct 2023 05:58:30 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qwg5t-0003I1-W3 for bug-gnu-emacs@gnu.org; Sat, 28 Oct 2023 05:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Oct 2023 09:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63891 X-GNU-PR-Package: emacs Original-Received: via spool by 63891-submit@debbugs.gnu.org id=B63891.169848712712600 (code B ref 63891); Sat, 28 Oct 2023 09:59:01 +0000 Original-Received: (at 63891) by debbugs.gnu.org; 28 Oct 2023 09:58:47 +0000 Original-Received: from localhost ([127.0.0.1]:37789 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwg5e-0003H9-He for submit@debbugs.gnu.org; Sat, 28 Oct 2023 05:58:46 -0400 Original-Received: from mail-yb1-xb2e.google.com ([2607:f8b0:4864:20::b2e]:60565) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qwg5b-0003Gp-Hn for 63891@debbugs.gnu.org; Sat, 28 Oct 2023 05:58:45 -0400 Original-Received: by mail-yb1-xb2e.google.com with SMTP id 3f1490d57ef6-da077db5145so2024368276.0 for <63891@debbugs.gnu.org>; Sat, 28 Oct 2023 02:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698487086; x=1699091886; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=PxO10TsZh+KRZTdazOXptOAfr1AJ7KsfCDWLT0Z5IYU=; b=fkR1tJLnKtPrvBIKKtIDJSfMvOcNi+EmhTaooCybZZ1WgJXLTRTTjlxt7+Sqxwl4EV y1bwZoLsGAxM+NFiQnTN9/g9nEYIatyFBDgh3dVxqTUfUztXqPb7uMH6xdHQvNg90RU1 cScv96W/VD7hUCcgGqPZB+CQsQyXFTKL6Jw5bHZGr77+lQLzNKmz/B8Zb4aLeklF19T2 zppwx7Be1Gl7MXV4lLfKt+KVol25eidc8ZIhdi+/Lxs5yWe2ac3leNHAUuFEYR/74UA8 T0i4no85/yd0xC6Ht7bx4wK82ktdGYRjJ7BdxPzK5GwAP/wAx8uzO+RSpVA8LzuoxQf1 tnUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698487086; x=1699091886; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PxO10TsZh+KRZTdazOXptOAfr1AJ7KsfCDWLT0Z5IYU=; b=DfNhp1PsTypIPW76Tz78aZ0hYHB8nTfDUKOwmQ4G9c72wnUuLGarSlIs8h1nQVsKWm WopAixMgSgnYUaOKTPXjDHNol0LcNB68mKNIBuKT3N4RSQyOpgVxtEHI7AYbARZFxVfL sH6KJgRfGukTY1XiV6QSCrk1GJU+0pztAEgKYiqIVCuHOxI4YIjjwOIbx95s0Whp98hM KLWwBsf4bGtc/1rJDwkLeRibMInktSJ2pJICqUxfH5IWvUOI+Ptykc2vsJBtN0RsMjrS jAu3uJKt9l5UhcIqEjXriF6PEdml+367+E871aIk9XAPv66GBxSoqoPqfzJGoUH7ikQd 9bJg== X-Gm-Message-State: AOJu0YyD+KWEcBKFw2iE6RiaNZTW0/KVrScXwvZJfP/G92PrabAsmQ48 lUCFz1cJwXMgqJlDBRxewBg= X-Google-Smtp-Source: AGHT+IECunCo5O2iZIxnExXGURArzjLOCX+A4vdYcXz7B6dmDKsGmep3DgLwSejnXsvAOnwW6ceu+A== X-Received: by 2002:a5b:9:0:b0:d9b:76c3:4567 with SMTP id a9-20020a5b0009000000b00d9b76c34567mr5221178ybp.55.1698487085919; Sat, 28 Oct 2023 02:58:05 -0700 (PDT) Original-Received: from [192.168.0.234] ([152.168.142.156]) by smtp.gmail.com with ESMTPSA id j205-20020a2523d6000000b00da05d771097sm1512796ybj.22.2023.10.28.02.58.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 28 Oct 2023 02:58:05 -0700 (PDT) Content-Language: en-US In-Reply-To: <874jicgu5w.fsf@gmx.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:273424 Archived-At: 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.