-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto-package.el
36 lines (31 loc) · 928 Bytes
/
auto-package.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
(require 'package)
(require 'cl)
(package-initialize)
(add-to-list 'package-archives
'("marmalade" . "https://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(defvar autop-packages
'(anzu
auctex
cmake-mode
expand-region
flycheck
wgrep
yasnippet
zenburn-theme)
"A list of packages to install at launch.")
(defun autop-packages-installed-p ()
(loop for p in autop-packages
when (not (package-installed-p p)) do (return nil)
finally (return t)))
(unless (autop-packages-installed-p)
;; check for new packages (package versions)
(message "%s" "Refreshing package database...")
(package-refresh-contents)
(message "%s" " done.")
;; install the missing packages
(dolist (p autop-packages)
(when (not (package-installed-p p))
(package-install p))))
(provide 'auto-package)