diff options
| author | Richard M. Stallman | 1993-04-11 04:02:23 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-04-11 04:02:23 +0000 |
| commit | e407986c5686d2bcba89bfb4c4057cc01b4354d4 (patch) | |
| tree | 0b96b00e5d5878ff8d9ac4c43f973a0677c6f356 | |
| parent | 81937af25a48106303197a35d50957b23c79e0d3 (diff) | |
| download | emacs-e407986c5686d2bcba89bfb4c4057cc01b4354d4.tar.gz emacs-e407986c5686d2bcba89bfb4c4057cc01b4354d4.zip | |
(fill-nonuniform-paragraphs): New command.
| -rw-r--r-- | lisp/textmodes/fill.el | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index 8486e81c2e2..01838207f21 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el | |||
| @@ -273,12 +273,27 @@ Prefix arg (non-nil third arg, if called from program) means justify as well." | |||
| 273 | (setq ncols (1- ncols))))))) | 273 | (setq ncols (1- ncols))))))) |
| 274 | nil) | 274 | nil) |
| 275 | 275 | ||
| 276 | (defun fill-individual-paragraphs (min max &optional justifyp mailp) | 276 | (defun fill-nonuniform-paragraphs (min max &optional justifyp mailp) |
| 277 | "Fill each paragraph in region according to its individual fill prefix. | 277 | "Fill paragraphs within the region, allowing varying indentation within each. |
| 278 | This command divides the region into \"paragraphs\", | ||
| 279 | only at paragraph-separator lines, then fills each paragraph | ||
| 280 | using as the fill prefix the smallest indentation of any line | ||
| 281 | in the paragraph. | ||
| 282 | |||
| 283 | When calling from a program, pass range to fill as first two arguments. | ||
| 278 | 284 | ||
| 279 | If `fill-individual-varying-indent' is non-nil, | 285 | Optional third and fourth arguments JUSTIFY-FLAG and MAIL-FLAG: |
| 280 | then a mere change in indentation does not end a paragraph. In this mode, | 286 | JUSTIFY-FLAG to justify paragraphs (prefix arg), |
| 281 | the indentation for a paragraph is the minimum indentation of any line in it. | 287 | MAIL-FLAG for a mail message, i. e. don't fill header lines." |
| 288 | (interactive "r\nP") | ||
| 289 | (let ((fill-individual-varying-indent t)) | ||
| 290 | (fill-individual-paragraphs min max justifyp mailp))) | ||
| 291 | |||
| 292 | (defun fill-individual-paragraphs (min max &optional justifyp mailp) | ||
| 293 | "Fill paragraphs of uniform indentation within the region. | ||
| 294 | This command divides the region into \"paragraphs\", | ||
| 295 | treating every change in indentation level as a paragraph boundary, | ||
| 296 | then fills each paragraph using its indentation level as the fill prefix. | ||
| 282 | 297 | ||
| 283 | When calling from a program, pass range to fill as first two arguments. | 298 | When calling from a program, pass range to fill as first two arguments. |
| 284 | 299 | ||