mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
+org/toggle-fold: realign tables
This commit is contained in:
@ -259,11 +259,16 @@ wrong places)."
|
|||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +org/toggle-fold ()
|
(defun +org/toggle-fold ()
|
||||||
"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:
|
||||||
|
|
||||||
|
+ If in a babel block, removes result blocks.
|
||||||
|
+ If in a table, realign it, if necessary."
|
||||||
(interactive)
|
(interactive)
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(org-beginning-of-line)
|
(org-beginning-of-line)
|
||||||
(cond ((org-in-src-block-p)
|
(cond ((org-table-p)
|
||||||
|
(org-table-align))
|
||||||
|
((org-in-src-block-p)
|
||||||
(org-babel-remove-result))
|
(org-babel-remove-result))
|
||||||
((org-at-heading-p)
|
((org-at-heading-p)
|
||||||
(outline-toggle-children))
|
(outline-toggle-children))
|
||||||
|
Reference in New Issue
Block a user