Last active
August 29, 2015 14:00
-
-
Save blarghmatey/11221828 to your computer and use it in GitHub Desktop.
Emacs Package Synchronization
This file contains hidden or 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
(defun installed-packages () | |
"Return the list of installed packages." | |
(mapcar 'car package-alist)) | |
(defun save-package-list () | |
"Save the list of installed packages to a file." | |
(interactive) | |
(with-temp-file "~/Dropbox/.emacs-packages-installed.el" | |
(insert (format "(defvar my-packages '%s)" 'installed-packages)))) | |
(add-hook 'kill-emacs-hook 'save-package-list) | |
(load-file "~/Dropbox/.emacs-packages-installed.el") | |
(dolist (p my-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