;; elpa files in .emacs.d/var
(setq package--init-file-ensured t)
(if (require 'package nil t)
    (progn
      (add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/") t)
      (setq package-user-dir (locate-user-emacs-file "var/elpa"))
      ;; after you modify this list, call (package-install-selected-packages)
      (setq package-selected-packages
            '(
              actionscript-mode
              browse-kill-ring
              cmake-mode
              groovy-mode
              htmlize
              lua-mode
              magit
              markdown-mode
              protobuf-mode
              smex
              soap-client
              undo-tree
              xml-rpc
              ))
      (package-initialize)
      (unless (fboundp 'global-undo-tree-mode)
        (package-refresh-contents)
        (package-install-selected-packages))))

;; TODO: defadvice for package--save-selected-packages so that it
;; modifies this file instead of custom

(provide 'ew-package)