diff options
| author | Richard M. Stallman | 1998-03-08 00:27:23 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-03-08 00:27:23 +0000 |
| commit | 73b3354550f3f7a4f544d5be5f431a91cd6f0123 (patch) | |
| tree | c9a9edebbdaedb26af1233ba2307532cba35a9c6 | |
| parent | 7bd1de9193ad212a8d23f03970ba4cade1e67209 (diff) | |
| download | emacs-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.el | 11 |
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 | |||
| 268 | space does not end a sentence, so don't break a line there." | 268 | space 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. |
| 576 | Prefix arg (non-nil third arg, if called from program) means justify as well. | 578 | A prefix arg means justify as well. |
| 577 | Ordinarily the variable `fill-column' controls the width. | 579 | Ordinarily the variable `fill-column' controls the width. |
| 578 | 580 | ||
| 579 | Noninteractively, fourth arg NOSQUEEZE non-nil means to leave | 581 | Noninteractively, the third argument JUSTIFY specifies which |
| 582 | kind of justification to do: `full', `left', `right', `center', | ||
| 583 | or `none' (equivalent to nil). | ||
| 584 | The fourth arg NOSQUEEZE non-nil means to leave | ||
| 580 | whitespace other than line breaks untouched, and fifth arg TO-EOP | 585 | whitespace other than line breaks untouched, and fifth arg TO-EOP |
| 581 | non-nil means to keep filling to the end of the paragraph (or next | 586 | non-nil means to keep filling to the end of the paragraph (or next |
| 582 | hard newline, if `use-hard-newlines' is on). | 587 | 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 | |||
| 585 | space does not end a sentence, so don't break a line there." | 590 | space 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)) |