소스 검색

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.
Carsten Dominik 11 년 전
부모
커밋
7fdb56a861
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 4 3
      lisp/org.el

+ 4 - 3
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)