# HG changeset patch # User Richard M. Stallman # Date 889316843 0 # Node ID 8e12f5209e378b362c6fcc1e6ed3c3a56da5ab63 # Parent 363bd52feeb2b701390ba49883a6025024ce8524 (fill-region): If JUSTIFY is non-nil and not a known value, treat it as `full'. (fill-region-as-paragraph): Likewise. diff -r 363bd52feeb2 -r 8e12f5209e37 lisp/textmodes/fill.el --- a/lisp/textmodes/fill.el Sun Mar 08 00:26:27 1998 +0000 +++ b/lisp/textmodes/fill.el Sun Mar 08 00:27:23 1998 +0000 @@ -268,6 +268,8 @@ space does not end a sentence, so don't break a line there." (interactive (list (region-beginning) (region-end) (if current-prefix-arg 'full))) + (unless (memq justify '(nil none full center left right)) + (setq justify 'full)) ;; Arrange for undoing the fill to restore point. (if (and buffer-undo-list (not (eq buffer-undo-list t))) (setq buffer-undo-list (cons (point) buffer-undo-list))) @@ -573,10 +575,13 @@ (defun fill-region (from to &optional justify nosqueeze to-eop) "Fill each of the paragraphs in the region. -Prefix arg (non-nil third arg, if called from program) means justify as well. +A prefix arg means justify as well. Ordinarily the variable `fill-column' controls the width. -Noninteractively, fourth arg NOSQUEEZE non-nil means to leave +Noninteractively, the third argument JUSTIFY specifies which +kind of justification to do: `full', `left', `right', `center', +or `none' (equivalent to nil). +The fourth arg NOSQUEEZE non-nil means to leave whitespace other than line breaks untouched, and fifth arg TO-EOP non-nil means to keep filling to the end of the paragraph (or next hard newline, if `use-hard-newlines' is on). @@ -585,6 +590,8 @@ space does not end a sentence, so don't break a line there." (interactive (list (region-beginning) (region-end) (if current-prefix-arg 'full))) + (unless (memq justify '(nil none full center left right)) + (setq justify 'full)) (let (end beg) (save-restriction (goto-char (max from to))