GNU logs - #75684, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#75684: persist-defvar symbol bound before definition, causing data loss
Resent-From: Joseph Turner <joseph@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Mon, 20 Jan 2025 07:50:02 +0000
Resent-Message-ID: <handler.75684.B.17373593623876 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 75684
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 75684 <at> debbugs.gnu.org
Cc: Adam Porter <adam@HIDDEN>
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.17373593623876
          (code B ref -1); Mon, 20 Jan 2025 07:50:02 +0000
Received: (at submit) by debbugs.gnu.org; 20 Jan 2025 07:49:22 +0000
Received: from localhost ([127.0.0.1]:48846 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tZmXB-00010S-OW
	for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 02:49:22 -0500
Received: from lists.gnu.org ([2001:470:142::17]:46280)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <joseph@HIDDEN>)
 id 1tZmX8-00010B-UT
 for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 02:49:19 -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 1tZmX2-0001by-E5
 for bug-gnu-emacs@HIDDEN; Mon, 20 Jan 2025 02:49:12 -0500
Received: from out-189.mta1.migadu.com ([2001:41d0:203:375::bd])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <joseph@HIDDEN>)
 id 1tZmWy-00064N-Kr
 for bug-gnu-emacs@HIDDEN; Mon, 20 Jan 2025 02:49:11 -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=1737359341;
 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;
 bh=P0JDv89JilhmkwTiE5m8eCR2c/zMBAJWUxZtM2zpJDI=;
 b=dmLLoAM3wOKhyQMTk4qxndyyq2h7jd4ejcKYCREIF04GHhWz0K+sw4pSNywr4CFH6WEo5a
 CssuIYhMqoi403EjxK7S3XXH7/ZfvrWS69JZe0qbQrUMhPNUkHmI37rbLyKbhrPaN1a1tQ
 X6ueHBzgT9NP9TPLIZS2jHSmnFtCYug=
From: Joseph Turner <joseph@HIDDEN>
Date: Sun, 19 Jan 2025 23:48:52 -0800
Message-ID: <87a5bmj57f.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Migadu-Flow: FLOW_OUT
Received-SPF: pass client-ip=2001:41d0:203:375::bd;
 envelope-from=joseph@HIDDEN; helo=out-189.mta1.migadu.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
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: -0.1 (/)

--=-=-=
Content-Type: text/plain

Variables defined with persist-defvar which have persisted values are
sometimes bound to their persisted values before the package is loaded.
persist-defvar then incorrectly sets the symbol's persist-default
property to its persisted value, which then causes the persist value to
sometimes be deleted.

The bug in the wild: https://github.com/alphapapa/activities.el/issues/109

I am able to reproduce this issue on Emacs 29.4:

--8<---------------cut here---------------start------------->8---
rm -rf /tmp/test-persist-issue/
mkdir /tmp/test-persist-issue
cat > /tmp/test-persist-issue/init.el <<EOF
(package-initialize)

