(defun wg-get-org-agenda-view-commands ()
"Get commands by which the current state of Agenda buffer can
be restored using \"(eval commands)\"."
(interactive)
(if (get-buffer org-agenda-buffer-name)
(with-current-buffer org-agenda-buffer-name
(let* ((p (or (and (looking-at "\\'") (1- (point))) (point)))
(series-redo-cmd (get-text-property p 'org-series-redo-cmd)))
(if series-redo-cmd
(get-text-property p 'org-series-redo-cmd)
(get-text-property p 'org-redo-cmd))))))
(defun wg-run-agenda-cmd (f)
"Run commands \"f\" in Agenda buffer. You can get these
commands using \"wg-get-org-agenda-view-commands\"."
(if (get-buffer org-agenda-buffer-name)
(save-window-excursion
(with-current-buffer org-agenda-buffer-name
(let* ((line (org-current-line)))
(if f (eval f))
(org-goto-line line))))))
只需阅读这两个函数的文档字符串。
感谢 org-mode 邮件列表上的小伙伴们。他们给了我一个提示。
现在我继续“工作组”扩展 -可以保存和恢复 org-agenda 缓冲区的workgroups2 。