 
 (electric-pair-mode t)
 
+;; --- packages ----------------------------------------------------------------
+;; http://stackoverflow.com/a/10093312
+
+; list the packages you want
+(setq package-list '(color-theme
+		     color-theme-solarized
+		     zenburn-theme
+		     popup
+		     auto-complete
+		     markdown-mode
+		     csharp-mode
+		     ))
+
 (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
                          ("marmalade" . "http://marmalade-repo.org/packages/")
                          ("melpa" . "http://melpa.milkbox.net/packages/")))
+
+; activate all the packages (in particular autoloads)
+(package-initialize)
+
+; fetch the list of packages available
+(when (not package-archive-contents)
+  (package-refresh-contents))
+
+; install the missing packages
+(dolist (package package-list)
+  (when (not (package-installed-p package))
+    (package-install package)))
 
 ;; --- flyspell ----------------------------------------------------------------
 (let ((langs '("american"

     ;; (require 'color-theme-solarized)
     ;; (color-theme-solarized-dark)
     
     (add-to-list 'custom-theme-load-path "~/.emacs.d/zenburn-emacs/")
     (load-theme 'zenburn)
     )))


 ;; If there is more than one, they won't work right.
 '(custom-safe-themes
   (quote
    ("124e34f6ea0bc8a50d3769b9f251f99947d6b4d9422c6d85dc4bcc9c2e51b39c" default))))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
