tags:

views:

119

answers:

1

I was trying to use the capture as is explained in org-manual p 74. This is the .emacs file for org mode.

(require 'org-install)
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-ca" 'org-agenda)
(setq org-log-done t)

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

But I get this error. What might be wrong?

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

ADDED

After Dave's answer, I modified the code, and it seems to work fine. But the other problem that I found was C-c c gives me this error.

Symbol's function definition is void : org-capture
+1  A: 

First of all, make sure you're using org-mode 6.36 or later. (Earlier versions use remember.el which has a different setup.)

You're using a symbol that's not defined, org-directory. Try using:

(setq org-default-notes-file (expand-file-name "~/notes.org"))

Followup: To load a recent org-mode package:

(add-to-list 'load-path "/my/home/emacs.d/org-7.01h/lisp")
(require 'org-install)
(require 'org) ;; maybe this line is redundant

Note that as packaged, the org-mode lisp files are in the lisp sub-directory.

Dave Bacher
@Dave : How do I check the version of org mode? I just download the Aqumacs on my Mac.
prosseek
@proseek, this (http://github.com/davidswelt/aquamacs-emacs/blob/master/lisp/org/org.el) from the Aquamacs source shows that the Aquamacs org-mode version is 6.33x. You'll have to download/install a more recent org-mode release to get org-capture.
Dave Bacher
@Dave: I installed the newest org mode as is written in the manual (add the installed directory to exec-path), but it seems that the old version of org-mode seems to run.
prosseek
@proseek, exec-path? do you mean load-path? The .emacs lines that I added to my answer loaded the most recent org-mode in my Aquamacs.
Dave Bacher
@Dave : It works fine. Thanks.
prosseek