# HG changeset patch # User Richard M. Stallman # Date 895953618 0 # Node ID 74d1c031f824517ef70401c48611e793285f5172 # Parent e03f87c938ca6cb011b6b3f87d35bfec3883a7d9 (fill-region-as-paragraph): Don't add a newline at the end, when there is none. diff -r e03f87c938ca -r 74d1c031f824 lisp/textmodes/fill.el --- a/lisp/textmodes/fill.el Sat May 23 19:59:27 1998 +0000 +++ b/lisp/textmodes/fill.el Sat May 23 20:00:18 1998 +0000 @@ -302,11 +302,10 @@ (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 @@ (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.