From afffe03dcfd41b13d1acae85653bd3c1dce1fd92 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Mon, 17 Mar 2014 01:41:42 +0100 Subject: [PATCH] org.el (org-insert-heading): Don't remove whitespaces following an empty headline * org.el (org-insert-heading): Don't remove whitespaces following an empty headline. Thanks to Brady Trainor for reporting this. --- lisp/org.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 0186674e9..24d05106a 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -7619,7 +7619,8 @@ This is important for non-interactive uses of the command." (when respect-content (org-end-of-subtree nil t) (skip-chars-backward " \r\n") - (and (looking-at "[ \t]+") (replace-match "")) + (and (not (looking-back "^\*+")) + (looking-at "[ \t]+") (replace-match "")) (unless (eobp) (forward-char 1)) (when (looking-at "^\\*") (unless (bobp) (backward-char 1)) -- 2.11.4.GIT