diff --git a/lisp/org-exp.el b/lisp/org-exp.el index 8628d1fd7..3e7e54ba6 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1786,6 +1786,7 @@ These special cookies will later be interpreted by the backend." (top-ind (org-list-get-ind top struct))) (goto-char bottom) (when (and (not (eq org-list-ending-method 'indent)) + (not (looking-at "[ \t]*$")) (looking-at org-list-end-re)) (replace-match "")) (unless (bolp) (insert "\n")) @@ -1844,6 +1845,7 @@ These special properties will later be interpreted by the backend." (goto-char bottom) (when (or (looking-at "^ORG-LIST-END-MARKER\n") (and (not (eq org-list-ending-method 'indent)) + (not (looking-at "[ \t]*$")) (looking-at org-list-end-re))) (replace-match "")) (unless (bolp) (insert "\n")) diff --git a/lisp/org-list.el b/lisp/org-list.el index e7f3ec249..7c9ef01f5 100644 --- a/lisp/org-list.el +++ b/lisp/org-list.el @@ -2897,8 +2897,9 @@ Point is left at list end." (when delete (delete-region top bottom) (when (and (not (eq org-list-ending-method 'indent)) + (not (looking-at "[ \t]*$")) (looking-at org-list-end-re)) - (replace-match "\n"))) + (replace-match ""))) out)) (defun org-list-make-subtree ()