pavanky / conf

configuration files
MIT License
5 stars 2 forks source link

cmd to slurp everything from melpa after clone #2

Closed ghost closed 9 years ago

ghost commented 9 years ago

Is there an easy way to install all the referenced melpa packages for emacs after, say, jumping to a new machine and cloning this repo?

pavanky commented 9 years ago
(require 'package)

(setq package-list '(jabber
                     auto-complete
                     ess
                     yasnippet
                     auto-complete-c-headers
                     iedit
                     markdown-mode
                     cmake-mode
                     ))

(add-to-list 'package-archives
             '("melpa" . "http://melpa.milkbox.net/packages/") t)

(package-initialize)

; fetch the list of packages available
(unless package-archive-contents
  (package-refresh-contents))

; install the missing packages
(dolist (package package-list)
  (unless (package-installed-p package)
    (package-install package)))

This part of my emacs config takes care of that. You need to have "package" installed. This is available by default in emacs 24.

ghost commented 9 years ago

So I clone and when emacs starts it is automatically smart enough to slurp all that from melpa?

pavanky commented 9 years ago

Yeppers.

pavanky commented 9 years ago

It takes a while to install all the things in the first run. I have seen some machines fail to install the first time. In such cases, I just do M-x list-packages and restart emacs. It always worked for me after that point.

ghost commented 9 years ago

Wow - frickin awesome. Emacs has come a long ways in the ten years I took a dive into this side of things. I've been reading through the packages on melpa, too - - I think I'm ready to steal your config and get to improving the workflow!

pavanky commented 9 years ago

Disable auto-complete. It can be annoying for many cases.