소스 검색

Do not fill paragraph before region

* lisp/org.el (org-fill-paragraph): Do not fill paragraph before
region.
* testing/lisp/test-org.el (test-org/fill-paragraph): Add test.

Reported-by: Matt Lundin <mdl@imapmail.org>
<http://lists.gnu.org/r/emacs-orgmode/2020-07/msg00164.html>
Nicolas Goaziou 4 년 전
부모
커밋
91b2398293
2개의 변경된 파일10개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      lisp/org.el
  2. 9 0
      testing/lisp/test-org.el

+ 1 - 2
lisp/org.el

@@ -19375,8 +19375,7 @@ filling the current element."
 	      (skip-chars-backward " \t\n")
 	      (while (> (point) start)
 		(org-fill-element justify)
-		(org-backward-paragraph))
-	      (org-fill-element justify))
+		(org-backward-paragraph)))
 	  (goto-char origin)
 	  (set-marker origin nil))))
      (t

+ 9 - 0
testing/lisp/test-org.el

@@ -752,6 +752,15 @@
 	      (push-mark (point) t t)
 	      (goto-char (point-min))
 	      (call-interactively #'org-fill-paragraph)
+	      (buffer-string)))))
+  (should
+   (equal "012345678 9\n\n012345678\n9"
+	  (org-test-with-temp-text "012345678 9\n<point>\n012345678 9"
+	    (let ((fill-column 10))
+	      (transient-mark-mode 1)
+	      (push-mark (point) t t)
+	      (goto-char (point-max))
+	      (call-interactively #'org-fill-paragraph)
 	      (buffer-string))))))
 
 (ert-deftest test-org/auto-fill-function ()