Function: package--save-selected-packages
package--save-selected-packages is a byte-compiled function defined in
package.el.gz.
Signature
(package--save-selected-packages &optional VALUE)
Documentation
Set package-selected-packages to VALUE.
During initialization, we record VALUE but to not persist it using Customize, to avoid overwriting configurations that haven't yet been loaded. After initisation we update the user option directly.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/package.el.gz
(defun package--save-selected-packages (&optional value)
"Set `package-selected-packages' to VALUE.
During initialization, we record VALUE but to not persist it using
Customize, to avoid overwriting configurations that haven't yet been
loaded. After initisation we update the user option directly."
(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. We fall
;; back to the default value of `package-selected-packages' when
;; this function is invoked by `after-init-hook'.
(setq package-selected-packages value))
(if after-init-time
(package--save-selected-packages-1)
(add-hook 'after-init-hook #'package--save-selected-packages-1)))