# HG changeset patch # User Richard M. Stallman # Date 790643166 0 # Node ID 6e00457b6f867ff272378298b418c8acaa9b7f8b # Parent 7ffec1b5c86c7880e247f0a7a5022a4fce1947d9 (fill-region-as-paragraph): At end, advance over any newlines that were in the region but excluded from filling. diff -r 7ffec1b5c86c -r 6e00457b6f86 lisp/textmodes/fill.el --- a/lisp/textmodes/fill.el Fri Jan 20 22:02:53 1995 +0000 +++ b/lisp/textmodes/fill.el Fri Jan 20 23:06:06 1995 +0000 @@ -134,7 +134,8 @@ (or justify (setq justify (current-justification))) ;; Don't let Adaptive Fill mode alter the fill prefix permanently. - (let ((fill-prefix fill-prefix)) + (let ((fill-prefix fill-prefix) + (skip-after 0)) ;; Figure out how this paragraph is indented, if desired. (if (and adaptive-fill-mode (or (null fill-prefix) (string= fill-prefix ""))) @@ -172,6 +173,9 @@ (setq beg (point)) (goto-char (max from to)) (skip-chars-backward "\n") + (setq skip-after (- to (point))) + ;; If we omit some final newlines from the end of the narrowing, + ;; arrange to advance past them at the end. (setq to (point) from beg) (goto-char from) @@ -307,7 +311,8 @@ (justify-current-line justify t t) (forward-line -1) (justify-current-line justify nil t) - (forward-line 1))))))))) + (forward-line 1)))))) + (forward-char skip-after)))) (defun fill-paragraph (arg) "Fill paragraph at or after point. Prefix arg means justify as well.