Stelian Iancu <li...@siancu.net> writes: > On Sat, Jan 5, 2013 at 7:51 PM, Eric Schulte <schulte.e...@gmail.com> wrote: >> >> >> That sounds like it should work, although I would go with the more >> complete but possibly overkill >> >> ;; emacs-lisp >> (package-initialize) >> (require 'org) >> (org-reload) >> >> Let me know if either of the above is sufficient to solve your problem >> and ensure that only the latest ELPA version of Org-mode is used through >> the entire startup process. If so I will add this to the starter kit. > > > What I did to get around this problem is the following (in init.el): > > ;; remove path to org shipped with emacs > (require 'cl) > (setq load-path (remove-if (lambda (x) (string-match-p "org$" x)) > load-path)) > > ;; remember this directory > (setq starter-kit-dir > (file-name-directory (or load-file-name (buffer-file-name)))) > > ;; add the orgmode.org ELPA package > (require 'package) > (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t) > > (package-initialize) > (unless package-archive-contents ;; Refrech the packages descriptions > (package-refresh-contents)) > (setq package-load-list '(all)) ;; List of packages to load > (unless (package-installed-p 'org-plus-contrib) ;; Make sure the Org > package is > (package-install 'org-plus-contrib)) ;; installed, install it > if not > (package-initialize) ;; Initialize & Install Package > > (add-to-list 'load-path (car (file-expand-wildcards (concat starter-kit-dir > "elpa/org-plus-contrib-*")))) > (require 'org) > > ;; load up the starter kit > (org-babel-load-file (expand-file-name "main.org" starter-kit-dir)) > > This solved the problem for me. I didn't come up with this though (I'm a > newb when it comes to Emacs and elisp) but I've copied it from somebody. >
Hi Stelian, Thanks for the recipe, however it seems like overkill. Specifically it should not mandate the instillation of the latest version of Org-mode through ELPA, rather it should use such an ELPA-installed Org-mode *only* if it already exists. Also, I do not want to change the user's load path. I'm confident that a simple solution with `package-initialize' can be found. Best, -- Eric Schulte http://cs.unm.edu/~eschulte