From d81ef695259e6e339fd5326c7e15ed0714638000 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 5 Aug 2020 15:00:34 -0400 Subject: [PATCH] Fix #3693: don't unfold archive trees on file-open Also refactors +org-make-last-point-visible-h to be more realistic about when it should and shouldn't expand the hidden region at point. Since org-agenda-inhibit-startup is now non-nil by default it makes no sense to test it (and it was a poor choice to begin with). Plus, instead of using outline's API, better to use org's, even if they're aliases or wrappers. Less of a maintenance burden. --- modules/lang/org/autoload/org.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/lang/org/autoload/org.el b/modules/lang/org/autoload/org.el index a001f5dfe..f6f215d22 100644 --- a/modules/lang/org/autoload/org.el +++ b/modules/lang/org/autoload/org.el @@ -470,8 +470,11 @@ All my (performant) foldings needs are met between this and `org-show-subtree' ;;;###autoload (defun +org-make-last-point-visible-h () "Unfold subtree around point if saveplace places us in a folded region." - (and (not org-agenda-inhibit-startup) - (outline-invisible-p) + (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)