diff --git a/lisp/org-cycle.el b/lisp/org-cycle.el index c1602f7cd..78d723130 100644 --- a/lisp/org-cycle.el +++ b/lisp/org-cycle.el @@ -667,8 +667,7 @@ With a numeric prefix, show all headlines up to that level." (org-cycle-content)))) ((or "all" "showall") (org-fold-show-subtree)) - (_ nil))) - (org-end-of-subtree t))))))) + (_ nil))))))))) (defun org-cycle-overview () "Switch to overview mode, showing only top-level headlines." diff --git a/testing/lisp/test-org-fold.el b/testing/lisp/test-org-fold.el index 9f15f0a38..a671800ff 100644 --- a/testing/lisp/test-org-fold.el +++ b/testing/lisp/test-org-fold.el @@ -418,7 +418,8 @@ Contents *** c" (org-set-visibility-according-to-property) (not (invisible-p (point))))) - ;; When VISIBILITY properties are nested, ignore inner ones. + ;; When VISIBILITY properties are nested, do not alter parent + ;; visibility unless necessary. (should (org-test-with-temp-text " @@ -431,7 +432,20 @@ Contents :VISIBILITY: folded :END:" (org-set-visibility-according-to-property) - (invisible-p (point))))) + (invisible-p (point)))) + (should + (org-test-with-temp-text + " +* A +:PROPERTIES: +:VISIBILITY: folded +:END: +** B +:PROPERTIES: +:VISIBILITY: content +:END:" + (org-set-visibility-according-to-property) + (not (invisible-p (point)))))) (ert-deftest test-org-fold/visibility-show-branches () "Test visibility of inline archived subtrees."