我一直在尝试改进我的 org-fu,我的任务之一是重新归档列表项。出于各种原因,我通常更喜欢使用列表项(主要是 - 考虑到我的任务量,不要乱扔我的 CONTENT 视图,并且有一个真实的大纲)。
但是,唉,当我尝试重新填写使用捕获系统创建的列表项时,我收到一个错误 - 我不允许这样做,因为它“没有意义”。
有没有办法覆盖这种行为?
编辑:ATM 我只设法重新归档条目(即标题),然后将它们手动转换为列表项。我认为有比这更好的解决方案...
我在 org-capture.el 中找到了这个函数:
(defun org-capture-refile ()
"Finalize the current capture and then refile the entry.
Refiling is done from the base buffer, because the indirect buffer is then
already gone. Any prefix argument will be passed to the refile command."
(interactive)
(unless (eq (org-capture-get :type 'local) 'entry)
(error
"Refiling from a capture buffer makes only sense for `entry'-type templates"))
(let ((pos (point))
(base (buffer-base-buffer (current-buffer)))
(org-refile-for-capture t))
(org-capture-finalize)
(save-window-excursion
(with-current-buffer (or base (current-buffer))
(save-excursion
(save-restriction
(widen)
(goto-char pos)
(call-interactively 'org-refile)))))))
如何删除部分(unless (eq (org-capture-get :type 'local) 'entry)
使其生效?
编辑:23.10.12
到目前为止,我设法让它工作:
(defun narrow-and-reveal ()
"Narrow and reveal all content"
(org-narrow-to-subtree)
(org-show-subtree)
)
(defun widen-and-outline ()
"Widen and move to beginning of file"
(widen)
(beginning-of-buffer)
(org-overview)
(org-content)
)
(defun org-goto-symbol ()
"Will navigate to the symbol at the current point of the cursor"
(widen-and-outline)
(interactive)
(let ((current-prefix-arg 4)) ;; emulate C-u
(call-interactively 'org-refile)) ;; invoke org-refile interactively
(narrow-and-reveal)
)
(defun custom-org-prompt-headline ()
(org-goto-symbol) ;; invoke org-refile interactively
(end-of-buffer))
(setq org-capture-templates`(
("t" "ToDo" item (file+function (concat org-directory "ToDo.org") custom-org-prompt-headline))))
但在输入列表项本身之前,它会提示我输入文件中的部分,我觉得这有点让人分心。我只想选择重新归档列表项。我无法想象它应该那么难实现..是吗?