Don't move cursor when toggling folds in org-mode
This commit is contained in:
parent
dcc3b9a2fc
commit
6c3c40e41e
1 changed files with 10 additions and 8 deletions
|
@ -127,14 +127,16 @@ wrong places)."
|
|||
"Toggle the local fold at the point (as opposed to cycling through all levels
|
||||
with `org-cycle'). Also removes babel result blocks, if run from a code block."
|
||||
(interactive)
|
||||
(org-babel-when-in-src-block
|
||||
(call-interactively 'org-babel-remove-result-one-or-many))
|
||||
(cond ((org-at-heading-p)
|
||||
(outline-toggle-children))
|
||||
((org-at-item-p)
|
||||
(let ((window-beg (window-start)))
|
||||
(org-cycle)
|
||||
(set-window-start nil window-beg)))))
|
||||
(save-excursion
|
||||
(org-beginning-of-line)
|
||||
(cond ((org-in-src-block-p)
|
||||
(org-babel-remove-result))
|
||||
((org-at-heading-p)
|
||||
(outline-toggle-children))
|
||||
((org-at-item-p)
|
||||
(let ((window-beg (window-start)))
|
||||
(org-cycle)
|
||||
(set-window-start nil window-beg))))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +org/toggle-checkbox ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue