Emacs org-mode 配置

Emacs org-mode 配置

我正在尝试在 Emacs 中配置org-mode。我想使用该org-capture功能。

我不知道我是否误解了,但如果我尝试C-c c从非文件中捕获某些内容org,它是行不通的。

问题

org-capture无论我处理什么文件类型,我该如何配置才能使其正常运行?

我的.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")))

答案1

我不知道这是否有帮助,但这是我的设置:

(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)
              )))

对我来说,它工作正常。你有定义吗org-directory?你有.org文件吗?我认为没有org-mode创建目录和文件。

相关内容