Browse Source

Call org-reveal after archiving

Sometimes archiving a task displays the next task heading after ... at the
end of a folded task.  This keeps the next task the cursor is on starting
in column 1 which feels more natural.
Bernt Hansen 11 years ago
1 changed files with 4 additions and 2 deletions
  1. 4 2

+ 4 - 2

@@ -306,7 +306,8 @@ this heading."
       (message "Subtree archived %s"
 	       (if (eq this-buffer buffer)
 		   (concat "under heading: " heading)
-		 (concat "in file: " (abbreviate-file-name afile)))))))
+		 (concat "in file: " (abbreviate-file-name afile))))))
+  (org-reveal))
 (defun org-archive-to-archive-sibling ()
   "Archive the current heading by moving it under the archive sibling.
@@ -357,7 +358,8 @@ sibling does not exist, it will be created at the end of the subtree."
       (outline-up-heading 1 t)
       (org-cycle-show-empty-lines 'folded)
-      (goto-char pos))))
+      (goto-char pos)))
+  (org-reveal))
 (defun org-archive-all-done (&optional tag)
   "Archive sublevels of the current tree without open TODO items.