my-org-fix-newlines - support point before first heading

This commit is contained in:
contrapunctus 2022-05-30 04:06:04 +05:30
parent 98803acc44
commit 4e4f5007e9
1 changed files with 2 additions and 0 deletions

View File

@ -4392,6 +4392,8 @@ From https://emacs.stackexchange.com/questions/20577/org-babel-load-all-language
Newlines are inserted before headings (unless immediately
preceded by another heading) and after headings."
(interactive)
(unless (org-at-heading-p)
(outline-next-heading))
(org-map-tree
(lambda ()
(save-excursion