From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jimmy Wong Newsgroups: gmane.emacs.bugs Subject: bug#63891: 29.0.91; customize-save-variable should not save all variables if a custom file exists Date: Sun, 4 Jun 2023 14:02:55 +0100 Message-ID: <28e951a5-7065-4c55-b6d0-88238e8cc5eb@Spark> References: <83legz5qsu.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="647c8b84_2cbcc4c3_436" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31784"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63891@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 04 15:04:31 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 1q5nPK-00083g-Pd for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Jun 2023 15:04:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q5nOu-000355-7F; Sun, 04 Jun 2023 09:04:04 -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 1q5nOs-00034m-Mx for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2023 09:04:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q5nOs-0008Jv-EQ for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2023 09:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q5nOr-0000gA-UN for bug-gnu-emacs@gnu.org; Sun, 04 Jun 2023 09:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jimmy Wong Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Jun 2023 13:04: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.16858837892493 (code B ref 63891); Sun, 04 Jun 2023 13:04:01 +0000 Original-Received: (at 63891) by debbugs.gnu.org; 4 Jun 2023 13:03:09 +0000 Original-Received: from localhost ([127.0.0.1]:45317 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5nO0-0000e8-QX for submit@debbugs.gnu.org; Sun, 04 Jun 2023 09:03:09 -0400 Original-Received: from mail-wm1-f48.google.com ([209.85.128.48]:47227) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q5nNz-0000dn-GC for 63891@debbugs.gnu.org; Sun, 04 Jun 2023 09:03:08 -0400 Original-Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-3f732d37d7cso10962055e9.2 for <63891@debbugs.gnu.org>; Sun, 04 Jun 2023 06:03:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685883782; x=1688475782; h=mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=mqHh0+Cyw7WFDgqGMdftokoOt6xFTq6TAeWGMQj6WB4=; b=SbMfAgXk6OkIU0KDNnx3qJxTndlNDevIkHVme3sNVLDsiJLYCiklrd0FxD1UCmRji+ KcVjgEhYt1xk004VHHviiORCNCsnzislixv0lp2tmruFS33vqDDv0qG0ebTuOqvSTOgQ 7CwCVGWsJdhISCTIkXpSRos+XBjKT86qbhcP2zJ+KpRk1arqk55Ejwir8hu0QhSF13RP seJw64ZGy61Aw9dqN7gQOb0pNvk9v4abndLHU8KuE8Bfj5L9y/OnlB/9jmgAQugtw5CQ mOZT5MKGyGnfNCxnPKatchH0WWNtRRXf3e5TsFtRLTFE/U+VgKICVm+R287AQYIGrDlP oELA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685883782; x=1688475782; h=mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mqHh0+Cyw7WFDgqGMdftokoOt6xFTq6TAeWGMQj6WB4=; b=KCttCcpm4P/2krKq029bw4xOa+uNWO8pdBbkIowfbBg165PchPev9rtf3Vx8fne1eM 8SGKVGfW62czX1t09RfcKt5NjG0LYf9ZZ2WfhC1zFIJZsEqFmoTVbIJxNuMrcE8h1oke 8/0+Tu2s0INMkIMIxoxx1lLbmXaGFF6xPVPZXid5ZpEqBoTqVLCn/lZcMxAX93tFffRf rbwfVnl15oj1e2NL8Os1aGmfLxTP1uTM7K+FqxS0tfiW8ciC+5vtVMSMKe4jO2tjPe10 TIVlz1M5eOzsjijsiywHeMH/IVHLMP2LWjgZBysqeJbD99V32tVT+cy3Uq1SLYoWSu0f 0z7Q== X-Gm-Message-State: AC+VfDyz6wCuP+KfttQxKLsbsF9VjwPG9GSvM2qQcK4ctm+4+MVGMXUn k4JBLv8kMeLOuxONAGRZDvjx+TnNzw8= X-Google-Smtp-Source: ACHHUZ5wDksXv1IYYEr5K5WKddWvYwsiVSgHHy11Qup119IQj0jULCv0MX7G8f/tpreTZjpQG41FVw== X-Received: by 2002:a1c:7713:0:b0:3f6:40d:136a with SMTP id t19-20020a1c7713000000b003f6040d136amr6514219wmi.41.1685883781454; Sun, 04 Jun 2023 06:03:01 -0700 (PDT) Original-Received: from [2a01:4b00:89a0:2400::ffff:ffff] ([2a01:4b00:89a0:2400:6063:8212:189a:b65]) by smtp.gmail.com with ESMTPSA id f3-20020a1c6a03000000b003f7361ca753sm2832865wmc.24.2023.06.04.06.03.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Jun 2023 06:03:00 -0700 (PDT) In-Reply-To: <83legz5qsu.fsf@gnu.org> X-Readdle-Message-ID: 28e951a5-7065-4c55-b6d0-88238e8cc5eb@Spark 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:262949 Archived-At: --647c8b84_2cbcc4c3_436 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Yes sorry, I mean customize-save-variable, custom-save-variable doesn=E2=80= =99t exist. There=E2=80=99s a branch in customize-save-variable that save= s all previously updated variables to the custom file if it exists. I just took a look at cus-edit.el, there appears to be no function that c= an surgically serialize just one variable value to the custom file. =46ix= ing this the right way will probably involve changing all the places that= call custom-save-all and still arguably result in a breaking change. On 4 Jun 2023 at 1:55 PM +0100, Eli Zaretskii , wrote: > > =46rom: Jimmy Yuen Ho Wong > > Date: Sun, 04 Jun 2023 13:36:30 +0100 > > > > > > As a discussion from bug =2363300, it appears this long standing > > undocumented behavior of =60custom-save-variable=60 is coming into co= nflict > > with the introduction of =60connection-local-*=60 variables being use= r > > customizable and the fact that Tramp in Emacs 29 sets them on > > load. Here's a scenario where the combination of these behaviors resu= lts > > in one too many surprises: > > > > 0. (setf custom-file =22=7E/.emacs.d/custom.el=22) > > 1. M-x load-library tramp (or install a package that transitively > > requires tramp, without the user knowning) > > 2. Now =60connection-local-profile-alist=60 and > > =60connection-local-criteria-alist=60 are set by > > =60hack-connection-local-variables-apply=60. > > 3. M-x list-packages > > 4. Installs a new package > > 5. Now in addition to =60package-selected-packages=60 being updated, = 2 > > gigantic variables are also saved. Since these connection-local > > variables are highly machine, application and connection dependent, > > saving them into the custom file will make it very annoying to be sha= red > > across multiple machines. This violates the principle of least > > astonishment. > > I think the connection-local variables should be simple variables, > initialized from corresponding user options. Then Tramp could hack > the variables without fear of clobbering user customizations. > > Michael, can this be done on emacs-29 safely enough=3F > > > Expectation: > > > > =60custom-save-variable=60 should only save the value of one variable= > > regardless of whether a custom file exists. > > How is custom-save-variable involved in the above scenario=3F > > And what is custom-save-variable=3F did you mean customize-save-variabl= e > instead=3F That one does save just one variable, the one you type at > the prompt. --647c8b84_2cbcc4c3_436 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
Yes sorry, I mean customize-save-variable, custom-s= ave-variable doesn=E2=80=99t exist. There=E2=80=99s a branch in customize= -save-variable that saves all previously updated variables to the custom = file if it exists.

