mirror of
https://github.com/jimeh/.emacs.d.git
synced 2026-02-19 13:46:41 +00:00
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.
71 lines
1.7 KiB
EmacsLisp
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)
|