Dotfiles repository: Switching from per-package Git submodules to ELPA while maintaining portability

自作多情 提交于 2019-12-06 08:16:56

I tried el-get by kindahero's suggestion, but this didn't work out too well for me.. it didn't load correctly — either by some bug in the code or by my lack of skill in Emacs Lisp (more likely the latter).

I stumbled upon the Emacs Prelude project, and found a very simple snippet of code while browsing through the source:

(require 'package)
(add-to-list 'package-archives
             '("marmalade" . "http://marmalade-repo.org/packages/") t)
(package-initialize)

(when (not package-archive-contents)
  (package-refresh-contents))

(defvar prelude-packages
  '(auctex clojure-mode coffee-mode deft gist haml-mode
                 haskell-mode magit markdown-mode paredit projectile
                 sass-mode scss-mode yaml-mode yari yasnippet)
  "A list of packages to ensure are installed at launch.")

(dolist (p prelude-packages)
  (when (not (package-installed-p p))
    (package-install p)))

I shamelessly stole this for my own purposes, and it has been working great. I deleted almost all of my submodules by switching to the package manager (with the Marmalade repo).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!