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
|
"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."
|
with `org-cycle'). Also removes babel result blocks, if run from a code block."
|
||||||
(interactive)
|
(interactive)
|
||||||
(org-babel-when-in-src-block
|
(save-excursion
|
||||||
(call-interactively 'org-babel-remove-result-one-or-many))
|
(org-beginning-of-line)
|
||||||
(cond ((org-at-heading-p)
|
(cond ((org-in-src-block-p)
|
||||||
(outline-toggle-children))
|
(org-babel-remove-result))
|
||||||
((org-at-item-p)
|
((org-at-heading-p)
|
||||||
(let ((window-beg (window-start)))
|
(outline-toggle-children))
|
||||||
(org-cycle)
|
((org-at-item-p)
|
||||||
(set-window-start nil window-beg)))))
|
(let ((window-beg (window-start)))
|
||||||
|
(org-cycle)
|
||||||
|
(set-window-start nil window-beg))))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org/toggle-checkbox ()
|
(defun +org/toggle-checkbox ()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue