Tuesday, August 17, 2010

Emacs Automatic Package Installer

While following the instructions to install clojure support for Emacs, I stumbled in  an automatic package installer. Installing the package installer is the nicer thing I have done with emacs.

You basically put this snippet in the *scratch* and C-j. I wonder why more packages do not follow this procedure... well, perhaps it's not necessary after I installed the package manager.

(let ((buffer (url-retrieve-synchronously
        "http://tromey.com/elpa/package-install.el")))
  (save-excursion
    (set-buffer buffer)
    (goto-char (point-min))
    (re-search-forward "^$" nil 'move)
    (eval-region (point) (point-max))
    (kill-buffer (current-buffer))))

No comments: