branch: externals/org-real
commit e9f758a652aa5ac052d901dbdba2d9e002eca06f
Author: Tyler Grinn <[email protected]>
Commit: Tyler Grinn <[email protected]>
Fully expand siblings when toggling global visibility
---
org-real.el | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/org-real.el b/org-real.el
index b8368a3..769cdea 100644
--- a/org-real.el
+++ b/org-real.el
@@ -699,13 +699,17 @@ non-nil, skip setting :primary slot on the last box."
(slot-makeunbound box :expand-children))
(if (org-real--get-all hidden-children)
(cl-rotatef children hidden-children))
- (mapc
- (lambda (child)
- (with-slots (expand-siblings) child
- (when (slot-boundp child :expand-siblings)
- (funcall expand-siblings child)
- (slot-makeunbound child :expand-siblings))))
- (org-real--get-all children)))
+ (let (fully-expanded)
+ (while (not fully-expanded)
+ (setq fully-expanded t)
+ (mapc
+ (lambda (child)
+ (with-slots (expand-siblings) child
+ (when (slot-boundp child :expand-siblings)
+ (funcall expand-siblings child)
+ (slot-makeunbound child :expand-siblings)
+ (setq fully-expanded nil))))
+ (org-real--get-all children)))))
(if (not (org-real--get-all hidden-children)) (cl-rotatef children
hidden-children)))
(mapc 'org-real--update-visibility (append (org-real--get-all children)
(org-real--get-all
hidden-children)))))