Skip to content

Commit

Permalink
use seperate file to load el-get configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
To1ne committed Oct 25, 2011
1 parent 91c2b0c commit 88650f0
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 33 deletions.
40 changes: 40 additions & 0 deletions elisp/temacco-el-get.el
@@ -0,0 +1,40 @@
;; el-get installation directory
(setq el-get-dir
(expand-file-name "el-install/" temacco-root-dir))
;; el-get package init file directory
(setq el-get-user-package-directory
(expand-file-name "el-init/" temacco-root-dir))

;; el-get needs to find git
(when (equal system-type 'darwin)
(setenv "PATH" (concat "/usr/local/bin:" (getenv "PATH")))
(push "/usr/local/bin" exec-path))

;; make sure el-get is found
(add-to-list 'load-path (expand-file-name
"el-get" el-get-dir))

;; automatic install
(unless (require 'el-get nil t)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.github.com/dimitri/el-get/master/el-get-install.el")
(end-of-buffer)
(eval-print-last-sexp)))

(require 'el-get)

(defvar temacco-el-get-custom-packages nil
"List of custom el-get package recipes")

(defvar temacco-el-get-packages nil
"List of el-get packages to install")

(defun temacco-el-get ()
"Run el-get using the temacco-el-get variables"
(setq el-get-sources temacco-el-get-custom-packages)
(el-get 'sync (append temacco-el-get-packages
(mapcar 'el-get-source-name el-get-sources)))
)

(provide 'temacco-el-get)
45 changes: 12 additions & 33 deletions init.el
@@ -1,37 +1,17 @@
; init.el --- Start the generators

;; basic settings
(defvar temacco-root (file-name-directory (or (buffer-file-name) load-file-name))
"Root directory of the temacco configuration")
(setq el-get-dir
(expand-file-name "el-install/" temacco-root))
(setq el-get-user-package-directory
(expand-file-name "el-init/" temacco-root))

;; el-get needs to find git
(when (equal system-type 'darwin)
(setenv "PATH" (concat "/usr/local/bin:" (getenv "PATH")))
(push "/usr/local/bin" exec-path))
(defvar temacco-root-dir (file-name-directory (or (buffer-file-name) load-file-name))
"Root directory of the temacco configuration (probably ~/.emacs.d/)")

(defvar temacco-elisp-dir (expand-file-name "elisp/" temacco-root-dir)
"Directory of the custom temacco elisp files")
(add-to-list 'load-path temacco-elisp-dir)

;; load el-get
(add-to-list 'load-path (expand-file-name
"el-get" el-get-dir))

;; automatic install
(unless (require 'el-get nil t)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.github.com/dimitri/el-get/master/el-get-install.el")
(end-of-buffer)
(eval-print-last-sexp)))

(require 'el-get)

;; custom recipes
(setq el-get-sources
'())
;; default packages
(setq temacco-el-packages
(require 'temacco-el-get)

(setq temacco-el-get-packages
'(;; default recipes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
el-get
Expand Down Expand Up @@ -102,10 +82,9 @@
;;;; help
; mwe-log-commands ; log commands in a designated buffer (FIXME does not log ALL commands e.g. navigation)
))

;; run el-get (async)
(el-get 'sync (append temacco-el-packages
(mapcar 'el-get-source-name el-get-sources)))

;; run el-get
(temacco-el-get)

;; TODO CLEANUP BELOW
;; enable ido mode
Expand Down

0 comments on commit 88650f0

Please sign in to comment.