aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1998-03-08 00:27:23 +0000
committerRichard M. Stallman1998-03-08 00:27:23 +0000
commit73b3354550f3f7a4f544d5be5f431a91cd6f0123 (patch)
treec9a9edebbdaedb26af1233ba2307532cba35a9c6
parent7bd1de9193ad212a8d23f03970ba4cade1e67209 (diff)
downloademacs-73b3354550f3f7a4f544d5be5f431a91cd6f0123.tar.gz
emacs-73b3354550f3f7a4f544d5be5f431a91cd6f0123.zip
(fill-region): If JUSTIFY is non-nil
and not a known value, treat it as `full'. (fill-region-as-paragraph): Likewise.
-rw-r--r--lisp/textmodes/fill.el11
1 files changed, 9 insertions, 2 deletions
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
268space does not end a sentence, so don't break a line there." 268space does not end a sentence, so don't break a line there."
269 (interactive (list (region-beginning) (region-end) 269 (interactive (list (region-beginning) (region-end)
270 (if current-prefix-arg 'full))) 270 (if current-prefix-arg 'full)))
271 (unless (memq justify '(nil none full center left right))
272 (setq justify 'full))
271 ;; Arrange for undoing the fill to restore point. 273 ;; Arrange for undoing the fill to restore point.
272 (if (and buffer-undo-list (not (eq buffer-undo-list t))) 274 (if (and buffer-undo-list (not (eq buffer-undo-list t)))
273 (setq buffer-undo-list (cons (point) buffer-undo-list))) 275 (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."
573 575
574(defun fill-region (from to &optional justify nosqueeze to-eop) 576(defun fill-region (from to &optional justify nosqueeze to-eop)
575 "Fill each of the paragraphs in the region. 577 "Fill each of the paragraphs in the region.
576Prefix arg (non-nil third arg, if called from program) means justify as well. 578A prefix arg means justify as well.
577Ordinarily the variable `fill-column' controls the width. 579Ordinarily the variable `fill-column' controls the width.
578 580
579Noninteractively, fourth arg NOSQUEEZE non-nil means to leave 581Noninteractively, the third argument JUSTIFY specifies which
582kind of justification to do: `full', `left', `right', `center',
583or `none' (equivalent to nil).
584The fourth arg NOSQUEEZE non-nil means to leave
580whitespace other than line breaks untouched, and fifth arg TO-EOP 585whitespace other than line breaks untouched, and fifth arg TO-EOP
581non-nil means to keep filling to the end of the paragraph (or next 586non-nil means to keep filling to the end of the paragraph (or next
582hard newline, if `use-hard-newlines' is on). 587hard newline, if `use-hard-newlines' is on).
@@ -585,6 +590,8 @@ If `sentence-end-double-space' is non-nil, then period followed by one
585space does not end a sentence, so don't break a line there." 590space does not end a sentence, so don't break a line there."
586 (interactive (list (region-beginning) (region-end) 591 (interactive (list (region-beginning) (region-end)
587 (if current-prefix-arg 'full))) 592 (if current-prefix-arg 'full)))
593 (unless (memq justify '(nil none full center left right))
594 (setq justify 'full))
588 (let (end beg) 595 (let (end beg)
589 (save-restriction 596 (save-restriction
590 (goto-char (max from to)) 597 (goto-char (max from to))