diff options
| author | Juri Linkov | 2007-10-06 22:15:10 +0000 |
|---|---|---|
| committer | Juri Linkov | 2007-10-06 22:15:10 +0000 |
| commit | e65f7c96771d19f89787faa815b9bde8f04a0b2f (patch) | |
| tree | c1f9a0ed19e459fef70e3286f39f5fb564e0e0b7 | |
| parent | d6ba9c398efbd6bec64b897cc4ae3733bee30f98 (diff) | |
| download | emacs-e65f7c96771d19f89787faa815b9bde8f04a0b2f.tar.gz emacs-e65f7c96771d19f89787faa815b9bde8f04a0b2f.zip | |
(fill-paragraph-or-region): New function.
| -rw-r--r-- | lisp/textmodes/fill.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 88a4286aad2..2671680542a 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el | |||
| @@ -1007,6 +1007,18 @@ space does not end a sentence, so don't break a line there." | |||
| 1007 | (goto-char end)))) | 1007 | (goto-char end)))) |
| 1008 | fill-pfx)) | 1008 | fill-pfx)) |
| 1009 | 1009 | ||
| 1010 | (defun fill-paragraph-or-region (arg) | ||
| 1011 | "Fill the active region or current paragraph. | ||
| 1012 | In Transient Mark mode, when the mark is active, it calls `fill-region' | ||
| 1013 | on the active region. Otherwise, it calls `fill-paragraph'." | ||
| 1014 | (interactive (progn | ||
| 1015 | (barf-if-buffer-read-only) | ||
| 1016 | (list (if current-prefix-arg 'full)))) | ||
| 1017 | (if (and transient-mark-mode mark-active | ||
| 1018 | (not (eq (region-beginning) (region-end)))) | ||
| 1019 | (fill-region (region-beginning) (region-end) arg) | ||
| 1020 | (fill-paragraph arg))) | ||
| 1021 | |||
| 1010 | 1022 | ||
| 1011 | (defcustom default-justification 'left | 1023 | (defcustom default-justification 'left |
| 1012 | "*Method of justifying text not otherwise specified. | 1024 | "*Method of justifying text not otherwise specified. |