Skip to content
Browse files
move org-mode to use-package
This is a pain in the neck because emacs has a "built-in" version of
org-mode which is picked up by package, which throws off the :ensure
part of use-package. Go through some amount of heartache to try to
remove it. This will almost certainly break at some point.
  • Loading branch information
glasserc committed Mar 13, 2016
1 parent d99193c commit 3af96f2c780a35d35bdf1b9ac19d80fe2e6ebbf8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
@@ -1,6 +1,3 @@
[submodule "dot/emacs.d/elhome/site-lisp/upstream/org-mode.git"]
path = dot/emacs.d/elhome/site-lisp/upstream/org-mode.git
url = git://
[submodule "dot/emacs.d/elhome/site-lisp/upstream/ethan-wspace.git"]
path = dot/emacs.d/elhome/site-lisp/upstream/ethan-wspace.git
url = git://
Submodule org-mode.git deleted from 4412fe
@@ -3,8 +3,28 @@
'("marmalade" . ""))
(add-to-list 'package-archives
'("melpa" . "") t)
;; I think GNU ELPA has an `org` package, but this one may be more up
;; to date?
(add-to-list 'package-archives
'("org" . "") t)

;; Work around built-in org-mode so we can load from ELPA.
;; First, remove the built-in org directory from the load-path.
;; Thanks to
;; Without this, use-package will try to require org and succeed.
(require 'cl))
(setq load-path (remove-if (lambda (x) (string-match-p "org$" x)) load-path))
;; Second, trick emacs into forgetting about the fact that org is
;; a "built-in" package by removing it from package--builtins.
;; Without this, package will refuse to install org, since it's
;; "already installed".
;; package--builtins is only initialized when a query needs it.
(package-built-in-p 'org) ;; prime package--builtins
(setq package--builtins (assq-delete-all 'org package--builtins))

;; Bootstrap `use-package'
(unless (package-installed-p 'use-package)
@@ -34,6 +54,10 @@

(use-package org
:ensure t
:pin org)

(use-package haml-mode
:ensure t)

0 comments on commit 3af96f2

Please sign in to comment.