How to update the Org 7 that comes with Emacs to Org 8 (more configuration! better exports!)

Update 2014-05-12: Simplified thanks to Sebastian’s note that Org 8 is available in the built-in package repository, yay!

The Org Mode included in Emacs 24 is version 7. Version 8 has lots of new configuration variables and the exporting mechanism has been rewritten. However, it needs to be installed in an Emacs that has not yet loaded any Org code or files. Here’s how you can upgrade your Org:

  1. Start Emacs with emacs -q. This skips your personal configuration.
  2. You will need an Internet connection for this step. Type M-x package-install, and type in org. This will install the latest version of Org from the built-in package repository.
  3. Edit your ~/.emacs.d/init.el (or ~/.emacs, if you’re using that instead). Add the following code to the beginning of the file:
    (package-initialize)
    (setq package-enable-at-startup nil)
    

    This will load the installed packages when you start Emacs, overriding the buit-in Org 7 with the Org 8 version that you installed.

    Advanced note: If you’ve downloaded Emacs Lisp code that should override code already installed through packages, you need to change this to (package-initialize nil) instead, and add (package-initialize t) after your load-path settings.

  4. Check your configuration for references to the older version of Org. In particular, look for any configuration related to exporting (ex: (require 'org-html)). You can change those lines to their Org 8 equivalents (ex: (require 'ox-html)), but it’s probably easier to just comment them out for now. You can comment out lines by adding ; to the beginning.
  5. Save your init.el and restart Emacs (this time, without the -q option). M-x org-version should now start with Org-mode version 8.
  6. Review your Emacs configuration for any changes that you will need to make. You can ask the Org Mode mailing list for help if you get stuck.

Good luck!

  • Da

    Yep. Worked for me. Tks

  • Sebastian Wiesner

    You do not need MELPA here. It doesn’t even include Org.

    Org 8 is part of GNU ELPA at http://elpa.gnu.org/packages/org.html, which is enabled by default.

    • http://sachachua.com sachac

      Oh, that’s really useful to know! <laugh> Serves me right for seeing the timestamp-based version number and making assumptions. That simplifies the installation process quite a bit. Thanks!

  • Phil

    Unless something require/loads an org library *during* your init file evaluation, I don’t think it’s necessary to force the early package initialisation? Or if you do have code which will load org, an alternative is to use after-init-hook to run that code (after the normal package initialisation has completed).

    • http://sachachua.com Sacha Chua

      Yes, that’s a neater way to do things, but people who are new to Emacs are likely to copy (require ‘…) and similar code from suggested configuration. Doing the package-initialize to force the loading of the new Org is probably the most straightforward way to do it, and people who are more comfortable with Emacs Lisp can skip that and use things like eval-after-load or after-init-hook instead. Does that make sense?

  • Enchanter

    I am using emacs24-starter-kit to manage my configuration and try to use el-get to install org-mode. I can see the files are checked out and built. But when I try the ‘M-x org-version’ it still shows me Org 7.

    • http://sachachua.com Sacha Chua

      Enchanter: Could you try adding (el-get ‘sync) to your ~/.emacs.d/init.el or ~/.emacs, before anything that refers to Org? That should initialize all of your installed packages.