From e7b252f4427bb49e52bc54e422a84d5979664f92 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Thu, 12 Jul 2018 20:38:17 +0200 Subject: [PATCH] TAB should respect org-cycle-open-archived-trees And shouldn't cycle visibility of archived trees by default. --- modules/lang/org/autoload/org.el | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/lang/org/autoload/org.el b/modules/lang/org/autoload/org.el index 343e341b4..4859fb687 100644 --- a/modules/lang/org/autoload/org.el +++ b/modules/lang/org/autoload/org.el @@ -395,13 +395,15 @@ with `org-cycle')." (unless (eq this-command 'org-shifttab) (save-excursion (org-beginning-of-line) - (when (org-at-heading-p) - (when (or (not arg) - (outline-invisible-p (line-end-position))) - (outline-toggle-children) - (unless (outline-invisible-p (line-end-position)) - (org-cycle-hide-drawers 'subtree)) - t))))) + (when (and (org-at-heading-p) + (or org-cycle-open-archived-trees + (not (member org-archive-tag (org-get-tags)))) + (or (not arg) + (outline-invisible-p (line-end-position)))) + (outline-toggle-children) + (unless (outline-invisible-p (line-end-position)) + (org-cycle-hide-drawers 'subtree)) + t)))) ;;;###autoload (defun +org|remove-occur-highlights ()