bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#65475: 29.1; package-selected-packages variable is not updated when


From: Philip Kaludercic
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

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?

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)
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 via email to

[Prev in Thread] Current Thread [Next in Thread]