From: Philip Kaludercic <philipk@posteo.net>
To: David Masterson <dsmasterson@gmail.com>
Cc: Rudolf Schlatte <rudi@constantly.at>, help-gnu-emacs@gnu.org
Subject: Re: package-autoremove ?
Date: Sat, 26 Aug 2023 12:03:15 +0000 [thread overview]
Message-ID: <87a5ueovss.fsf@posteo.net> (raw)
In-Reply-To: <LV8P223MB0920DBF25A16CF5D5EE0A18DA2E2A@LV8P223MB0920.NAMP223.PROD.OUTLOOK.COM> (David Masterson's message of "Fri, 25 Aug 2023 18:50:43 -0700")
David Masterson <dsmasterson@gmail.com> writes:
> Philip Kaludercic <philipk@posteo.net> writes:
>
>> The :ensure keyword for use-package should select the packages, since it
>> invokes `package-install' without setting the optional DONT-SELECT
>> argument (use-package-ensure.el):
>>
>> ...
>> (if (assoc package package-archive-contents)
>> (package-install package)
>> (package-refresh-contents)
>> (when (assoc package (bound-and-true-p
>> package-pinned-packages))
>> (package-read-all-archive-contents))
>> (package-install package))
>> ...
>>
>>
>> What might be an issue, is that package-install tries to save the
>> modification of `package-selected-packages' to disk (package.el):
>
> Save it to "custom-file" which might be nil (.emacs). Didn't know about
> custom-file...
>
>> (if after-init-time
>> (customize-save-variable 'package-selected-packages
>> package-selected-packages)
>> (add-hook 'after-init-hook #'package--save-selected-packages))
>>
>> Now if you have customised `custom-file' and/or don't load the contents
>> of the file, then upon restarting Emacs the updated value would be lost
>> and package-autoremove would suggest removing all the packages installed
>> by use-package (but also package-install, for that matter).
>
> What happens if custom-file (.emacs) is already loaded in a buffer? I
> thought, if you customize something (via the GUI?), the custom-file
> (.emacs) would be loaded into a buffer (unless it's already in a buffer)
> and the custom-variables would be updated. When you exit Emacs, the
> file would be saved.
That should be the case. You can experiment with this yourself using
`customize-save-variable'.
--
Philip Kaludercic
next prev parent reply other threads:[~2023-08-26 12:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-22 4:00 package-autoremove ? David Masterson
2023-08-22 12:17 ` Rudolf Schlatte
2023-08-25 4:52 ` David Masterson
2023-08-25 7:38 ` Philip Kaludercic
2023-08-25 8:40 ` Tassilo Horn
2023-08-25 8:54 ` Philip Kaludercic
2023-08-25 8:56 ` Tassilo Horn
2023-08-25 12:58 ` Tassilo Horn
2023-08-26 2:01 ` David Masterson
2023-08-26 1:50 ` David Masterson
2023-08-26 12:03 ` Philip Kaludercic [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-09-03 4:35 David Masterson
2020-09-03 6:38 ` Pankaj Jangid
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=87a5ueovss.fsf@posteo.net \
--to=philipk@posteo.net \
--cc=dsmasterson@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=rudi@constantly.at \
/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.
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).