Org-capture:Todo 转到默认捕获文件

发布于 2024-11-18 15:20:00 字数 1906 浏览 3 评论 0原文

我的 .emacs

;; enable orgmode en set files
(require 'org-install)
(setq org-directory "~/Dropbox/GTD/")
(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-agenda-files (list (concat org-directory "nextactions.org")
                             (concat org-directory "projects.org") 
                 (concat org-directory "birthday.org")))
;; Daily action list
(setq org-agenda-custom-commands
'(
("D" "Daily Action List"
      (
           (agenda "" ((org-agenda-ndays 1)
                       (org-agenda-sorting-strategy
                       (quote ((agenda time-up priority-down tag-up) )))
                       (org-deadline-warning-days 0)
                       ))))
;; Office list
("H" "Office and Home Lists"
     ((agenda)
      (tags-todo "OFFICE")
      (tags-todo "HOME")))
)
)
;; Turn on diary within org-mode
(setq org-agenda-include-diary t)
;; Turn on Capture
(setq org-default-notes-file (concat org-directory "notes.org"))
(define-key global-map "\C-cc" 'org-capture)
;; Capture templates
(setq org-capture-templates
  '(
   ("t" "Todo" entry (file+headline (concat org-directory "nextactions.org") "Inbox") "* TODO %?\n  %i\n  %a")
   ("j" "Journal" entry (file+datetree (concat org-directory "journal.org")) "* %?\nEntered on %U\n  %i\n  %a")
   )
)

Cc c 显示捕获菜单缓冲区。然后我按 t 并捕获出现的缓冲区 (CAPTURE-notes.org)。在抄送之后,该条目将添加到notes.org而不是nextactions.org部分“收件箱”。

我没有 .emacs 解析错误,如何解决此问题,以便待办事项捕获模板将其条目放入 nextactions.org 中?

编辑:org-default-notes-file设置为nextactions.org让我至少可以操作第一个org-capture模板(因为它的文件无论如何都是一样的)。第二个继续写入 default-notes-file

My .emacs:

;; enable orgmode en set files
(require 'org-install)
(setq org-directory "~/Dropbox/GTD/")
(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-agenda-files (list (concat org-directory "nextactions.org")
                             (concat org-directory "projects.org") 
                 (concat org-directory "birthday.org")))
;; Daily action list
(setq org-agenda-custom-commands
'(
("D" "Daily Action List"
      (
           (agenda "" ((org-agenda-ndays 1)
                       (org-agenda-sorting-strategy
                       (quote ((agenda time-up priority-down tag-up) )))
                       (org-deadline-warning-days 0)
                       ))))
;; Office list
("H" "Office and Home Lists"
     ((agenda)
      (tags-todo "OFFICE")
      (tags-todo "HOME")))
)
)
;; Turn on diary within org-mode
(setq org-agenda-include-diary t)
;; Turn on Capture
(setq org-default-notes-file (concat org-directory "notes.org"))
(define-key global-map "\C-cc" 'org-capture)
;; Capture templates
(setq org-capture-templates
  '(
   ("t" "Todo" entry (file+headline (concat org-directory "nextactions.org") "Inbox") "* TODO %?\n  %i\n  %a")
   ("j" "Journal" entry (file+datetree (concat org-directory "journal.org")) "* %?\nEntered on %U\n  %i\n  %a")
   )
)

C-c c presents the capture menu buffer. I press then t and capture the buffer that appears (CAPTURE-notes.org). After C-c C-c the entry is added to notes.org instead of nextactions.org section "Inbox".

I have no .emacs parsing errors, how can I fix this so the todo capture-template puts its entry in nextactions.org?

Edit: Setting org-default-notes-file to nextactions.org lets me operate at least the first org-capture template (because its file is the same anyway). The second one stays writing to the default-notes-file.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

往事风中埋 2024-11-25 15:20:00

您使用什么组织模式版本?我不记得确切的版本,但在此之前引用的捕获模板没有被评估。

所以你应该尝试

  • 更新组织模式
  • 使用反引号

    (setq 组织捕获模板
       `(("t" "Todo" 条目 (文件+标题 ,(concat org-directory "nextactions.org")
                                         “收件箱”)
          “* TODO %?\n %i\n %a”)
         (“j”“期刊”条目(文件+日期树,(concat org-directory“journal.org”))
          "* %?\n输入于 %U\n %i\n %a")
        ))
    
  • 使用文字文件路径

    (setq 组织捕获模板
       '((“t”“Todo”条目(文件+标题“~/Dropbox/GTD/nextactions.org”
                                         “收件箱”)
          “* TODO %?\n %i\n %a”)
         (“j”“期刊”条目(文件+日期树“~/Dropbox/GTD/journal.org”)
          "* %?\n输入于 %U\n %i\n %a")
        ))
    

除此之外,我认为您的配置没有问题,我使用类似的配置。

What org-mode version are you using? I don't remember the exact version, but quoted capture templates were not eval'ed before that.

So you should try either

  • Update org-mode
  • use backquotes

    (setq org-capture-templates
       `(("t" "Todo" entry (file+headline ,(concat org-directory "nextactions.org")
                                         "Inbox")
          "* TODO %?\n  %i\n  %a")
         ("j" "Journal" entry (file+datetree ,(concat org-directory "journal.org"))
          "* %?\nEntered on %U\n  %i\n  %a")
        ))
    
  • use the literal filepath

    (setq org-capture-templates
       '(("t" "Todo" entry (file+headline "~/Dropbox/GTD/nextactions.org"
                                         "Inbox")
          "* TODO %?\n  %i\n  %a")
         ("j" "Journal" entry (file+datetree "~/Dropbox/GTD/journal.org")
          "* %?\nEntered on %U\n  %i\n  %a")
        ))
    

Apart from that I see no problem with your config, I use a similar one.

找回味觉 2024-11-25 15:20:00

事实上,您甚至可以使用 Cc Cw 从捕获缓冲区重新归档到您想要的任何议程文件。

infact you can even refile from the capture buffer to which ever agenda file you want to with C-c C-w.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文