Skip to content

Instantly share code, notes, and snippets.

@xiaohanyu
Created October 18, 2013 05:26
Show Gist options
  • Save xiaohanyu/7036875 to your computer and use it in GitHub Desktop.
Save xiaohanyu/7036875 to your computer and use it in GitHub Desktop.
Quickly test an el-get package for oh-my-emacs(http://github.com/xiaohanyu/oh-my-emacs)
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(unless (require 'el-get nil 'noerror)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.github.com/dimitri/el-get/master/el-get-install.el")
(let (el-get-master-branch
el-get-install-skip-emacswiki-recipes)
(goto-char (point-max))
(eval-print-last-sexp))))
;; enable git shallow clone to save time and bandwidth
(setq el-get-git-shallow-clone t)
(defun ome-install (el-get-package)
"Add EL-GET-PACKAGE to `el-get-sources'.
This package will be installed when `ome-load'. Users can make
his own customization by providing a \"ome-package-name-setup\"
function."
(let ((ome-package-setup-func
(intern
(concat "ome-"
(el-get-as-string el-get-package)
"-setup"))))
(if (fboundp ome-package-setup-func)
(add-to-list 'el-get-sources
`(:name ,el-get-package
:after (progn
(,ome-package-setup-func))))
(add-to-list 'el-get-sources
`(:name ,el-get-package)))))
(defun ome-auto-complete-setup ()
(require 'auto-complete-config)
(dolist (ac-mode '(text-mode org-mode))
(add-to-list 'ac-modes ac-mode))
(dolist (ac-mode-hook '(text-mode-hook org-mode-hook))
(add-hook ac-mode-hook
(lambda ()
(add-to-list 'ac-sources 'ac-source-files-in-current-dir)
(add-to-list 'ac-sources 'ac-source-filename))))
(ac-config-default))
(ome-install 'auto-complete)
(ome-install 'geiser)
(defun ome-ac-geiser-setup ()
(add-hook 'geiser-mode-hook 'ac-geiser-setup)
(add-hook 'geiser-repl-mode-hook 'ac-geiser-setup)
(eval-after-load "auto-complete"
'(add-to-list 'ac-modes 'geiser-repl-mode)))
(ome-install 'ac-geiser)
(el-get 'sync (mapcar 'el-get-source-name el-get-sources))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment