all repos — nixfiles @ ec66ac0081b68df0220ab6f5fc0290b611bf9a6f

System and user configuration, managed by nix and home-manager

Emacs: Ensure cask & pallet are required
Alan Pearce alan@alanpearce.co.uk
Thu, 03 Sep 2015 19:34:36 +0200
commit

ec66ac0081b68df0220ab6f5fc0290b611bf9a6f

parent

bb6744eb3e79fdcd8be16d36d3cd149f6d4db76a

1 files changed, 13 insertions(+), 11 deletions(-)

jump to
M tag-emacs/emacs.d/init.orgtag-emacs/emacs.d/init.org
@@ -41,7 +41,8 @@ ** Cask 
 For most packages, I use [[https://github.com/cask/cask][cask]]
 #+BEGIN_SRC emacs-lisp
-  (add-to-list 'load-path (expand-file-name "~/.cask"))
+  (eval-and-compile
+    (add-to-list 'load-path (expand-file-name "~/.cask")))
   (require 'cask)
   (cask-initialize)
 #+END_SRC
@@ -71,16 +72,17 @@ ** Req-package
 
 #+BEGIN_SRC emacs-lisp
-  (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
-                           ("marmalade" . "http://marmalade-repo.org/packages/")
-                           ("melpa" . "http://melpa.org/packages/")
-                           ("melpa-stable" . "http://stable.melpa.org/packages/")
-                           ("org" . "http://orgmode.org/elpa/")))
-  (package-initialize)
-  (unless (package-installed-p 'req-package)
-    (package-refresh-contents)
-    (package-install 'req-package))
-  (require 'req-package)
+  (eval-and-compile
+    (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
+                             ("marmalade" . "http://marmalade-repo.org/packages/")
+                             ("melpa" . "http://melpa.org/packages/")
+                             ("melpa-stable" . "http://stable.melpa.org/packages/")
+                             ("org" . "http://orgmode.org/elpa/")))
+    (package-initialize)
+    (unless (package-installed-p 'req-package)
+      (package-refresh-contents)
+      (package-install 'req-package))
+    (require 'req-package))
   (setq use-package-verbose t)
 #+END_SRC