diff --git a/lisp/org-cycle.el b/lisp/org-cycle.el index 656ca83f2..c1caa3fdc 100644 --- a/lisp/org-cycle.el +++ b/lisp/org-cycle.el @@ -630,7 +630,6 @@ With a numeric prefix, show all headlines up to that level." (save-excursion (org-back-to-heading t) (org-fold-subtree t) - (org-fold-reveal) (pcase state ("folded" (org-fold-subtree t)) diff --git a/testing/lisp/test-org-fold.el b/testing/lisp/test-org-fold.el index 0fa800dee..63e441a29 100644 --- a/testing/lisp/test-org-fold.el +++ b/testing/lisp/test-org-fold.el @@ -285,6 +285,36 @@ ** b" (org-set-visibility-according-to-property) (invisible-p (point)))) + (org-test-with-temp-text + " +#+STARTUP: overview +* A +** AA +** AB +*** ABA +:PROPERTIES: +:VISIBILITY: folded +:END: +**** ABAA +**** ABAB +**** ABAC +** AC +* B +" + (org-set-regexps-and-options) + (org-cycle-set-startup-visibility) + (search-forward "A") + (should-not (invisible-p (point))) + (search-forward "AB") + (should (invisible-p (point))) + (search-forward "ABA") + (should (invisible-p (point))) + (search-forward "ABAB") + (should (invisible-p (point))) + (search-forward "AC") + (should (invisible-p (point))) + (search-forward "B") + (should-not (invisible-p (point)))) ;; "children" state. (should (org-test-with-temp-text