From 21b6f0cd68028c1e64c97e1ab7143fed4151c35d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Wed, 5 Mar 2014 12:19:22 +0000 Subject: Emacs: check and use cask, if installed --- emacs/init.el | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'emacs/init.el') diff --git a/emacs/init.el b/emacs/init.el index 72264820..770b5dc8 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -56,24 +56,30 @@ Values: `desktop', `server', `laptop'") "Where the emacs init file really is, passing through symlinks.") ;;;; Package Management -(eval-and-compile - (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/") - ("marmalade" . "http://marmalade-repo.org/packages/") - ("melpa" . "http://melpa.milkbox.net/packages/") - ("org" . "http://orgmode.org/elpa/"))) - (package-initialize)) - -(when (not package-archive-contents) - (package-refresh-contents)) - (add-to-list 'load-path (expand-file-name "elisp/" user-emacs-directory)) -(mapc (lambda (package-name) - (unless (package-installed-p package-name) - (package-install package-name))) - '(bind-key - diminish - use-package)) +(let ((cask-file (expand-file-name "cask.el" user-emacs-directory))) + (if (file-exists-p cask-file) + (progn + (add-to-list 'load-path (file-name-directory (file-truename cask-file))) + (require 'cask) + (cask-initialize)) + (eval-and-compile + (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/") + ("marmalade" . "http://marmalade-repo.org/packages/") + ("melpa" . "http://melpa.milkbox.net/packages/") + ("org" . "http://orgmode.org/elpa/"))) + (package-initialize)) + + (when (not package-archive-contents) + (package-refresh-contents)) + + (mapc (lambda (package-name) + (unless (package-installed-p package-name) + (package-install package-name))) + '(bind-key + diminish + use-package)))) (require 'use-package) -- cgit 1.4.1