From 7fdb56a861908fa7fecc34b4f0a601bfff72767d Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Tue, 3 Sep 2013 16:10:16 +0200 Subject: [PATCH] Small adjustment to behavior of org-insert-heading * lisp/org.el (org-insert-heading): Allow to remove blank lines if the user does not want any. --- lisp/org.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 2f81f8243..2abcb4a7c 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -7669,9 +7669,10 @@ This is important for non-interactive uses of the command." (insert stars) (just-one-space) (insert initial-content) - (if adjust-empty-lines - (if (and blank (not (org-previous-line-empty-p))) - (org-N-empty-lines-before-current (if blank 1 0)))) + (when adjust-empty-lines + (if (or (not blank) + (and blank (not (org-previous-line-empty-p)))) + (org-N-empty-lines-before-current (if blank 1 0)))) (run-hooks 'org-insert-heading-hook))))))) (defun org-N-empty-lines-before-current (N) -- 2.11.4.GIT