From: Richard M. Stallman Date: Fri, 7 Apr 1995 23:44:45 +0000 (+0000) Subject: (fill-region): Avoid error on reaching end of buffer. X-Git-Tag: emacs-19.34~4576 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=42457d75fc8fefffb203344cec5fe5e9051d4992;p=emacs.git (fill-region): Avoid error on reaching end of buffer. --- diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 7571ab5cf4c..656c99f725b 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -402,7 +402,7 @@ space does not end a sentence, so don't break a line there." (not (= ?\n (char-after end))) (not (= end (point-max)))) (goto-char (1+ end))) - (setq end (min (point-max) (1+ end))) + (setq end (if end (min (point-max) (1+ end)) (point-max))) (goto-char initial)) (forward-paragraph 1) (setq end (point))