tty-format

Homepage: http://www.geocities.com/user42_kevin/tty-format/index.html

Author: Kevin Ryde

Updated:

Summary

Text file backspacing and ANSI SGR as faces

Commentary

This is two additions to `format-alist' for decoding

   * ANSI SGR escape sequences "Esc [ ... m" colours, bold, underline,
     etc (through ansi-color.el).

   * Backspace overstriking for bold, underline, overline, and a bullet
     character "+ backspace o".

Such sequences are tty or line printer oriented controls, but can be
found in text files.  The aim is to make those files viewable and
hopefully have the attributes successfully copy into something like
`enriched-mode'.

There's no automatic detection of these formats, but see
`tty-format-guess' below for an idea to notice text files using them.

Groff produces output like this (via grotty), and some of its manuals use
both ANSI and backspacing as do various other packages with text files
produced from roff input.  You'd like to think the backspacing by now
would be as dead as the line printers it was made for, but grotty still
gets creative with it.

Groff in fact has lots of character overstrike sequences to make ink
resembling non-ascii characters.  There's far too many to want the code
here to handle them all; you're much better off asking groff for extended
charset output in the first place, instead of decoding bizarre
combinations after the fact.  So the aim here is only to handle bits
found in real life documents.  One moderately frequent bit not yet
supported is | plus = for a footnote dagger.

Dependencies