Commit 7a066fdd75cf

Vincent Demeester <vincent+git@demeester.fr>
2014-08-06 08:24:43
Install org from ELPA once, and only when the shipped one is < 8
1 parent 5c9d11a
.emacs.d/lisp/setup-package.el~
@@ -1,2 +0,0 @@
-(require 'package)
-(require 'dash)
.emacs.d/lisp/vde-functions.el
@@ -0,0 +1,28 @@
+(defun unload-org-mode ()
+  (interactive)
+  (and (featurep 'org-agenda)(unload-feature 'org-agenda t ))
+  (and (featurep 'org-bbdb)(unload-feature 'org-bbdb t ))
+  (and (featurep 'org-bibtex)(unload-feature 'org-bibtex t ))
+  (and (featurep 'org-compat)(unload-feature 'org-compat t ))
+  (and (featurep 'org-exp)(unload-feature 'org-exp t ))
+  (and (featurep 'org-exp-blocks)(unload-feature 'org-exp-blocks t ))
+  (and (featurep 'org-faces)(unload-feature 'org-faces t ))
+  (and (featurep 'org-footnote)(unload-feature 'org-footnote t ))
+  (and (featurep 'org-gnus)(unload-feature 'org-gnus t ))
+  (and (featurep 'org-html)(unload-feature 'org-html t ))
+  (and (featurep 'org-info)(unload-feature 'org-info t ))
+  (and (featurep 'org-infojs)(unload-feature 'org-infojs t ))
+  (and (featurep 'org-irc)(unload-feature 'org-irc t ))
+  (and (featurep 'org-jsinfo)(unload-feature 'org-jsinfo t ))
+  (and (featurep 'org-list)(unload-feature 'org-list t ))
+  (and (featurep 'org-macs)(unload-feature 'org-macs t ))
+  (and (featurep 'org-mew)(unload-feature 'org-mew t ))
+  (and (featurep 'org-mhe)(unload-feature 'org-mhe t ))
+  (and (featurep 'org-rmail)(unload-feature 'org-rmail t ))
+  (and (featurep 'org-src)(unload-feature 'org-src t ))
+  (and (featurep 'org-vm)(unload-feature 'org-vm t))
+  (and (featurep 'org-w3m)(unload-feature 'org-w3m t))
+  (and (featurep 'org-wl)(unload-feature 'org-wl t ))
+  (and (featurep 'org)(unload-feature 'org t)))
+
+(provide 'vde-functions)
.emacs.d/init.el
@@ -14,6 +14,7 @@
 ;; Add custom lisp files to the load-path
 (add-to-list 'load-path "~/.emacs.d/lisp")
 
+(require 'vde-functions)
 ;; initialize all ELPA packages
 (require 'setup-package)
 
@@ -23,14 +24,15 @@
   (message "Loaded packages in %.3fs" elapsed))
 
 ;; Make sure we have a decent and recent org-mode version
-(when (not (package-installed-p 'org))
-  do (package-install 'org))
-;;(when (not (package-installed-p 'org-plus-contrib))
-;;  do (package-install 'org-plus-contrib))
-
 (require 'org)
 (when (string-match "^[1234567]" (org-version))
-  (warn "Org-mode is out of date. We expect org 8 or higher, but instead we have %s" (org-version)))
+  (progn
+    (warn "Org-mode is out of date. We expect org 8 or higher, but instead we have %s" (org-version))
+    (warn "Force the installation from org elpa.")
+    (package-install 'org)
+    (unload-org-mode)
+    (require 'org)
+    ))
 
 ;; keep customize settings in their own file
 (setq custom-file