From 80b0c6f52ce7f8f6666a8da4431b3a87863394e7 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Mon, 12 Jan 2015 12:28:16 -0800 Subject: [PATCH] Command to archive all completed TODOS in buffer. --- dotfiles/emacs.d/init.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dotfiles/emacs.d/init.el b/dotfiles/emacs.d/init.el index d4b32685..486422a8 100644 --- a/dotfiles/emacs.d/init.el +++ b/dotfiles/emacs.d/init.el @@ -609,6 +609,18 @@ The current directory is assumed to be the project's root otherwise." ("C-c C-S-t" . org-todo-force-notes)) :config (progn + (defun org-archive-if (condition-function) + (if (funcall condition-function) + (org-archive-subtree))) + + (defun org-archive-if-completed () + (interactive) + (org-archive-if 'org-entry-is-done-p)) + + (defun org-archive-completed-in-buffer () + (interactive) + (org-map-entries 'org-archive-if-completed)) + (defun org-capture-make-todo-template (&optional content) (unless content (setq content "%?")) (with-temp-buffer