Created
January 15, 2015 22:51
-
-
Save kozross/e49a5acf0f3fb9fd0dd5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;method to check if all packages are installed | |
(defun packages-installed-p () | |
(loop for p in required-packages | |
when (not (package-installed-p p)) do (return nil) | |
finally (return t))) | |
;;if not all packages are installed, check one by one and install the missing ones | |
(unless (packages-installed-p) | |
;;check for new packages | |
(message "%s" "Emacs is now refreshing its package database...") | |
(package-refresh-contents) | |
(message "%s" "done!") | |
;;install the missing packages | |
(dolist (p required-packages) | |
(when (not (package-installed-p p)) | |
(package-install p)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment