0

I'm trying to configure the org-mode in Emacs. I'd like to use the org-capture feature.

I don't know whether I misunderstood, but if I try to capture something with C-c c from a non org-file, it doesn't work.

Question

How could I configure org-capture to function from whatever filetype I'm working with?

My .emacs

;; --------- Org mode settings
;; ----- TODO sequence
(setq org-todo-keywords
       '((sequence "TODO(t)" "FEEDBACK(f)" "VERIFY(v)" "WAITING(w)" "|" "DONE(d)" "DELEGATED(l)")))
;; ----- Key sequences
(require 'org-install)
(add-to-list 'load-path "/home/oscar/Software/org-8.0.7/lisp")
(add-to-list 'load-path "/home/oscar/Software/org-8.0.7/contrib/lisp" t)
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))
(define-key global-map "\C-cl" 'org-store-link)
(define-key global-map "\C-cc" 'org-capture)
(define-key global-map "\C-cb" 'org-iswitchb)
(define-key global-map "\C-ca" 'org-agenda)
(global-font-lock-mode 1)
(setq org-log-done t)
(setq org-directory "~/Documents/Orgfiles/")
(setq org-default-notes-file (concat org-directory "/notes.org"))
(setq org-capture-templates
    '(("t" "Todo" entry (file+headline "~/Documents/Orgfiles/gtd.org" "Tasks")
       "* TODO %?\n %i\n %a")
      ("j" "Journal" entry (file+datetree "~/Documents/Orgfiles/journal.org")
       "* %?\nEntered on %U\n %i\n %a")))
4
  • I tested your config and it worked. It is strange that doesn't work on your side. Maybe you can provide more detailed how it not work.
    – rwxrwxrwx
    Aug 20, 2013 at 8:04
  • @rwxrwxrwx If I'm programming in Python (python-mode) and I'd like to capture a task, It does not work! My question is (in other words): Is it supposed to work outside org-mode? I'd like it to do!
    – Dox
    Aug 20, 2013 at 11:20
  • Try calling the function with M-x instead of with the keyboard shortcut to see if another shortcut is causing a conflict, or run C-h k and your shortcut to see what comes up.
    – lawlist
    Aug 21, 2013 at 5:19
  • What do you get when you type C-h k C-c c when in a non-org file. Sounds like you've got another keybinding shadowing org-capture Aug 26, 2013 at 12:16

1 Answer 1

1

I don't know whether this will be helpful or not, but here are my settings:

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

(setq org-capture-templates
      (quote (("t" "todo" entry (file (concat org-directory "/gtd.org"))
               "* TODO %?\n%U\n%a\n" :clock-in t :clock-resume t)
              ("n" "note" entry (file (concat org-directory "/gtd.org"))
               "* %? :NOTE:\n%U\n%a\n" :clock-in t :clock-resume t)
              ("j" "Journal" entry (file+datetree (concat org-directory "/diary.org"))
               "* %?\n%U\n" :clock-in t :clock-resume t)
              )))

For me it works fine. Do you have the org-directory defined? Do you have the .org files there? I don't think org-mode creates the directories and files.

2
  • If I'm programming in Python (python-mode) and I'd like to capture a task, It does not work! My question is (in other words): Is it supposed to work outside org-mode? I'd like it to do!
    – Dox
    Aug 20, 2013 at 11:22
  • For me it does work from any mode. Maybe try to install org-mode from ELPA? Make sure to install it when the session of emacs did not run any org-mode functions (orgmode.org/Changes.html)
    – Dror
    Aug 20, 2013 at 11:41

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.