emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org eb15341b3c: org-cycle-set-visibility-according-to-p


From: ELPA Syncer
Subject: [elpa] externals/org eb15341b3c: org-cycle-set-visibility-according-to-property: Do not change ancestor visibility
Date: Wed, 12 Oct 2022 01:58:02 -0400 (EDT)

branch: externals/org
commit eb15341b3c0c0dc82eab7edf3b634bc211bfa797
Author: Ihor Radchenko <yantar92@gmail.com>
Commit: Ihor Radchenko <yantar92@gmail.com>

    org-cycle-set-visibility-according-to-property: Do not change ancestor 
visibility
    
    * lisp/org-cycle.el (org-cycle-set-visibility-according-to-property):
    Do not unconditionally run `org-fold-reveal' for headlines with
    "VISIBILITY" property.  `org-fold-reveal' can break the global
    visibility and ancestor headline visibility settings.
    *
    testing/lisp/test-org-fold.el 
(test-org-fold/set-visibility-according-to-property):
    Add test.
    
    Reported-by: Eduardo Suarez <esuarez@itccanarias.org>
    Link: https://orgmode.org/list/20220409202736.GA28127@itccanarias.org
---
 lisp/org-cycle.el             |  1 -
 testing/lisp/test-org-fold.el | 30 ++++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/lisp/org-cycle.el b/lisp/org-cycle.el
index 656ca83f21..c1caa3fdc4 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 0fa800deef..63e441a299 100644
--- a/testing/lisp/test-org-fold.el
+++ b/testing/lisp/test-org-fold.el
@@ -285,6 +285,36 @@
 ** <point>b"
      (org-set-visibility-according-to-property)
      (invisible-p (point))))
+  (org-test-with-temp-text
+      "<point>
+#+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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]