Stefan Kangas <stefankangas@HIDDEN>
to control <at> debbugs.gnu.org
.
Full text available.Received: (at 75188) by debbugs.gnu.org; 31 Dec 2024 22:12:44 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 31 17:12:44 2024 Received: from localhost ([127.0.0.1]:37000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tSkTk-0003bg-CA for submit <at> debbugs.gnu.org; Tue, 31 Dec 2024 17:12:44 -0500 Received: from out-176.mta0.migadu.com ([91.218.175.176]:30788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <joseph@HIDDEN>) id 1tSkTh-0003bT-Nk for 75188 <at> debbugs.gnu.org; Tue, 31 Dec 2024 17:12:42 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1735683125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6qdyhzZhWAcGJs7JXmSDxaDA6O+a30kjBpILMFn7Bl8=; b=BXv8p34mKSQvLiFkLKxKD6NoEcs2umVbfYXQmMhneppuu5hjuMTh9SLI8v4LnH4TqFFUkZ FasqOptzEZtYaJOirXwKUFR5SqSlloSG170roiOLRHo2bulO1agPaXXCev2mqgrBt3W1ej Wsk1DqhyqkMGThm81vX9wcYYjCW5ST8= From: Joseph Turner <joseph@HIDDEN> To: 75188 <at> debbugs.gnu.org Subject: Re: bug#75188: persist.el should recursively copy hash tables In-Reply-To: <87wmfhk0bp.fsf@HIDDEN> (Joseph Turner via's message of "Mon, 30 Dec 2024 01:05:30 -0800") References: <87wmfhk0bp.fsf@HIDDEN> Date: Tue, 31 Dec 2024 14:12:00 -0800 Message-ID: <87y0zv7b9r.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 75188 Cc: Ihor Radchenko <yantar92@HIDDEN>, Daniel Mendler <mail@HIDDEN>, Stefan Monnier <monnier@HIDDEN>, Adam Porter <adam@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>, phillip.lord@HIDDEN X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.7 (-) > Hello! > > This patch demonstrates a bug in persist.el [...] This issue also relates to the bug#63513, in which the suggestion was made to replace persist-copy-tree with (compat-call copy-tree) now that Compat 30 is available: https://yhetil.org/emacs-bugs/80479897-500e-fe60-6586-0a44ccb5993b@HIDDEN/
bug-gnu-emacs@HIDDEN
:bug#75188
; Package emacs
.
Full text available.Received: (at submit) by debbugs.gnu.org; 30 Dec 2024 09:05:59 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 30 04:05:59 2024 Received: from localhost ([127.0.0.1]:57286 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1tSBio-00058Z-Tp for submit <at> debbugs.gnu.org; Mon, 30 Dec 2024 04:05:59 -0500 Received: from lists.gnu.org ([209.51.188.17]:46572) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <joseph@HIDDEN>) id 1tSBim-00058R-L0 for submit <at> debbugs.gnu.org; Mon, 30 Dec 2024 04:05:57 -0500 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 <joseph@HIDDEN>) id 1tSBil-0006HM-6H for bug-gnu-emacs@HIDDEN; Mon, 30 Dec 2024 04:05:55 -0500 Received: from out-170.mta1.migadu.com ([95.215.58.170]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <joseph@HIDDEN>) id 1tSBid-0006ZS-Ho for bug-gnu-emacs@HIDDEN; Mon, 30 Dec 2024 04:05:53 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@HIDDEN and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=breatheoutbreathe.in; s=key1; t=1735549540; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=ibYSrThdKKkAyY/WdeU9vIR/UBxXqIy4KzC2voBYptk=; b=M/wlQR6EHmTL7YT+Oo7r3sMEAdOdjKUU6NsdQ/WxnLVMBq4TMsIv1g12Tj+gmVz+R+IVNF OfhO9fCyHOLnNbF3c8h04y0DmFHLJGs+L6b4R+szvwhZcHrcalIlZoCJDgM03RYdtZx/+Y FGyFgCI86nYi+iP17jJvVxWD9ZvdqHM= From: Joseph Turner <joseph@HIDDEN> To: bug-gnu-emacs@HIDDEN Subject: persist.el should recursively copy hash tables X-Debbugs-Cc: Adam Porter <adam@HIDDEN> Date: Mon, 30 Dec 2024 01:05:30 -0800 Message-ID: <87wmfhk0bp.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=95.215.58.170; envelope-from=joseph@HIDDEN; helo=out-170.mta1.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Hello! This patch demonstrates a bug in persist.el, which may be the cause of https://github.com/alphapapa/activities.el/issues/109 and a similar bug in hyperdrive.el which causes the `persist' variable file to be deleted. We have not yet found a way to reproduce the bug in either activities.el or hyperdrive.el, so this `persist' bug may be unrelated. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Test-that-persist-copy-recursively-copies-hash-table.patch From c28644c957d9fabf883990ff145cec19ed12ff10 Mon Sep 17 00:00:00 2001 From: Joseph Turner <joseph@HIDDEN> Date: Mon, 30 Dec 2024 00:40:33 -0800 Subject: [PATCH] Test that persist-copy recursively copies hash tables --- test/persist-tests.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/persist-tests.el b/test/persist-tests.el index 6bf2ed3708..adf37a5bf0 100644 --- a/test/persist-tests.el +++ b/test/persist-tests.el @@ -151,3 +151,14 @@ (ert-deftest test-persist-reset () (should-not (eq persist--test-reset-variable initial-value)) (should-not (eq initial-value (persist-default 'persist--test-reset-variable)))))) + +(ert-deftest test-persist-copy-hash-table () + "`persist-copy' should copy hash keys and values." + (let* ((hash (make-hash-table)) + (rec (record 'a)) + (_ (puthash 'foo rec hash)) + (copy-hash (persist-copy hash))) + (setf (aref (gethash 'foo copy-hash) 0) 'b) + (should-not (persist-equal hash copy-hash)) + (should-not (eq (gethash 'foo hash) + (gethash 'foo copy-hash))))) -- 2.46.0 --=-=-= Content-Type: text/plain IIUC, the solution requires rewriting `persist-copy-tree' (which is copied from Emacs 30's `copy-tree') so that it handles hash tables. If you all agree, I can do this in `persist.el`. However, would it make sense for `copy-tree' to handle hash tables? Forgive me if this has been discussed and settled before. I did find this thread about comparing hash tables with `equal': https://yhetil.org/emacs-devel/871qvz4kdw.fsf@localhost/ Thank you! Joseph --=-=-=--
Joseph Turner <joseph@HIDDEN>
:adam@HIDDEN, bug-gnu-emacs@HIDDEN
.
Full text available.adam@HIDDEN, bug-gnu-emacs@HIDDEN
:bug#75188
; Package emacs
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.