branch: externals/org-real commit e61d7ae3336ee96782015ae4a9995912cb856e7a Author: Amy Grinn <grinn....@gmail.com> Commit: Amy Grinn <grinn....@gmail.com>
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 b8368a3a1e..769cdead62 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)))))