/
my-packages.el
77 lines (74 loc) · 2.5 KB
/
my-packages.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
;; Following code adapted from Emacs-Prelude @
;; http://batsov.com/articles/2012/02/19/package-management-in-emacs-the-good-the-bad-and-the-ugly/
(require 'cl-lib)
(defvar my-packages '(auctex
auto-complete
auto-indent-mode
autopair
cider
clang-format
clojure-mode
cmake-mode
coffee-mode
color-theme-modern
color-theme-sanityinc-solarized
company
cpputils-cmake
;cuda-mode
dash
deft
desktop
expand-region
exec-path-from-shell
flycheck
gist
git-gutter
groovy-mode
haml-mode
handlebars-mode
haskell-mode
inf-ruby
jedi
magit
matlab-mode
markdown-mode
multi-term
mustache-mode
paredit
popup
projectile
protobuf-mode
rainbow-mode
rainbow-delimiters
ruby-mode
ruby-tools
sass-mode
scss-mode
solarized-theme
volatile-highlights
which-key
workgroups
yaml-mode
yari
yasnippet
)
"A list of packages to ensure are installed at launch.")
(defun my-packages-installed-p ()
(catch 'not-found
(dolist (p my-packages)
(message "p: %s" p)
(unless (package-installed-p p))
(throw 'not-found nil))
t))
(unless (my-packages-installed-p)
;; check for new packages (package versions)
(message "%s" "Emacs Prelude is now refreshing its package database...")
(package-refresh-contents)
(message "%s" " done.")
;; install the missing packages
(dolist (p my-packages)
(when (not (package-installed-p p))
(message "Installing %s" p)
(package-install p))))
(provide 'my-packages)
;;; my-packages.el ends here