lang/org: fix org-shifttab only toggling current fold
This commit is contained in:
parent
ca9957b6d8
commit
b7577f1e26
1 changed files with 11 additions and 10 deletions
|
@ -334,13 +334,14 @@ wrong places)."
|
|||
"Toggle the local fold at the point (as opposed to cycling through all levels
|
||||
with `org-cycle')."
|
||||
(interactive)
|
||||
(save-excursion
|
||||
(org-beginning-of-line)
|
||||
(cond ((org-at-heading-p)
|
||||
(outline-toggle-children)
|
||||
(unless (outline-invisible-p (line-end-position))
|
||||
(org-cycle-hide-drawers 'subtree))
|
||||
t)
|
||||
((org-in-src-block-p)
|
||||
(org-babel-remove-result)
|
||||
t))))
|
||||
(unless (eq this-command 'org-shifttab)
|
||||
(save-excursion
|
||||
(org-beginning-of-line)
|
||||
(cond ((org-at-heading-p)
|
||||
(outline-toggle-children)
|
||||
(unless (outline-invisible-p (line-end-position))
|
||||
(org-cycle-hide-drawers 'subtree))
|
||||
t)
|
||||
((org-in-src-block-p)
|
||||
(org-babel-remove-result)
|
||||
t)))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue