# txt(9)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## SYNOPSIS

txt, doc - Plain text document file

## FILES

hkdoc.emf - Plain text hook definition

## EXTENSIONS

.txt - ASCII plain text file
.doc - ASCII plain text document file

## DESCRIPTION

The doc file type template handles the hilighting and text formating of a plain text file. Within the text document justification and word wrapping are typically enabled. The template allows the user to format text as left, right, center or no justification.

Auto Layout

The automatic layout of the text is restricted to justification and wrapping and the detection of bulleted lists. fill-bullet(5) may be used to determine the character set used for bullet points, on encountering a bullet the left-hand justification might be modified.

Formatting rules

The default mode of operation is automatic mode which attempts to retain the document style whenever a paragraph is re-formatted. This allows rapid entry of text into a reasonable format with no special formating character embedded in the text.

The automatic formatting rules used by fill-paragraph(2) in an automatic text mode are defined as follows:-

Text on column 0

Text appearing in the first column is always assumed to be left justified, and non-wrapping, provided that the text does not extend to the buffer fill column. This is typically used for headers and addresses.

Text on right edge

Text ending at the right edge (the $buffer-fill-col(5)), which commences from more that 50% of the page width is assumed to be right justified, non-wrapping. Typically used for addresses.

Text centered

Text which is centered on the page is assumed to be centered, this is non-wrapping.

Indented

All other text, not covered by the cases above is assumed to be available for filling. In this case the text is filled by the paragraph and left/right justification is applied, the fill default may be changed with $buffer-fill-mode(5) and changed with buffer-setup(3).

Short Cuts

The short cut keys used within the buffer are:-

C-c C-h - Help information on current mode.
C-c C-s - Spell the buffer.
C-c C-b - Fill both; perform left and right justification on the margins.
C-c C-b - Fill center; center the text on the current line.
C-c C-l - Fill left; fill the text on the paragraph (ragged right edge).
C-c C-r - Fill right; place text on right margin.
C-c C-o - Reduce a paragraph to a single line.
C-c a - Move to automatic formatting mode (default).
C-c l - Change mode to left formating
C-c r - Change mode to right formating
C-c r - Change mode to both formating
C-c c - Change mode to center formating
C-c n - Change mode to no formating

## NOTES

To move text to a word processor then it is advised that all paragraphs are reduced to single lines, leading white space should be deleted (any possibly blank lines) and then import to the word processor. This saves considerable time as the word processor styles may be applied without handling spaces and band end of line characters.

## MAGIC STRINGS

-!- document -!-

MicroEmacs specific tag, recognizes the file as a plain text document. No hilighting of the document is performed.

-!- document; sectioned -!-

MicroEmacs specific tag, recognizes the file as a document that contains sections. A crude section hilighting is enabled as follows:-

Lines commencing with > are assumed to be comments, typically used at the head of the document .

    > -!- document; sectioned -!-
    >
    > Author:       My Self
    > Created:      11/11/97
    > Modified:     <211197.1003>
    > Location:     /xx/yy/zz.doc

All lines commencing with start (`*`) are assumed to be bullet lists. Bullet is hilighted.

All lines commencing with `[a-zA-Z])` or `[0-9])` are assumed to be minor sections. The section number is hilighted. e.g.:

    a) text
    1) text

All text in single or double quotes is hilighted, assumed to be literal text. and are hilighted i.e. This is a "double quote" or 'a' single quote.

Lines commencing with underscore (`_`) are hilighted to the end. typically used as demarcation breaks or for section underlining

-!- Document; pseudo-code -!-

The document contains pseudo code, and the pseudo code is hilighted. The pseudo-code tokens are defined as follows:-

// introduces a comment to the end of the line.

Command words comprise:-

`BEGIN`, `BREAK`, `CASE`, `CLEAR`, `CONTINUE`, `DO`, `DONE`, `ELIF`, `ELSE`, `END`, `ENDIF`, `FOR`, `FUNCTION`, `GOTO`, `IF`, `ONEVENT`, `ONINTERRUPT`, `PROCEDURE`, `REPEAT`, `RETURN`, `SET`, `SWITCH`, `THEN`, `TO`, `UNTIL`, `WHILE`,

Pseudo logical operators include

`AND`, `FALSE`, `MOD`, `NOT`, `OR`, `TRUE`, `XOR`,

-!- document; sectioned; pseudo-code -!-

A combination of both of the above.

## BUGS

The automatic mode sometimes mistakes an indented paragraph for a centered paragraph. This only typically occurs when the first line of the paragraph is not filled to the right. When the formatting error occurs, simply pad the line out so that it extends past the fill column and re-apply the formatting.

Unfortunately there is nothing that can be done to alleviate this problem, but it occurs infrequently.

## SEE ALSO

$buffer-fill-col(5), $buffer-fill-mode(5), $fill-col(5), $fill-mode(5), buffer-setup(3), fill-paragraph(2), spell-buffer(3).

Supported File Types

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>