Add my/package-ensure-installed
Does the job of install.el but is available within an Emacs session. install.el simply calls my/package-ensure-installed
This commit is contained in:
parent
ed1c1a3e0a
commit
1dec1f8f4d
|
@ -19,6 +19,15 @@ Configure package archives and initialise.
|
|||
:config
|
||||
(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/"))
|
||||
(package-initialize))
|
||||
|
||||
(defun my/package-ensure-installed ()
|
||||
"Ensure packages in `package-selected-packages' are installed."
|
||||
(interactive)
|
||||
(require 'package)
|
||||
(package-refresh-contents)
|
||||
(package-install-selected-packages t)
|
||||
(package-autoremove)
|
||||
(package-upgrade-all nil))
|
||||
#+end_src
|
||||
** Defaults
|
||||
Set some useful defaults. Some of these should be moved to relevant
|
||||
|
|
|
@ -3,8 +3,6 @@
|
|||
;;; Code:
|
||||
;; Configure packages archives with priority
|
||||
(load-file (locate-user-emacs-file "init.el"))
|
||||
(package-refresh-contents)
|
||||
(package-install-selected-packages t)
|
||||
(package-autoremove)
|
||||
(my/package-ensure-installed)
|
||||
(provide 'install)
|
||||
;;; install.el ends here
|
||||
|
|
Loading…
Reference in a new issue