lang/org: reveal ancestors of point after saveplace

When opening an org file and the point is placed in a folded region (by
saveplace), it reveals the current subtree. Instead, it will reveal the
current subtree *and* its ancestors (and their siblings), which is more
intuitive.
This commit is contained in:
Henrik Lissner 2021-04-20 20:30:43 -04:00
parent 3e425ab2f2
commit 1d155d0c2f

View file

@ -470,13 +470,10 @@ All my (performant) foldings needs are met between this and `org-show-subtree'
"Unfold subtree around point if saveplace places us in a folded region."
(and (not org-inhibit-startup)
(not org-inhibit-startup-visibility-stuff)
(org-invisible-p nil 'folding-only)
(or (not (org-on-heading-p))
(not (member "ARCHIVE" (org-get-tags))))
(ignore-errors
(save-excursion
(outline-previous-visible-heading 1)
(org-show-subtree)))))
;; Must be done on a timer because `org-show-set-visibility' (used by
;; `org-reveal') relies on overlays that aren't immediately available
;; when `org-mode' first initializes.
(run-at-time 0.1 nil #'org-reveal '(4))))
;;;###autoload
(defun +org-remove-occur-highlights-h ()