unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Eshel Yaron <me@eshelyaron.com>
Cc: Andrey Samsonov <samsonov.box@gmail.com>,
	Eli Zaretskii <eliz@gnu.org>,
	Stefan Kangas <stefankangas@gmail.com>,
	65475@debbugs.gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#65475: 29.1; package-selected-packages variable is not updated when the last package is deleted
Date: Tue, 05 Sep 2023 17:10:04 +0000	[thread overview]
Message-ID: <87h6o8eec3.fsf@posteo.net> (raw)
In-Reply-To: <m1v8cqo0fw.fsf@eshelyaron.com> (Eshel Yaron's message of "Mon, 04 Sep 2023 09:35:31 +0200")

[-- Attachment #1: Type: text/plain, Size: 1227 bytes --]

Eshel Yaron <me@eshelyaron.com> writes:

> Andrey Samsonov <samsonov.box@gmail.com> writes:
>
>> 02.09.2023 22:28, Stefan Kangas пишет:
>>> Pushed to master as commit 610105ee81b. Andrey, could you please
>>> test and report back?
>>
>> Unfortunately, I am not competent enough to understand exactly what
>> steps are required to perform this. I certainly am not able to build
>> emacs from source. But I thought to do the following:
>>
>> 1. Download package.el file from here:
>> https://github.com/emacs-mirror/emacs/blob/610105ee81bbf79f72d4efb46d0caddf8d654cf1/lisp/emacs-lisp/package.el
>>
>> 2. Start 'emacs -Q --init-directory <DIR>', where <DIR> is directory
>> with only zero-sized 'init.el' file
>>
>> 3. Open that downloaded package.el file in emacs buffer and do M-x
>> eval-buffer
>>
>> 4. Do the steps from 2 to 8 in my original bug-report.
>>
>> I got the same buggy result on step 8: C-h v package-selected-packages
>> RET: Its value is (chess)
>>
>
> FWIW, I get the same non-empty `package-selected-packages` with Emacs
> master built from source.  Indeed it looks like this issue isn't fully
> fixed yet.

Even if 610105ee81bbf79f72d4efb46d0caddf8d654cf1 was applied?


[-- Attachment #2: Type: text/plain, Size: 758 bytes --]

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index e1172d69bf0..43842cfea73 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1982,7 +1982,10 @@ package--find-non-dependencies
 
 (defun package--save-selected-packages (&optional value)
   "Set and save `package-selected-packages' to VALUE."
-  (when value
+  (when (or value after-init-time)
+    ;; It is valid to set it to nil, for example when the last package
+    ;; is uninstalled.  But it shouldn't be done at init time, to
+    ;; avoid overwriting configurations that haven't yet been loaded.
     (setq package-selected-packages value))
   (if after-init-time
       (customize-save-variable 'package-selected-packages package-selected-packages)

[-- Attachment #3: Type: text/plain, Size: 718 bytes --]


Can you edebug the function and see if it behaves the way it should
(evaluating the setq expression)?

>> I'm not familiar with emacs internals, so can't say where the problem
>> now: the bug is still here, or my testing strategy is wrong.
>>
>
> I think your test is alright in this case, and that a bug (maybe another
> one) remains.
>
>> P.S. (Offtopic): I'm also novice at maillists, so confused what should
>> I do now in my email client: Reply, Reply to All or Reply to
>> List. Sorry please if I did it wrong.
>
> The key is to keep commenters in the CC so they get your follow up.  How
> to do that varies between mail clients, but it sounds like Reply to All
> would be the best fit.
>
>
> Cheers,
>
> Eshel

  reply	other threads:[~2023-09-05 17:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23 12:02 bug#65475: 29.1; package-selected-packages variable is not updated when the last package is deleted Andrey Samsonov
2023-08-26  7:16 ` Eli Zaretskii
2023-08-26  7:30   ` Philip Kaludercic
2023-08-26 11:57     ` Stefan Kangas
2023-08-26 12:02       ` Philip Kaludercic
2023-08-26 12:07         ` Stefan Kangas
2023-09-02 16:28       ` Stefan Kangas
2023-09-04  3:24         ` Andrey Samsonov
2023-09-04  7:35           ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-05 17:10             ` Philip Kaludercic [this message]
2023-09-05 17:39               ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-05 22:03                 ` Stefan Kangas
2023-09-10 11:57                   ` Philip Kaludercic
2023-09-11  2:42                     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-13 10:01                       ` Philip Kaludercic
2023-09-13 14:35                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-09-13 14:41                         ` Stefan Kangas
2023-09-14 13:09                           ` Philip Kaludercic
2023-09-14 14:27                             ` Stefan Kangas
2023-09-15  7:41                               ` Philip Kaludercic
2023-09-21 16:31                                 ` Philip Kaludercic

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h6o8eec3.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=65475@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=me@eshelyaron.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=samsonov.box@gmail.com \
    --cc=stefankangas@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).