lang/org: fix org-shifttab only toggling current fold

This commit is contained in:
Henrik Lissner 2018-04-05 17:28:30 -04:00
parent ca9957b6d8
commit b7577f1e26
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -334,13 +334,14 @@ wrong places)."
"Toggle the local fold at the point (as opposed to cycling through all levels "Toggle the local fold at the point (as opposed to cycling through all levels
with `org-cycle')." with `org-cycle')."
(interactive) (interactive)
(save-excursion (unless (eq this-command 'org-shifttab)
(org-beginning-of-line) (save-excursion
(cond ((org-at-heading-p) (org-beginning-of-line)
(outline-toggle-children) (cond ((org-at-heading-p)
(unless (outline-invisible-p (line-end-position)) (outline-toggle-children)
(org-cycle-hide-drawers 'subtree)) (unless (outline-invisible-p (line-end-position))
t) (org-cycle-hide-drawers 'subtree))
((org-in-src-block-p) t)
(org-babel-remove-result) ((org-in-src-block-p)
t)))) (org-babel-remove-result)
t)))))