4

Instead of adding .org files using C-c [ I would like to add a directory to my .emacs file, as I read it is done here.

I only have one directory at the moment, so this is the line I put into my .emacs:

(setq org-agenda-files (quote ("~/Documents/Org")))

This path should be pointing to a directory I have, named "Org", where I have a few .org files.

However, when I call the Agenda with C-c a and subsequently try to gather all TODO items with key t, I get the following message:

Non-existent agenda file ~/Documents/Org. [R]emove from list or [A]bort?

I notice that there is a full stop mark in the message, which is not intended. Also, it looks like emacs is really asking for a file, not a directory.

  • One solution might be to use file-expand-wildcards with parameter '~/Documents/Org/*' to get all files in the directory and add them to the org-agenda-files, please take a look at this (emacs.stackexchange.com/questions/5560/…). – Iqbal Ansari Oct 1 '15 at 12:41
  • Thank you, this also works however it is not needed in this instance. I will update my own question as the mistake is much sillier.. – Mike Anblips Oct 1 '15 at 13:49
  • It looks like you figured out the problem. Could you please change your edit to a full-fledged answer (and accept it once the system allows you)? It's perfectly acceptable, and fairly common, to do so. – Dan Oct 1 '15 at 14:24
  • Oh right! I forgot that org-agenda-files can have directories – Iqbal Ansari Oct 1 '15 at 15:08
4

The reason emacs was complaining is because - indeed - there is no file in the specified directory .

Working under Windows, I mistakenly took ~ for my home directory. This is not the case.

When meaningful directories are specified as entries in the org-agenda-files variable, emacs matches its contents towards the variable org-agenda-file-regexp in the org.el file, actually allowing for a much finer customization (for instance nested structures).

So the mechanism works just fine.

Source: org.el file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.