From 78652ce8bdcab6b19cc068ebf5d12381c56c5777 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 23 May 1998 20:00:18 +0000 Subject: [PATCH] (fill-region-as-paragraph): Don't add a newline at the end, when there is none. --- lisp/textmodes/fill.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 9a96711ba76..3bafa4a82d6 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -302,11 +302,10 @@ space does not end a sentence, so don't break a line there." (backward-char 1) (setq oneleft t))) (setq to (point)) - - ;; If there was no newline, and there is text in the paragraph, then - ;; create a newline. - (if (and (not oneleft) (> to from-plus-indent)) - (newline)) +;;; ;; If there was no newline, and there is text in the paragraph, then +;;; ;; create a newline. +;;; (if (and (not oneleft) (> to from-plus-indent)) +;;; (newline)) (goto-char from-plus-indent)) (if (not (> to (point))) @@ -557,7 +556,8 @@ space does not end a sentence, so don't break a line there." (forward-line 1)))))) ;; Leave point after final newline. (goto-char (point-max))) - (forward-char 1)))) + (unless (eobp) + (forward-char 1))))) (defun fill-paragraph (arg) "Fill paragraph at or after point. Prefix arg means justify as well. -- 2.39.2