2 (defvar el-get-sources)
5 (declare-function el-get-post-install 'el-get)
7 (add-to-list 'load-path "~/.emacs.d/el-get/el-get")
9 ;;; el-get-install.el --- installer for the lazy
11 ;; Copyright (C) 2010 Dimitri Fontaine
13 ;; Author: Dimitri Fontaine <dim@tapoueh.org>
14 ;; URL: http://www.emacswiki.org/emacs/el-get.el
15 ;; Created: 2010-06-17
16 ;; Keywords: emacs package elisp install elpa git git-svn bzr cvs apt-get fink http http-tar
17 ;; Licence: WTFPL, grab your copy here: http://sam.zoy.org/wtfpl/
19 ;; This file is NOT part of GNU Emacs.
21 ;; bootstrap your el-get installation, the goal is then to use el-get to
24 ;; So the idea is that you copy/paste this code into your *scratch* buffer,
25 ;; hit C-j, and you have a working el-get.
28 (file-name-as-directory
29 (or (bound-and-true-p el-get-dir)
30 (concat (file-name-as-directory user-emacs-directory) "el-get")))))
32 (when (file-directory-p el-get-root)
33 (add-to-list 'load-path el-get-root))
35 ;; try to require el-get, failure means we have to install it
36 (unless (require 'el-get nil t)
37 (unless (file-directory-p el-get-root)
38 (make-directory el-get-root t))
40 (let* ((package "el-get")
41 (buf (switch-to-buffer "*el-get bootstrap*"))
42 (pdir (file-name-as-directory (concat el-get-root package)))
43 (git (or (executable-find "git")
44 (error "Unable to find `git'")))
45 (url (or (bound-and-true-p el-get-git-install-url)
46 "http://github.com/dimitri/el-get.git"))
47 (default-directory el-get-root)
48 (process-connection-type nil) ; pipe, no pty (--no-progress)
53 git nil `(,buf t) t "--no-pager" "clone" "-v" url package)))
55 (unless (zerop status)
56 (error "Couldn't clone el-get from the Git repository: %s" url))
58 ;; switch branch if we have to
60 ;; Check if a specific branch is requested
61 ((bound-and-true-p el-get-install-branch))
62 ;; Check if master branch is requested
63 ((boundp 'el-get-master-branch) "master")
64 ;; Read the default branch from the el-get recipe
65 ((plist-get (with-temp-buffer
66 (insert-file-contents-literally
67 (expand-file-name "recipes/el-get.rcp" pdir))
68 (read (current-buffer)))
70 ;; As a last resort, use the master branch
72 (remote-branch (format "origin/%s" branch))
73 (default-directory pdir)
75 (if (string-equal branch "master")
77 (call-process git nil (list buf t) t "checkout" "-t" remote-branch))))
78 (unless (zerop bstatus)
79 (error "Couldn't `git checkout -t %s`" branch)))
81 (add-to-list 'load-path pdir)
83 (let ((el-get-default-process-sync t) ; force sync operations for installer
84 (el-get-verbose t)) ; let's see it all
85 (el-get-post-install "el-get"))
86 (with-current-buffer buf
87 (goto-char (point-max))
88 (insert "\nCongrats, el-get is installed and ready to serve!")))))
91 (declare-function el-get 'el-get)
93 ;; now either el-get is `require'd already, or have been `load'ed by the
97 '(el-get ; el-get is self-hosting
98 load-relative ; load emacs lisp relative to emacs source
99 test-simple ; simple test framework
102 ;; install new packages and init already installed packages
103 (el-get 'sync '(loc-changes load-relative test-simple))