From 4e4f5007e901bcce3b15c1922e91b5d0fb132893 Mon Sep 17 00:00:00 2001 From: contrapunctus Date: Mon, 30 May 2022 04:06:04 +0530 Subject: [PATCH] my-org-fix-newlines - support point before first heading --- init.org | 2 ++ 1 file changed, 2 insertions(+) diff --git a/init.org b/init.org index db037b0..230683c 100644 --- a/init.org +++ b/init.org @@ -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