Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 53 additions & 4 deletions evil-vars.el
Original file line number Diff line number Diff line change
Expand Up @@ -1842,10 +1842,59 @@ Elements have the form (NAME . FUNCTION).")
:close-all ,(lambda ()
(with-no-warnings (hide-sublevels 1)))
:toggle outline-toggle-children
:open ,(lambda ()
(with-no-warnings
(show-entry)
(show-children)))
:open
,(lambda ()
(save-excursion
(let (;; Invisible
(func-invisible-p
(cond
;; `org-mode'
((and (derived-mode-p 'org-mode)
(fboundp 'org-invisible-p))
#'org-invisible-p)

;; `outline-mode' and `outline-minor-mode'
((and (or (derived-mode-p 'outline-mode)
(bound-and-true-p outline-minor-mode))
(fboundp 'outline-invisible-p))
#'outline-invisible-p)))

;; Back to heading
(func-back-to-heading
(cond
;; `org-mode'
((and (derived-mode-p 'org-mode)
(fboundp 'org-back-to-heading))
#'org-back-to-heading)

;; `outline-mode' and `outline-minor-mode'
((and (or (derived-mode-p 'outline-mode)
(bound-and-true-p outline-minor-mode))
(fboundp 'outline-back-to-heading))
#'outline-back-to-heading))))
(if (not (and func-back-to-heading
func-invisible-p))
(with-no-warnings
(show-entry)
(show-children))
;; Repeatedly reveal children and body until the entry is no
;; longer folded
(condition-case nil
;; Repeatedly reveal children and body until the entry is no
;; longer folded
(while (save-excursion
;; Folded?
(funcall func-back-to-heading)
(end-of-line)
(funcall func-invisible-p (point)))
(save-excursion
(funcall func-back-to-heading)
(with-no-warnings
(show-children)
(show-entry))))
;; Ignore the `outline-back-to-heading' error
(outline-before-first-heading
nil))))))
:open-rec show-subtree
:close hide-subtree)
((origami-mode)
Expand Down