Tabbing, expanding, trimming

The other three commands are rather similar in nature, so they are treated together.

tab[r][f]
This command replaces as many blanks as possible by tabs without changing the screen appearance of the file. For program files that use deep indentations, this may save 30 to 40 percent in file space when the file is written. This operation is called `tabbing'.
te[r][f]
This command replaces all tabs by as many spaces as needed without changing the screen appearance of the file. The name of this command is `tab expand' or `detabbing'.
tt[r][f]
This command removes all unnecessary blanks. Blanks are considered superfluous if they occur inside the range of a tab or at the end of a line. Also tabs at the end of a line are removed. This operation is called `trimming'.
These command operate on the whole file, unless the optional parameter r is specified. If this parameter is used, the range of action is the set of whole lines from the mark to the cursor, including both the line with the mark and the line with the cursor. The order of the mark and the cursor is unimportant. If the parameter f isn't specified the first three characters of potential opening and closing fold lines should not be treated by the tabbing, detabbing or trimming routines. When the f is specified also those positions will be treated. Thereby these lines may loose their folding properties.

The expansion of the tabs in a file may make the file much longer. Occasionally this will exhaust the memory that is available. The editor will then attempt a garbage collection to make more space available. In case this is not sufficient the editor will give the message that there is not enough memory and leave its job unfinished. If there are files in other buffers or in the undo buffer one could remove those and continue the expansion of the tabs. If this is either not possible, or does not free enough memory the expansion can still be executed by writing the contents of the buffer to a file, using the printer mode (p. [*]), although in that case the file will no longer fit in the editor.

If you are in doubt as to where tabs and blanks are in your file, and where no characters are at all, you may use the Alt-T command. This command toggles between a special mode in which all characters on the screen have a unique representation and one in which all `white characters' look alike. In particular, in the special mode blanks appear as small hollow circles in a superscripted position, tabs appear as small filled circles also in a superscripted position, and places at which no character at all resides remain blank. The other character that is seen as a `white character' in the normal representation is an ASCII null character. In the special representation, this character is given the appearance of a small filled circle in a subscripted position. In some computer fonts the character indicated by the hexadecimal code FF (255 in decimal) is also represented as a blank. In the Alt-T mode this character is represented as a colon.