From bb7fbf9c4e809c394f97c66eda1a290a53e2816b Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sun, 16 Aug 2015 16:10:50 -0700 Subject: [PATCH] Fix org-archive-if to not skip neighboring completed tasks --- dotfiles/emacs.d/init.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dotfiles/emacs.d/init.el b/dotfiles/emacs.d/init.el index 0cdcbff1..4e01e8d2 100644 --- a/dotfiles/emacs.d/init.el +++ b/dotfiles/emacs.d/init.el @@ -756,7 +756,10 @@ The current directory is assumed to be the project's root otherwise." (defun org-archive-if (condition-function) (if (funcall condition-function) - (org-archive-subtree))) + (let ((next-point-marker + (save-excursion (org-forward-heading-same-level 1) (point-marker)))) + (org-archive-subtree) + (setq org-map-continue-from (marker-position next-point-marker))))) (defun org-archive-if-completed () (interactive)