forked from technomancy/emacs-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
starter-kit-elpa.el
62 lines (55 loc) · 2.43 KB
/
starter-kit-elpa.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
;;; starter-kit-elpa.el --- Install a base set of packages automatically.
;;
;; Part of the Emacs Starter Kit
(defvar starter-kit-packages (list 'idle-highlight
'ruby-mode
'inf-ruby
'js2-mode
'css-mode
'nxml
'gist
;; To submit
;;; "magit"
;;; "paredit"
;;; "clojure-mode"
;;; "yaml"
;;; "haml"
;;; "sass"
;;; "cheat"
;;; "html-fontify"
;;; "color-theme"
;;; "color-theme-zenburn"
;;; "color-theme-vivid-chalk"
;; Complicated ones
;;; "nxhtml"
;;; "rinari"
;;; "jabber"
;;; "slime"
;;; "swank-clojure"
)
"Libraries that should be installed by default.")
;; Work around a bug in ELPA
(ignore-errors (load "elpa/inf-ruby-2.0/inf-ruby-autoloads"))
(ignore-errors (load "elpa/lisppaste-1.5/lisppaste-autoloads"))
(defun starter-kit-elpa-install ()
"Install all starter-kit packages that aren't installed."
(interactive)
(dolist (package starter-kit-packages)
(unless (or (member package package-activated-list)
(functionp package))
(message "Installing %s" (symbol-name package))
(package-install package))))
(defun esk-online? ()
"See if we're online.
Windows does not have the network-interface-list function, so we
just have to assume it's online."
(if (and (functionp 'network-interface-list)
(network-interface-list))
(some (lambda (iface) (unless (equal "lo" (car iface))
(member 'up (first (last (network-interface-info
(car iface)))))))
(network-interface-list))
t))
;; On your first run, this should pull in all the base packages.
(when (esk-online?) (ignore-errors (starter-kit-elpa-install)))
(provide 'starter-kit-elpa)