From c2576f349b7bf27ca00d42c91f5067584c241378 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sat, 20 Jan 2018 13:28:53 +0100 Subject: [PATCH] Re-hide archived subtrees when showing branches * lisp/org.el (org-kill-note-or-show-branches): Re-hide archived subtrees when showing branches. Reported-by: Allen Li --- lisp/org.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index a4f4caf21..70098687f 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -20988,9 +20988,12 @@ Use `\\[org-edit-special]' to edit table.el tables")) "Abort storing current note, or call `outline-show-branches'." (interactive) (if (not org-finish-function) - (progn - (outline-hide-subtree) - (call-interactively 'outline-show-branches)) + (save-excursion + (save-restriction + (org-narrow-to-subtree) + (org-flag-subtree t) + (call-interactively 'outline-show-branches) + (org-hide-archived-subtrees (point-min) (point-max)))) (let ((org-note-abort t)) (funcall org-finish-function))))