From dd11790959cfe9bfa53c36c791079e9618b58e5d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 5 Mar 2017 13:32:12 -0500 Subject: [PATCH] Fix #36: use ELPA org instead of built-in org --- core/core-packages.el | 14 ++++++++++---- modules/lang/org/config.el | 4 ++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/core/core-packages.el b/core/core-packages.el index 498f9ee10..3bb63131c 100644 --- a/core/core-packages.el +++ b/core/core-packages.el @@ -57,12 +57,17 @@ missing) and shouldn't be deleted.") (defvar doom-init-time nil "The time it took, in seconds, for DOOM Emacs to initialize.") +(defvar doom--site-load-path load-path + "The load path of built in Emacs libraries.") + +(defvar doom--package-load-path nil + "The load path of package libraries installed via ELPA or QUELPA.") + (defvar doom--base-load-path (append (list doom-core-dir doom-modules-dir) - load-path) + doom--site-load-path) "A backup of `load-path' before it was altered by `doom-initialize'. Used as a -base when running `doom/reload', or by `doom!', for calculating how many -packages exist.") +base by `doom!' and for calculating how many packages exist.") (setq load-prefer-newer nil package--init-file-ensured t @@ -123,7 +128,8 @@ to speed up startup." ;; Also, in some edge cases involving package initialization during a ;; non-interactive session, `package-initialize' fails to fill `load-path'. ;; If we want something done right, do it ourselves! - (setq load-path (append load-path (directory-files package-user-dir t "^\\w" t))) + (setq doom--package-load-path (directory-files package-user-dir t "^\\w" t) + load-path (append load-path doom--package-load-path)) ;; Ensure core packages are installed (let ((core-packages (cl-remove-if 'package-installed-p doom-protected-packages))) diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 441a68b58..9a7865b03 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -31,6 +31,10 @@ ;; "A list of attachments for the current buffer. This is so my custom attachment ;; system can keep track of each buffer's attachments.") +;; Ensure ELPA org is loaded instead of the built-in org. +(when-let (path (locate-library "org" nil doom--package-load-path)) + (push (file-name-directory path) load-path)) + (load! +attach) (load! +capture) (load! +export)