The rewrap commands

Whenever a word-wrap option is active (with the exception of the Fortran mode of course), the command which is executed by pressing Alt-W will try to determine the first line of the current paragraph and then work its way to the end of the paragraph, rewrapping the paragraph as if it had just been typed in. It recognizes lines belonging to the same paragraph by the trailing blanks that are left at the end of each line when the word wrap is invoked. Therefore the first line of the paragraph is recognized as the line following the first line without a trailing blank that the editor encounters when working its way backwards from its start position. The last line of the paragraph is the first line that the editor runs into without a trailing blank when it is rewrapping. These rules are superceded by two other rules:

Note that the trim command removes trailing blanks, therefore destroying paragraph information. Redefinition of paragraphs can be done however by adding a blank to all lines over a given range. After marking the range of the paragraph as a marked range, this can be done with the following command line command (see regular expressions p. [*]):
    //$/=/ /r
Then by definition the range becomes a paragraph (assuming it has no blank lines). It is also possible to make much more sophisticated restorations of paragraphs by using macro's (p. [*]). In conjunction with the Alt-W command it may be useful to recall the Alt-T toggle command which allows blanks to be displayed as little circles (see the chapter on tabs p. [*]). With this command the presence of the necessary blanks can be checked.

The second rewrap command is entirely different. It is executed with the Alt-Q combination. Its definition of a paragraph is a range of lines that is enclosed either by fold lines or lines that contain only white space characters (blanks and/or tabs). Stedi will determine the current paragraph, eliminate all unnecessary blanks, rewrap the paragraph (obeying the auto-indent rules) and then insert extra blanks to make the right edge of the text look nice. There is a limit to the number of blanks inserted. This second rewrap is nice if the text typed has to be printed directly on a line printer. Note however that its definition of a paragraph is different from the definition for the other type of rewrap and that the `soft linefeeds' get destroyed.