forked from prajwalit/emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
packages.el
62 lines (51 loc) · 1.42 KB
/
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
(require 'package)
(require 'cl)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
(add-to-list 'package-archives
'("melpa-stable" . "https://stable.melpa.org/packages/") t)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/") t)
(add-to-list 'package-pinned-packages
'(cider . "melpa-stable") t)
(package-initialize)
(defvar required-packages
'(;; Tools
exec-path-from-shell
magit
smartparens
undo-tree
auto-complete
ace-jump-mode
yasnippet
smex
git-gutter
rich-minority
smooth-scroll
scratch
idle-highlight-mode
neotree
window-number
ibuffer-vc
;; Programming
web-mode
clojure-mode
cider
markdown-mode
;; Themes
tangotango-theme) "Default packages")
(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 (package versions)
(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))))