I just took a look at cus-edit.el, there appears to be no function that c= an surgically serialize just one variable value to the custom file. =46ix= ing this the right way will probably involve changing all the places that= call custom-save-all and still arguably result in a breaking change.
On 4 Jun 2023 at 1:55 PM +0100, Eli= Zaretskii <eliz=40gnu.org>, wrote:
=46rom: Jimmy Yuen Ho Wong <wyuenho=40gm= ail.com>
Date: Sun, 04 Jun 2023 13:36:30 +0100


As a discussion from bug =2363300, it appears this long standing
undocumented behavior of =60custom-save-variable=60 is coming into confli= ct
with the introduction of =60connection-local-*=60 variables being user customizable and the fact that Tramp in Emacs 29 sets them on
load. Here's a scenario where the combination of these behaviors results<= br /> in one too many surprises:

0. (setf custom-file =22=7E/.emacs.d/custom.el=22)
1. M-x load-library tramp (or install a package that transitively
requires tramp, without the user knowning)
2. Now =60connection-local-profile-alist=60 and
=60connection-local-criteria-alist=60 are set by
=60hack-connection-local-variables-apply=60.
3. M-x list-packages
4. Installs a new package
5. Now in addition to =60package-selected-packages=60 being updated, 2 gigantic variables are also saved. Since these connection-local
variables are highly machine, application and connection dependent,
= saving them into the custom file will make it very annoying to be shared<= br /> across multiple machines. This violates the principle of least
astonishment.

I think the connection-local variables should be simple variables,
initialized from corresponding user options. Then Tramp could hack
the variables without fear of clobbering user customizations.

Michael, can this be done on emacs-29 safely enough=3F

Expectation:

=60custom-save-variable=60 should only save the value of one variable
regardless of whether a custom file exists.

How is custom-save-variable involved in the above scenario=3F

And what is custom-save-variable=3F did you mean customize-save-variable<= br /> instead=3F That one does save just one variable, the one you type at
the prompt.
--647c8b84_2cbcc4c3_436--