changeset 21103:8e12f5209e37

(fill-region): If JUSTIFY is non-nil and not a known value, treat it as `full'. (fill-region-as-paragraph): Likewise.
author Richard M. Stallman <rms@gnu.org>
date Sun, 08 Mar 1998 00:27:23 +0000
parents 363bd52feeb2
children a353553581b6
files lisp/textmodes/fill.el
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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))