From: Richard M. Stallman Date: Sun, 8 Mar 1998 00:27:23 +0000 (+0000) Subject: (fill-region): If JUSTIFY is non-nil X-Git-Tag: emacs-20.3~1971 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=73b3354550f3f7a4f544d5be5f431a91cd6f0123;p=emacs.git (fill-region): If JUSTIFY is non-nil and not a known value, treat it as `full'. (fill-region-as-paragraph): Likewise. --- diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 1b50e1e84d9..08a285b2aaa 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -268,6 +268,8 @@ If `sentence-end-double-space' is non-nil, then period followed by one 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 @@ argument to it), and if it returns non-nil, we simply return its value." (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 @@ If `sentence-end-double-space' is non-nil, then period followed by one 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))