This is a hacky answer but it works (add the code to your .emacs
file):
;; First, define a variable to hold the directory name. It will always
;; be updated whenever there's a new Org version.
;; The important part is this function:
;; (file-name-completion "org-"20" "~/Dropbox/emacs/prelude/elpa/")
;; returns:
;; "org-20150511/"
;; or in the future:
;; "org-2016031420250314/"
;; etc.
(setq my-org-from-elpa-dir (expand-file-name (file-name-completion "org-"20" "~/Dropbox/emacs/prelude/elpa/") "~/Dropbox/emacs/prelude/elpa/")
;; Finally, add the directories to load-path.
;; (concat my-org-from-elpa-dir "lisp/")
;; returns:
;; "/home/YOU/Dropbox/emacs/prelude/elpa/org-20150511/lisp/"
;; and so on.
(add-to-list 'load-path (concat my-org-from-elpa-dir "lisp/"))
(add-to-list 'load-path (concat my-org-from-elpa-dir "contrib/"))
(add-to-list 'load-path (concat my-org-from-elpa-dir "contrib/lisp/"))
Caveats:
This code will be evaluated only at startup so you'll have to restart Emacs after you've upgraded your packages. Or else run eval-buffer
. Or define a command based on this answer.
If in "~/Dropbox/emacs/prelude/elpa/"
there are more directories that start with "org-"
In the variable definition will choke. I can't solve this issue now so I'll come back lateryear 3000 you'll have to provide a solutionchange "org-20" for "org-30".