18

I would like to use org-mode's contributed packages: http://orgmode.org/worg/org-contrib/

[EDIT] SOLUTION:

As per answer below: 1) First one should have the elpa packages added.

(require 'package)
...
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
...
(package-initialize)

This is described [here] in detail.1

2) Afterwards, below the lines above, one can add the desired modules like this:

(require 'org-checklist)

WARNING
Some packages may be available in the git-hub repository but not yet in the official repository. (e.g org-eww at the time of writing). As such, requiring these will cause errors.

Before adding a requirement, it is reccomended to browse the folder:

~/.emacs.d/elpa/org-plus-contrib-<DATE>
Leo Ufimtsev
  • 4,488
  • 3
  • 22
  • 45
  • You need to specify the actual value of "CONTRIB_DIR" instead of the variable name. Suppose you cloned the contributed libraries into `~/.emacs.d/org/contrib`, then you need to replace `CONTRIB_DIR` with `"~/.emacs.d/org/contrib/lisp"`. – wvxvw Feb 12 '15 at 16:05
  • That's what I'm using atm. I cloned the git hub repo and added a require: `(add-to-list 'load-path "~/Dropbox/appData/emacs/orgEgit/org-mode/contrib/lisp/"). But I would like to use the org-plus-contrib instead. The problem is that is has a weird file name (date inside the filename) so the same .emacs file that I share between computers won't work on all my machines. Is there a dynamic way to get to that folder? – Leo Ufimtsev Feb 12 '15 at 16:08
  • Possible duplicate: [`org-plus-contrib` and `org` with `require` or `use-package`](http://emacs.stackexchange.com/questions/7890/org-plus-contrib-and-org-with-require-or-use-package). – Dan Feb 12 '15 at 16:33
  • Hello, I have read the post, but the advise there doesn't solve the issue unfortunatley. It is not a duplicate, these two questinos vary sligtly. Please see my edit. – Leo Ufimtsev Feb 12 '15 at 17:12
  • If the problem is only the name, then you could do something like: `(add-to-list 'load-path (car (file-expand-wildcards "~/.emacs.d/elpa/org-*/contrib/lisp")))`. – wvxvw Feb 12 '15 at 19:49
  • If I could get this to work, then this would solve it. I have tierd: (add-to-list 'load-path (car (file-expand-wildcards "~/.emacs.d/elpa/org-plus-contrib-*"))) But at load it won't find the required libs. Maybe it's because there is a missing forward slash? I tried adding it with (concat ... "/") around the file-expand.. function, but it errors out. Do you know how to fix? – Leo Ufimtsev Feb 12 '15 at 20:05
  • Try just the `file-expand-wildcards` in the scratch buffer with the path you want to give it and see if you can build the glob to select the file you want. – wvxvw Feb 12 '15 at 20:30
  • @LeoUfimtsev Just to make sure: You *are* calling `package-initialize` before `require`ing `org-checklist` and `org-eww` in your init-file, correct? – itsjeyd Feb 13 '15 at 07:06
  • adding a hard-file load was not needed. It turns out the org-eww package simply hasn't made it into the elpa repo yet. I updated the question to reflect the answer. – Leo Ufimtsev Feb 17 '15 at 23:42

2 Answers2

9

You shouldn't need to do anything special. I'm running the org-plus-contrib package from the org elpa repository and can just require any of the packages that are included.

I did look and org-eww is not in the org-plus-contrib I have.(my version is 20150209)

I did a (require 'org-checklist) and evaluated it in my scratch buffer and it loaded fine.

Perhaps your org mode isn't loading properly? It is really important that the org-plus-cntrib package is loaded before any org related functions are called. If you have something which references org before you load the org-plus-contrib package, you end up with a mix of the bundled org mode and then the org-plus-contrib package, which can cause some odd behaviour.

Tim X
  • 557
  • 2
  • 11
  • Thank you so much for taking the time to investigate this. It turns out that org-eww is a fresh package that hasn't made it into the elpa repos yet. I was confused between the available org-checklist and the not-available org-eww. – Leo Ufimtsev Feb 17 '15 at 23:41
  • Not a problem. Actually, I'm only responding to try out the new sx.el package for writing and reading questions on SO sites – Tim X Feb 18 '15 at 07:39
4

Taken from the online documentation:

orgmode.org hosts Org ELPA archives.

Add this to your Emacs init file to be able to list the Org mode archives:

(require 'package) (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)

Then M-x list-packages RET will list both the latest org and org-plus-contrib packages.

org contains the same set of files that are included in GNU Emacs. org-plus-contrib contains these files plus all contribs files, the ones you find in contrib/ from the git repo.

M. Toya
  • 157
  • 13
  • 1
    This answer should be updated to use secure HTTPS `(add-to-list 'package-archives '("org" . "https://orgmode.org/elpa/") t)`. Visitor check the link to online documentation. – Navidot Feb 26 '21 at 22:09