[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org a5c977b43e 4/5: org-cycle-set-visibility-according-
|
From: |
ELPA Syncer |
|
Subject: |
[elpa] externals/org a5c977b43e 4/5: org-cycle-set-visibility-according-to-property: Honor inner VISIBILITY settings |
|
Date: |
Tue, 30 Jan 2024 09:58:29 -0500 (EST) |
branch: externals/org
commit a5c977b43e6937f0f38f49121b0128c78219eeed
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>
org-cycle-set-visibility-according-to-property: Honor inner VISIBILITY
settings
* lisp/org-cycle.el (org-cycle-set-visibility-according-to-property):
Do not ignore :VISIBILITY: properties when parent also has
:VISIBILITY:.
*
testing/lisp/test-org-fold.el
(test-org-fold/set-visibility-according-to-property):
Add new test.
Similar to how :VISIBILITY: overrides #+STARTUP folding settings,
child :VISIBILITY: should override parent :VISIBILITY:.
The previous version of the code was skipping child VISIBILITY
property to address
https://lists.gnu.org/r/emacs-orgmode/2019-01/msg00402.html
However, that problem in that bug report was not with child VISIBILITY
property, but rather with previous implementation detail that
`org-reveal' was called prior to setting VISIBILITY. That affected
parent headings as well and no longer a problem.
Reported-by: John Mathena <jmmathena@gmail.com>
Link: https://orgmode.org/list/87tucu99od.fsf@localhost
---
lisp/org-cycle.el | 3 +--
testing/lisp/test-org-fold.el | 18 ++++++++++++++++--
2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/lisp/org-cycle.el b/lisp/org-cycle.el
index c1602f7cd9..78d7231300 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 9f15f0a383..a671800ffd 100644
--- a/testing/lisp/test-org-fold.el
+++ b/testing/lisp/test-org-fold.el
@@ -418,7 +418,8 @@ Contents
*** <point>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:
+** <point>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."