Files
.emacs.d/core/siren-packages.el
Jim Myhrberg c791150a06 Add rewritten config, dubbed emacs-siren
I've taken a lot of inspiration from Emacs-Prelude when it came to the
structure of this rewritten config. I didn't want to use Prelude as I
don't agree with all it's defaults, nor do I want to have to deal with
any future changes in Prelude that might break things for me. So instead
I went down the fully custom path, but heavily inspired by Prelude, both
in terms of file/code structure, and also some of it's features.

Compared to my old config setup, it's got most of the same things, but
nearly everything is in a module file now, making it easy to fully
enable/disable certain features.
2015-10-04 08:56:07 +01:00

71 lines
1.7 KiB
EmacsLisp

;;
;; packages
;;
(require 'cl)
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.org/packages/") t)
;; set package-user-dir to be relative to config path
(setq package-user-dir (expand-file-name "elpa" siren-dir))
(package-initialize)
(defvar siren-packages
'(browse-kill-ring
dash
discover-my-major
diff-hl
diminish
easy-kill
epl
gist
git-timemachine
gitconfig-mode
gitignore-mode
; god-mode
grizzl
; operate-on-number
smart-mode-line
; smartrep
undo-tree
)
"A list of default packages to ensure are installed at launch.")
;;
;; Package helpers (borrowed from Emacs Prelude)
;;
(defun siren-packages-installed-p ()
"Check if all packages in `siren-packages' are installed."
(every #'package-installed-p siren-packages))
(defun siren-require-package (package)
"Install PACKAGE unless already installed."
(unless (memq package siren-packages)
(add-to-list 'siren-packages package))
(unless (package-installed-p package)
(package-install package)))
(defun siren-require-packages (packages)
"Ensure PACKAGES are installed.
Missing packages are installed automatically."
(mapc #'siren-require-package packages))
(defun siren-install-packages ()
"Install all packages listed in `siren-packages'."
(unless (siren-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
(siren-require-packages siren-packages)))
;; Install Melpa packages
(siren-install-packages)
(provide 'siren-packages)