How To Install The Org Contrib Packages The Right Way

The wonderful, happy accidents of Emacs are part of the fun of using the program. I tried a few different ways of including some org contributed packages into my configuration, got errors, had some issues, and then the issues seemed to fix themselves. Everything I did is recorded below. Enjoy!

Watch the video!

What Are the Org-mode Contributed Packages?

The “Org-mode Contributed Packages”, aka “org-contrib” consist of a bunch of various packages contributed to the org mode project, but have not been included in the core org mode package. So you can install them optionally.

The contributed packages include some interesting functionality that may be helpful to you.

Installing the Org-Contrib Packages

So, to use the org-contrib packages you must require them in your config file.

But before you can do that, you need to make sure you have installed them. And, you need to use the correct package archive. Here’s what I used:

(setq package-archives '(("melpa" . "")
                       ("nongnu" . "")
                       ("elpa" . "")))

(Of course, the package archive used in this installation is the “nongnu” one.)

Then, you can install the org contrib packages, and require them. Here’s the basic recipe I used:

(use-package org-contrib
  :ensure t)
(require 'ox-extra) ;; the package I wanted to include in my config
;; and a function to activate the features of this package:
(ox-extras-activate '(latex-header-blocks ignore-headlines))

Now, you may notice a few things:

  • You may have a newer version of Org mode, installed alongside the org-contrib package
  • You will see some additional directories in your emacs.d/elpa directory (current versions as of this writing):
    • org-9.5.4
    • org-contrib-0.4

The Org Agenda Invalid Date Function Error ((invalid-function (date date)))

If you notice that when you open your org agenda, you see this error:

(invalid-function (date date))

You can try what I did. Erase (or, safer, rename) the directories in your emacs.d/elpa directory you just installed (org-9.5.4 and org-contrib-0.4) and then close and re-open Emacs. If you kept the use-package directive (above) in your configuration then it should re-install org-contrib, and when you check your agenda everything should be working.

Be the first to comment

Leave a Reply

Your email address will not be published.