![Emacs org-mode 配置](https://linux22.com/image/1374592/Emacs%20org-mode%20%E9%85%8D%E7%BD%AE.png)
我正在尝试在 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
创建目录和文件。