I have one file that is my default file in org-agenda-files (which I set in my init.el file).

How can I add other files to the org-agenda-files list from within my default agenda file with paths relative to the default file?

Hypothetical example:

* One heading
  Some text
* Second heading (external)
  AGENDAFILE: ext/ext.org
up vote 1 down vote accepted

You can use a file-local variable to evaluate a lisp form that will add another file to your org-agenda-files list.

For example, you could put the following at the end of your default agenda file to add the another-agenda-file.org file to the list.

## Local Variables:
## eval: (add-to-list 'org-agenda-files "another-agenda-file.org" 'append)
## End:

The append argument (or any non-nil value) in the call to add-to-list puts the file at the back of the list. Leaving it off will put the file at the front of the list.

  • Unfortunately it works only in the end of file (or in the first line using another syntax). But it's better than nothing. Thanks. – alexmkv Feb 4 '16 at 19:59

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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