(unless (package-installed-p 'test-persist-issue)
  (package-vc-install "https://git.sr.ht/~breatheoutbreathein/test-persist-issue"))
EOF

emacs --init-directory=/tmp/test-persist-issue/
--8<---------------cut here---------------end--------------->8---

Wait for Emacs to install test-persist-issue.el and persist.el, then:

--8<---------------cut here---------------start------------->8---
(progn
  (require 'test-persist-issue)
  (setf test-persist-issue 'foo)
  (persist-save 'test-persist-issue)
  (kill-emacs))
--8<---------------cut here---------------end--------------->8---

/tmp/test-persist-issue/persist/test-persist-issue now exists as
expected.  Now run:

--8<---------------cut here---------------start------------->8---
rm -rf /tmp/test-persist-issue/elpa/
emacs --init-directory=/tmp/test-persist-issue/
--8<---------------cut here---------------end--------------->8---

Wait for installation again, then evaluate:

--8<---------------cut here---------------start------------->8---
(progn
  ;; (persist-default 'test-persist-issue)  ;; foo (should be nil)
  (persist-save 'test-persist-issue))
--8<---------------cut here---------------end--------------->8---

The second time Emacs is opened, just before the call to persist-defvar
in activities.el, the test-persist-issue variable is already bound to
the persisted value, which results in the persisted value being
incorrectly set as the default.

Why is the persist variable bound before the persist-defvar form?

This example uses package-vc for the sake of reliable bug reproduction,
but the issue also exists with package.el, as in the original report.

Thank you!

Joseph

P.S. The linked git repo contains two files, both of which appear to be
necessary to reproduce the issue.  For the sake of future bug
reproduction, I have attached both files to this email.


--=-=-=
Content-Type: application/emacs-lisp
Content-Disposition: attachment; filename=test-persist-issue.el
Content-Transfer-Encoding: quoted-printable

;;; test-persist-issue.el -*- lexical-binding: t; -*-

;; Version: 0.1-pre
;; Package-Requires: ((persist "0.6"))

(require 'persist)

(persist-defvar test-persist-issue nil "Docstring.")

(provide 'test-persist-issue)

--=-=-=
Content-Type: application/emacs-lisp
Content-Disposition: attachment; filename=test-persist-issue-other-file.el
Content-Transfer-Encoding: quoted-printable

;;; test-persist-issue-other-file.el        -*- lexical-binding: t; -*-

(require 'test-persist-issue)

test-persist-issue

(provide 'test-persist-issue-other-file)

--=-=-=--




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Joseph Turner <joseph@HIDDEN>
Subject: bug#75684: Acknowledgement (persist-defvar symbol bound before
 definition, causing data loss)
Message-ID: <handler.75684.B.17373593623876.ack <at> debbugs.gnu.org>
References: <87a5bmj57f.fsf@HIDDEN>
X-Gnu-PR-Message: ack 75684
X-Gnu-PR-Package: emacs
Reply-To: 75684 <at> debbugs.gnu.org
Date: Mon, 20 Jan 2025 07:50:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 75684 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
75684: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D75684
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#75684: missing from mailing list archives
References: <87a5bmj57f.fsf@HIDDEN>
In-Reply-To: <87a5bmj57f.fsf@HIDDEN>
Resent-From: Joseph Turner <joseph@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 23 Jan 2025 04:51:01 +0000
Resent-Message-ID: <handler.75684.B.173760781110259 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 75684
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 75684 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.173760781110259
          (code B ref -1); Thu, 23 Jan 2025 04:51:01 +0000
Received: (at submit) by debbugs.gnu.org; 23 Jan 2025 04:50:11 +0000
Received: from localhost ([127.0.0.1]:38576 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tapAR-0002fL-7j
	for submit <at> debbugs.gnu.org; Wed, 22 Jan 2025 23:50:11 -0500
Received: from lists.gnu.org ([2001:470:142::17]:51742)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <joseph@HIDDEN>)
 id 1tapAN-0002ZS-UI
 for submit <at> debbugs.gnu.org; Wed, 22 Jan 2025 23:50:10 -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 1tapAG-0003AX-OE
 for bug-gnu-emacs@HIDDEN; Wed, 22 Jan 2025 23:50:00 -0500
Received: from out-174.mta0.migadu.com ([91.218.175.174])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <joseph@HIDDEN>)
 id 1tapAC-0000f9-SK
 for bug-gnu-emacs@HIDDEN; Wed, 22 Jan 2025 23:50:00 -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=1737607787;
 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=H69EzWgrK4ek4L9P0UdSff6bFhm7UYf2Xfy+TqAvivU=;
 b=JtboJOeZ8gPrdwActqNAWTGnvNKwpuh4oA+sI4uOw0N3Ae22mUHvT028YFZw4EaRfeTZPf
 5amXGiT06xJVxB/pirklhTx9C5Je7tUuINgpjYRTdAjCqPHPbPetyvh1A3e2KFmq+81CLS
 hEi4CbYnwD6jTvg53RDzTe8aHP3CmyQ=
From: Joseph Turner <joseph@HIDDEN>
Date: Wed, 22 Jan 2025 20:49:43 -0800
Message-ID: <877c6mt9qw.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Migadu-Flow: FLOW_OUT
Received-SPF: pass client-ip=91.218.175.174;
 envelope-from=joseph@HIDDEN; helo=out-174.mta0.migadu.com
X-Spam_score_int: -23
X-Spam_score: -2.4
X-Spam_bar: --
X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1,
 DKIM_SIGNED=0.1, RCVD_IN_DNSWL_LOW=-0.7,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 0.9 (/)
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: -0.1 (/)

Three days ago, on 2025-01-19, I submitted bug report #75684.  I received
the acknowledgment email, but I don't see the bug report in the mailing
list archive.  I know there have been some issues with some of the FSF
infrastructure over the past few days, so I wonder if my bug report was
somehow lost (and maybe other bug reports too?).

Thank you!

Joseph




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#75684: missing from mailing list archives
Resent-From: Joseph Turner <joseph@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Thu, 23 Jan 2025 07:43:01 +0000
Resent-Message-ID: <handler.75684.B.173761816611525 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 75684
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 75684 <at> debbugs.gnu.org
Cc: 75684-done <at> debbugs.gnu.org
X-Debbugs-Original-To: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
Received: via spool by submit <at> debbugs.gnu.org id=B.173761816611525
          (code B ref -1); Thu, 23 Jan 2025 07:43:01 +0000
Received: (at submit) by debbugs.gnu.org; 23 Jan 2025 07:42:46 +0000
Received: from localhost ([127.0.0.1]:38966 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tarrR-0002zm-T9
	for submit <at> debbugs.gnu.org; Thu, 23 Jan 2025 02:42:46 -0500
Received: from lists.gnu.org ([2001:470:142::17]:57916)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <joseph@HIDDEN>)
 id 1tarrP-0002zA-7d
 for submit <at> debbugs.gnu.org; Thu, 23 Jan 2025 02:42:44 -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 1tarrH-0006GX-HG
 for bug-gnu-emacs@HIDDEN; Thu, 23 Jan 2025 02:42:35 -0500
Received: from out-189.mta1.migadu.com ([95.215.58.189])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <joseph@HIDDEN>)
 id 1tarrE-0002nl-DQ
 for bug-gnu-emacs@HIDDEN; Thu, 23 Jan 2025 02:42:35 -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=1737618149;
 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=YHckqBH8BTN3mZwP7LNB6MHJ909wZ2ORzmxmtC1ifi0=;
 b=BTt+Z2CB5/HzrQyuy2RDek4bS81J725fJO/kojVZQX+eRtGCxvP8JMV6/GDtjWBbZnk0/N
 jLYHMm5cZ8HI1VheQEJBk1T3EEVjh5K4QardFNrZ0m4QoIFI3HVJWJhmYDO0MktDseGHns
 ryjlad3lLZuOhxmKXkHCvT41N3nFRGw=
From: Joseph Turner <joseph@HIDDEN>
In-Reply-To: <877c6mt9qw.fsf@HIDDEN> (Joseph Turner via's
 message of "Wed, 22 Jan 2025 20:49:43 -0800")
References: <87a5bmj57f.fsf@HIDDEN>
 <877c6mt9qw.fsf@HIDDEN>
Date: Wed, 22 Jan 2025 23:42:25 -0800
Message-ID: <877c6mq8m6.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Migadu-Flow: FLOW_OUT
Received-SPF: pass client-ip=95.215.58.189;
 envelope-from=joseph@HIDDEN; helo=out-189.mta1.migadu.com
X-Spam_score_int: -23
X-Spam_score: -2.4
X-Spam_bar: --
X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1,
 DKIM_SIGNED=0.1, RCVD_IN_DNSWL_LOW=-0.7,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 0.9 (/)
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: -0.1 (/)

Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> writes:

> Three days ago, on 2025-01-19, I submitted bug report #75684.  I received
> the acknowledgment email, but I don't see the bug report in the mailing
> list archive.  I know there have been some issues with some of the FSF
> infrastructure over the past few days, so I wonder if my bug report was
> somehow lost (and maybe other bug reports too?).
>
> Thank you!
>
> Joseph

Hmm...  Now I see this message on the mailing list archives as if it
were bug#75684.

I'll just re-submit my bug report again.

Thanks!

Joseph





Message sent:


MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Joseph Turner <joseph@HIDDEN>
Subject: bug#75684: closed (persist-defvar symbol bound before definition,
 causing data loss)
CC: tracker <at> debbugs.gnu.org
Message-ID: <handler.75684.D75684.173761815811493.ackdone <at> debbugs.gnu.org>
References: <877c6mq8m6.fsf@HIDDEN>
 <87a5bmj57f.fsf@HIDDEN>
X-Gnu-PR-Message: closed 75684
X-Gnu-PR-Package: emacs
Date: Thu, 23 Jan 2025 07:43:02 +0000
Content-Type: multipart/mixed; boundary="----------=_1737618182-11573-0"

This is a multi-part message in MIME format...

------------=_1737618182-11573-0
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=utf-8

Your message dated Wed, 22 Jan 2025 23:42:25 -0800
with message-id <877c6mq8m6.fsf@HIDDEN>
and subject line Re: bug#75684: missing from mailing list archives
has caused the debbugs.gnu.org bug report #75684,
regarding persist-defvar symbol bound before definition, causing data loss
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@HIDDEN)


--=20
75684: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D75684
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems

------------=_1737618182-11573-0
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at submit) by debbugs.gnu.org; 20 Jan 2025 07:49:22 +0000
Received: from localhost ([127.0.0.1]:48846 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tZmXB-00010S-OW
	for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 02:49:22 -0500
Received: from lists.gnu.org ([2001:470:142::17]:46280)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <joseph@HIDDEN>)
 id 1tZmX8-00010B-UT
 for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 02:49:19 -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 1tZmX2-0001by-E5
 for bug-gnu-emacs@HIDDEN; Mon, 20 Jan 2025 02:49:12 -0500
Received: from out-189.mta1.migadu.com ([2001:41d0:203:375::bd])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <joseph@HIDDEN>)
 id 1tZmWy-00064N-Kr
 for bug-gnu-emacs@HIDDEN; Mon, 20 Jan 2025 02:49:11 -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=1737359341;
 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;
 bh=P0JDv89JilhmkwTiE5m8eCR2c/zMBAJWUxZtM2zpJDI=;
 b=dmLLoAM3wOKhyQMTk4qxndyyq2h7jd4ejcKYCREIF04GHhWz0K+sw4pSNywr4CFH6WEo5a
 CssuIYhMqoi403EjxK7S3XXH7/ZfvrWS69JZe0qbQrUMhPNUkHmI37rbLyKbhrPaN1a1tQ
 X6ueHBzgT9NP9TPLIZS2jHSmnFtCYug=
From: Joseph Turner <joseph@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: persist-defvar symbol bound before definition, causing data loss
Date: Sun, 19 Jan 2025 23:48:52 -0800
Message-ID: <87a5bmj57f.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Migadu-Flow: FLOW_OUT
Received-SPF: pass client-ip=2001:41d0:203:375::bd;
 envelope-from=joseph@HIDDEN; helo=out-189.mta1.migadu.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
Cc: Adam Porter <adam@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: -0.1 (/)

--=-=-=
Content-Type: text/plain

Variables defined with persist-defvar which have persisted values are
sometimes bound to their persisted values before the package is loaded.
persist-defvar then incorrectly sets the symbol's persist-default
property to its persisted value, which then causes the persist value to
sometimes be deleted.

The bug in the wild: https://github.com/alphapapa/activities.el/issues/109

I am able to reproduce this issue on Emacs 29.4:

--8<---------------cut here---------------start------------->8---
rm -rf /tmp/test-persist-issue/
mkdir /tmp/test-persist-issue
cat > /tmp/test-persist-issue/init.el <<EOF
(package-initialize)

(unless (package-installed-p 'test-persist-issue)
  (package-vc-install "https://git.sr.ht/~breatheoutbreathein/test-persist-issue"))
EOF

emacs --init-directory=/tmp/test-persist-issue/
--8<---------------cut here---------------end--------------->8---

Wait for Emacs to install test-persist-issue.el and persist.el, then:

--8<---------------cut here---------------start------------->8---
(progn
  (require 'test-persist-issue)
  (setf test-persist-issue 'foo)
  (persist-save 'test-persist-issue)
  (kill-emacs))
--8<---------------cut here---------------end--------------->8---

/tmp/test-persist-issue/persist/test-persist-issue now exists as
expected.  Now run:

--8<---------------cut here---------------start------------->8---
rm -rf /tmp/test-persist-issue/elpa/
emacs --init-directory=/tmp/test-persist-issue/
--8<---------------cut here---------------end--------------->8---

Wait for installation again, then evaluate:

--8<---------------cut here---------------start------------->8---
(progn
  ;; (persist-default 'test-persist-issue)  ;; foo (should be nil)
  (persist-save 'test-persist-issue))
--8<---------------cut here---------------end--------------->8---

The second time Emacs is opened, just before the call to persist-defvar
in activities.el, the test-persist-issue variable is already bound to
the persisted value, which results in the persisted value being
incorrectly set as the default.

Why is the persist variable bound before the persist-defvar form?

This example uses package-vc for the sake of reliable bug reproduction,
but the issue also exists with package.el, as in the original report.

Thank you!

Joseph

P.S. The linked git repo contains two files, both of which appear to be
necessary to reproduce the issue.  For the sake of future bug
reproduction, I have attached both files to this email.


--=-=-=
Content-Type: application/emacs-lisp
Content-Disposition: attachment; filename=test-persist-issue.el
Content-Transfer-Encoding: quoted-printable

;;; test-persist-issue.el -*- lexical-binding: t; -*-

;; Version: 0.1-pre
;; Package-Requires: ((persist "0.6"))

(require 'persist)

(persist-defvar test-persist-issue nil "Docstring.")

(provide 'test-persist-issue)

--=-=-=
Content-Type: application/emacs-lisp
Content-Disposition: attachment; filename=test-persist-issue-other-file.el
Content-Transfer-Encoding: quoted-printable

;;; test-persist-issue-other-file.el        -*- lexical-binding: t; -*-

(require 'test-persist-issue)

test-persist-issue

(provide 'test-persist-issue-other-file)

--=-=-=--



------------=_1737618182-11573-0
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at 75684-done) by debbugs.gnu.org; 23 Jan 2025 07:42:38 +0000
Received: from localhost ([127.0.0.1]:38962 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tarrK-0002zI-IG
	for submit <at> debbugs.gnu.org; Thu, 23 Jan 2025 02:42:38 -0500
Received: from out-186.mta1.migadu.com ([95.215.58.186]:10570)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <joseph@HIDDEN>)
 id 1tarrI-0002yw-7u
 for 75684-done <at> debbugs.gnu.org; Thu, 23 Jan 2025 02:42:37 -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=1737618149;
 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=YHckqBH8BTN3mZwP7LNB6MHJ909wZ2ORzmxmtC1ifi0=;
 b=BTt+Z2CB5/HzrQyuy2RDek4bS81J725fJO/kojVZQX+eRtGCxvP8JMV6/GDtjWBbZnk0/N
 jLYHMm5cZ8HI1VheQEJBk1T3EEVjh5K4QardFNrZ0m4QoIFI3HVJWJhmYDO0MktDseGHns
 ryjlad3lLZuOhxmKXkHCvT41N3nFRGw=
From: Joseph Turner <joseph@HIDDEN>
To: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs@HIDDEN>
Subject: Re: bug#75684: missing from mailing list archives
In-Reply-To: <877c6mt9qw.fsf@HIDDEN> (Joseph Turner via's
 message of "Wed, 22 Jan 2025 20:49:43 -0800")
References: <87a5bmj57f.fsf@HIDDEN>
 <877c6mt9qw.fsf@HIDDEN>
Date: Wed, 22 Jan 2025 23:42:25 -0800
Message-ID: <877c6mq8m6.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Migadu-Flow: FLOW_OUT
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 75684-done
Cc: 75684-done <at> debbugs.gnu.org
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 (-)

Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> writes:

> Three days ago, on 2025-01-19, I submitted bug report #75684.  I received
> the acknowledgment email, but I don't see the bug report in the mailing
> list archive.  I know there have been some issues with some of the FSF
> infrastructure over the past few days, so I wonder if my bug report was
> somehow lost (and maybe other bug reports too?).
>
> Thank you!
>
> Joseph

Hmm...  Now I see this message on the mailing list archives as if it
were bug#75684.

I'll just re-submit my bug report again.

Thanks!

Joseph



------------=_1737618182-11573-0--


Message sent:


MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Joseph Turner <joseph@HIDDEN>
Subject: bug#75684: closed (Re: bug#75684: missing from mailing list archives)
Message-ID: <handler.75684.D75684.173761815811493.notifdone <at> debbugs.gnu.org>
References: <877c6mq8m6.fsf@HIDDEN>
 <87a5bmj57f.fsf@HIDDEN>
X-Gnu-PR-Message: they-closed 75684
X-Gnu-PR-Package: emacs
Reply-To: 75684 <at> debbugs.gnu.org
Date: Thu, 23 Jan 2025 07:43:02 +0000
Content-Type: multipart/mixed; boundary="----------=_1737618182-11573-1"

This is a multi-part message in MIME format...

------------=_1737618182-11573-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="utf-8"

Your bug report

#75684: persist-defvar symbol bound before definition, causing data loss

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 75684 <at> debbugs.gnu.org.

--=20
75684: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D75684
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems

------------=_1737618182-11573-1
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at 75684-done) by debbugs.gnu.org; 23 Jan 2025 07:42:38 +0000
Received: from localhost ([127.0.0.1]:38962 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tarrK-0002zI-IG
	for submit <at> debbugs.gnu.org; Thu, 23 Jan 2025 02:42:38 -0500
Received: from out-186.mta1.migadu.com ([95.215.58.186]:10570)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <joseph@HIDDEN>)
 id 1tarrI-0002yw-7u
 for 75684-done <at> debbugs.gnu.org; Thu, 23 Jan 2025 02:42:37 -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=1737618149;
 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=YHckqBH8BTN3mZwP7LNB6MHJ909wZ2ORzmxmtC1ifi0=;
 b=BTt+Z2CB5/HzrQyuy2RDek4bS81J725fJO/kojVZQX+eRtGCxvP8JMV6/GDtjWBbZnk0/N
 jLYHMm5cZ8HI1VheQEJBk1T3EEVjh5K4QardFNrZ0m4QoIFI3HVJWJhmYDO0MktDseGHns
 ryjlad3lLZuOhxmKXkHCvT41N3nFRGw=
From: Joseph Turner <joseph@HIDDEN>
To: Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of
 text editors" <bug-gnu-emacs@HIDDEN>
Subject: Re: bug#75684: missing from mailing list archives
In-Reply-To: <877c6mt9qw.fsf@HIDDEN> (Joseph Turner via's
 message of "Wed, 22 Jan 2025 20:49:43 -0800")
References: <87a5bmj57f.fsf@HIDDEN>
 <877c6mt9qw.fsf@HIDDEN>
Date: Wed, 22 Jan 2025 23:42:25 -0800
Message-ID: <877c6mq8m6.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Migadu-Flow: FLOW_OUT
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 75684-done
Cc: 75684-done <at> debbugs.gnu.org
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 (-)

Joseph Turner via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> writes:

> Three days ago, on 2025-01-19, I submitted bug report #75684.  I received
> the acknowledgment email, but I don't see the bug report in the mailing
> list archive.  I know there have been some issues with some of the FSF
> infrastructure over the past few days, so I wonder if my bug report was
> somehow lost (and maybe other bug reports too?).
>
> Thank you!
>
> Joseph

Hmm...  Now I see this message on the mailing list archives as if it
were bug#75684.

I'll just re-submit my bug report again.

Thanks!

Joseph



------------=_1737618182-11573-1
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Received: (at submit) by debbugs.gnu.org; 20 Jan 2025 07:49:22 +0000
Received: from localhost ([127.0.0.1]:48846 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tZmXB-00010S-OW
	for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 02:49:22 -0500
Received: from lists.gnu.org ([2001:470:142::17]:46280)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <joseph@HIDDEN>)
 id 1tZmX8-00010B-UT
 for submit <at> debbugs.gnu.org; Mon, 20 Jan 2025 02:49:19 -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 1tZmX2-0001by-E5
 for bug-gnu-emacs@HIDDEN; Mon, 20 Jan 2025 02:49:12 -0500
Received: from out-189.mta1.migadu.com ([2001:41d0:203:375::bd])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <joseph@HIDDEN>)
 id 1tZmWy-00064N-Kr
 for bug-gnu-emacs@HIDDEN; Mon, 20 Jan 2025 02:49:11 -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=1737359341;
 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;
 bh=P0JDv89JilhmkwTiE5m8eCR2c/zMBAJWUxZtM2zpJDI=;
 b=dmLLoAM3wOKhyQMTk4qxndyyq2h7jd4ejcKYCREIF04GHhWz0K+sw4pSNywr4CFH6WEo5a
 CssuIYhMqoi403EjxK7S3XXH7/ZfvrWS69JZe0qbQrUMhPNUkHmI37rbLyKbhrPaN1a1tQ
 X6ueHBzgT9NP9TPLIZS2jHSmnFtCYug=
From: Joseph Turner <joseph@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: persist-defvar symbol bound before definition, causing data loss
Date: Sun, 19 Jan 2025 23:48:52 -0800
Message-ID: <87a5bmj57f.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Migadu-Flow: FLOW_OUT
Received-SPF: pass client-ip=2001:41d0:203:375::bd;
 envelope-from=joseph@HIDDEN; helo=out-189.mta1.migadu.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
Cc: Adam Porter <adam@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: -0.1 (/)

--=-=-=
Content-Type: text/plain

Variables defined with persist-defvar which have persisted values are
sometimes bound to their persisted values before the package is loaded.
persist-defvar then incorrectly sets the symbol's persist-default
property to its persisted value, which then causes the persist value to
sometimes be deleted.

The bug in the wild: https://github.com/alphapapa/activities.el/issues/109

I am able to reproduce this issue on Emacs 29.4:

--8<---------------cut here---------------start------------->8---
rm -rf /tmp/test-persist-issue/
mkdir /tmp/test-persist-issue
cat > /tmp/test-persist-issue/init.el <<EOF
(package-initialize)

(unless (package-installed-p 'test-persist-issue)
  (package-vc-install "https://git.sr.ht/~breatheoutbreathein/test-persist-issue"))
EOF

emacs --init-directory=/tmp/test-persist-issue/
--8<---------------cut here---------------end--------------->8---

Wait for Emacs to install test-persist-issue.el and persist.el, then:

--8<---------------cut here---------------start------------->8---
(progn
  (require 'test-persist-issue)
  (setf test-persist-issue 'foo)
  (persist-save 'test-persist-issue)
  (kill-emacs))
--8<---------------cut here---------------end--------------->8---

/tmp/test-persist-issue/persist/test-persist-issue now exists as
expected.  Now run:

--8<---------------cut here---------------start------------->8---
rm -rf /tmp/test-persist-issue/elpa/
emacs --init-directory=/tmp/test-persist-issue/
--8<---------------cut here---------------end--------------->8---

Wait for installation again, then evaluate:

--8<---------------cut here---------------start------------->8---
(progn
  ;; (persist-default 'test-persist-issue)  ;; foo (should be nil)
  (persist-save 'test-persist-issue))
--8<---------------cut here---------------end--------------->8---

The second time Emacs is opened, just before the call to persist-defvar
in activities.el, the test-persist-issue variable is already bound to
the persisted value, which results in the persisted value being
incorrectly set as the default.

Why is the persist variable bound before the persist-defvar form?

This example uses package-vc for the sake of reliable bug reproduction,
but the issue also exists with package.el, as in the original report.

Thank you!

Joseph

P.S. The linked git repo contains two files, both of which appear to be
necessary to reproduce the issue.  For the sake of future bug
reproduction, I have attached both files to this email.


--=-=-=
Content-Type: application/emacs-lisp
Content-Disposition: attachment; filename=test-persist-issue.el
Content-Transfer-Encoding: quoted-printable

;;; test-persist-issue.el -*- lexical-binding: t; -*-

;; Version: 0.1-pre
;; Package-Requires: ((persist "0.6"))

(require 'persist)

(persist-defvar test-persist-issue nil "Docstring.")

(provide 'test-persist-issue)

--=-=-=
Content-Type: application/emacs-lisp
Content-Disposition: attachment; filename=test-persist-issue-other-file.el
Content-Transfer-Encoding: quoted-printable

;;; test-persist-issue-other-file.el        -*- lexical-binding: t; -*-

(require 'test-persist-issue)

test-persist-issue

(provide 'test-persist-issue-other-file)

--=-=-=--



------------=_1737618182-11573-1--



Last modified: Thu, 23 Jan 2025 07:45:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.