如何在组织议程中批量复制
How to bulk copy in org agenda
议程搜索后,我想批量复制标记的条目。
批量操作调度程序只允许批量重新归档。 (而且我不想修改变量 org-refile-keep。)
这个批量操作的自定义函数应该是什么样子的?
组织手册在 http://orgmode.org/manual/Agenda-commands.html#index-B-1429 中给出了自定义函数的示例,但简单地将 org-set-property "CATEGORY" "web"
替换为 org-copy
并不能解决问题,因为该函数随后会询问目的地对于执行的每个条目。
这个答案假设原始发布者想要从主待办事项文件中复制整个子树,而不是 *Org Agenda*
缓冲区中的摘录(编辑版本)。
标记您的条目,点击字母 B
,然后点击字母 f
,然后键入 org-agenda-bulk-copy-subtree
,然后点击 RET
。楼主不妨修改一下数据采集部分,将词条推送到列表等
[注意事项:在我的测试中,似乎 org-agenda-bulk-action
destroys/moves 标记(肉眼不可见)因此有必要如果需要使用返回主待办文件的标记完成任何其他工作,请重建 *Org Agenda*
缓冲区。或者,也许我们可以 clone/duplicate *Org Agenda*
缓冲区并使用临时缓冲区,这样原始缓冲区就不会被更改?]
(defun org-agenda-bulk-copy-subtree ()
"Doc-string"
(interactive)
(or (eq major-mode 'org-agenda-mode) (error "Not in agenda"))
(let* ((marker (or (org-get-at-bol 'org-marker) (org-agenda-error)))
(buffer (marker-buffer marker))
(pos (marker-position marker))
(output-buf (get-buffer-create "*RESULTS*")))
(with-current-buffer buffer
(goto-char pos)
(org-back-to-heading t)
(org-copy-subtree))
(with-current-buffer output-buf
(insert org-subtree-clip "\n"))
(unless (get-buffer-window output-buf)
(display-buffer output-buf t))))
议程搜索后,我想批量复制标记的条目。
批量操作调度程序只允许批量重新归档。 (而且我不想修改变量 org-refile-keep。)
这个批量操作的自定义函数应该是什么样子的?
组织手册在 http://orgmode.org/manual/Agenda-commands.html#index-B-1429 中给出了自定义函数的示例,但简单地将 org-set-property "CATEGORY" "web"
替换为 org-copy
并不能解决问题,因为该函数随后会询问目的地对于执行的每个条目。
这个答案假设原始发布者想要从主待办事项文件中复制整个子树,而不是 *Org Agenda*
缓冲区中的摘录(编辑版本)。
标记您的条目,点击字母 B
,然后点击字母 f
,然后键入 org-agenda-bulk-copy-subtree
,然后点击 RET
。楼主不妨修改一下数据采集部分,将词条推送到列表等
[注意事项:在我的测试中,似乎 org-agenda-bulk-action
destroys/moves 标记(肉眼不可见)因此有必要如果需要使用返回主待办文件的标记完成任何其他工作,请重建 *Org Agenda*
缓冲区。或者,也许我们可以 clone/duplicate *Org Agenda*
缓冲区并使用临时缓冲区,这样原始缓冲区就不会被更改?]
(defun org-agenda-bulk-copy-subtree ()
"Doc-string"
(interactive)
(or (eq major-mode 'org-agenda-mode) (error "Not in agenda"))
(let* ((marker (or (org-get-at-bol 'org-marker) (org-agenda-error)))
(buffer (marker-buffer marker))
(pos (marker-position marker))
(output-buf (get-buffer-create "*RESULTS*")))
(with-current-buffer buffer
(goto-char pos)
(org-back-to-heading t)
(org-copy-subtree))
(with-current-buffer output-buf
(insert org-subtree-clip "\n"))
(unless (get-buffer-window output-buf)
(display-buffer output-buf t))))