Today I went to the EMACS org wiki http://orgmode.org/manual/Setting-up-capture.html#Setting-up-capture

and copy/pasted this directly into my .emacs file

(setq org-default-notes-file (concat org-directory "/notes.org"))
     (define-key global-map "\C-cc" 'org-capture)

Now I'm getting this:

Warning (initialization): An error occurred while loading ‘/home/kantuck/.emacs’:

Symbol's value as variable is void: org-directory

To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the ‘--debug-init’ option to view a complete error backtrace.

I also tried a fresh .emacs file in case of conflicts, and put only that into it, and still it's giving me that error.

Any idea what's going on?

1 Answer 1


Is org-directory a valid variable? You can check that with C-h v org-directory.

My emacs reports it as

org-directory is a variable defined in ‘org.el’.

So you need to load org to get the variable defined. Before your lines above, add this:

(require 'org)
  • 1
    You can also have your configuration applied lazily whenever org is actually loaded by wrapping your config lines in a (with-eval-after-load 'org ...) form.
    – glucas
    Dec 12, 2016 at 17:40
  • Thank you for the help. My apologies for so late a reply. I don't know what happened, but that line was ;; out for some reason in my .emacs file. Even the /old one/ I've been trying to fix another problem and was copy/pasting parts back into a new one. I took out the ;;, and it works like a charm. Very odd, but this is computers :) Dec 14, 2016 at 23:03
  • No worries! Glad you got it working.
    – zck
    Dec 15, 2016 at 4:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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