Correctly handle installed packages and custom file

This commit is contained in:
Wojciech Kozlowski 2021-09-24 14:52:53 +02:00
parent 0cdab1766c
commit e56e405cf1
2 changed files with 9 additions and 7 deletions

View File

@ -238,8 +238,10 @@ DESIRED-PKGS unless NO-SET-SELECTED is non-nil"
(emodule/print-log "*** Delete packages ***") (emodule/print-log "*** Delete packages ***")
(emodule/delete-pkgs delete-pkgs))) (emodule/delete-pkgs delete-pkgs)))
;; Update `package-selected-packages'
(unless no-set-selected (unless no-set-selected
(customize-save-variable 'package-selected-packages desired-pkgs))) (setq package-selected-packages desired-pkgs)
(customize-save-variable 'package-selected-packages package-selected-packages)))
;;; Init functions: ;;; Init functions:

12
init.el
View File

@ -89,6 +89,12 @@
(setq-default custom-file (emacs-dir "custom.el")) (setq-default custom-file (emacs-dir "custom.el"))
;; -----------------------------------------------------------------------------------------------
;; Load any custom variables straight away to make sure all custom values carry over.
;; -----------------------------------------------------------------------------------------------
(load custom-file 'noerror)
;; ******************************************************************************************** ;; ;; ******************************************************************************************** ;;
;; ;; ;; ;;
@ -133,12 +139,6 @@
;; ;; ;; ;;
;; ******************************************************************************************** ;; ;; ******************************************************************************************** ;;
;; -----------------------------------------------------------------------------------------------
;; Load any custom variables.
;; -----------------------------------------------------------------------------------------------
(load custom-file 'noerror)
) ;; Reset garbage collection settings. ) ;; Reset garbage collection settings.
(provide 'init) (provide 'init)