kehpager V1.2 - Charset aware pager for VTxxx terminals

     Look file COPYRIGHT to see your rights.

     Kehpager is a pager that displays the  contents  of  a  text
     file on the terminal, one screenful at a time. It translates
     file's charset to the terminal's charsets.  Too  long  lines
     are  wrapped in between words. Kehpager  can also interprete
     text/enriched and text/richtext -formatted text files.

     Text/enriched is a clarification, simplification and refine-
     ment  of  type  defined  as  text/richtext. Text/enriched is
     intended to make text/richtext obsolete.

     When kehpager starts, it tests if the terminal supports  8 -
     bit  characters  (see  also usage of options -e, -7 and -8).
     If the terminal supports 8-bit  characters,  kehpager  turns
     the  terminal  to  Multinational  mode.   Otherwise kehpager
     turns the terminal to National mode and use current national
     font  and  ASCII. National font is determined by asking key-
     board language from the terminal.  Kehpager  may  also  uses
     Special, Latin/1 and Technical fonts.

     Kehpager works on VT100, but VT300 is recommended.  Kehpager
     doesn't  work  with  emulators where character conversion is
     done for characters in line. Conversions should be done with
     respect     of    bank    assigments    (G0   -   G3)    and
     multinational/national -mode.

Kehpager knows following charsets:
	Latin/1                      ISO-8859-1
	Latin/2                      ISO-8859-2
	Latin/3                      ISO-8859-3
	Latin/4                      ISO-8859-4
	Latin/5                      ISO-8859-9
	Ascii                        US-ASCII
	MS-DOS CP437                 X-CP437			(*)
	Macintosh                    X-MAC
	Multinational                X-DEC-MCS
	Mnemonics encoding from RFC1345				(*)
	Unicode 1.1 with UTF-7       UNICODE-1-1-UTF7		(*)
	Unicode 1.1 with UTF-8       UNICODE-1-1-UTF8		(*)
	French Canadian national     X-ISO646-CA
	German national              X-ISO646-DE
	Finnish national             X-ISO646-FI
	French/Belgian national      X-ISO646-FR
	Italian national             X-ISO646-ITA
	Norwegian national           X-ISO646-NO
	Swedish national             X-ISO646-SE
	Spanish national             X-ISO646-SPA
	British national (UK-ASCII)  X-UK-ASCII

	(*) subset

So kehpager are still missings many charsets: 
	some national fonts (for support of national mode of terminal)
	some ISO 8859 fonts (for support of MIME)

All charsets aren't complete. Specially kehpager knows only
small subset from Unicode 1.1 and mnemonics encoding. 'Raw'
Unicode (ie. UCS-2 encoding) isn't supported. You can get list
of known characters with command 'kehpager -T3'.

You can get charset listing with command 'kehpager -cs'.

If you want add charsets, ask help from me (Kari.Hurtta@Helsinki.FI).
You can also check files charset.c and control.c (see 'sets' array).
If you add charsets to kehpager, I like to get diffs.

Severe limitation is, that kehpager requires that letters are written 
form left to right. This limitation is not easy lift. This affect at
least routines in control.c and formating machine (wrap_line) in
window.c.

Text/enriched commands:
	Bold		implemented
	Italic		implemented as command Underline
	Fixed		has no-op
	Smaller		NOT implemented
	Bigger		NOT implemented
	Underline	implemented
	Center		implemented
	FlushLeft	implemented
	FlushRight	implemented
	FlushBoth	implemented
	Indent		implemented
	IndentRight	implemented
	Excerpt		implemented 
	Verbatim	implemented
	Nofill		implemented (if I understood this)
	Param		implemented (but commands in param are still executed)
   - Enriched interpreter is stack based, so balancing rule must stricly be
	followed; unrecognized commands also must be balanced
   - By default justification of text is selectable (if input.full_justify
	is false, it is FlushLeft, else it is FlushBoth. 
	Default value is false)
   - FlushRight and Center changes semantic of TAB character

Installation
SunOS 4:
	Set correct value for use.keyboard.language -field in
		kehpager.init (you can also comment it out if your
		terminals is inteelligent enough). You probably also
	 want add
	   use.vt100.national_available: Enabled
	 to kehpager.init (this was default prior version 1.06).
	Copy kehpager.init to library direction
	Edit Makefile and put defination of GLOBAL_INIT_FILE
	  point correct location of kehpager.init
	  Also select correct compiler (gcc, or SUN's acc)
	  to Makefile.'s define.
	Compile it with
		make sunos4
	Copy kehpager and kehpager.1 to correct directories
SunOS 5:
	Set correct value for use.keyboard.language -field in
		kehpager.init (you can also comment it out if your
		terminals is intelligent enough). You probably also
	 want add
	   use.vt100.national_available: Enabled
	 to kehpager.init (this was default prior version 1.06).
	Copy kehpager.init to library direction
	Edit Makefile and put defination of GLOBAL_INIT_FILE
	  point correct location of kehpager.init
	  Also select correct compiler (gcc, or SUN's acc)
	  to Makefile.'s define.
	Compile it with
		make sunos5
	Copy kehpager and kehpager.1 to correct directories
HP-UX:
	Set correct value for use.keyboard.language -field in
		kehpager.int (you can also comment it out if your
		terminals is intelligent enough). You probably also
	 want add
	   use.vt100.national_available: Enabled
	 to kehpager.init.hpux (this was default prior version 1.06).
	Copy kehpager.init.hpux to library direction
	Edit Makefile.hpux and put defination of GLOBAL_INIT_FILE
	  point correct location of kehpager.init.hpux
	  Also select correct compiler (gcc, or HP's cc (ANSI C version))
	  to Makefile.hpux's define.
	Compile it with
		make -f Makefile.hpux
	Copy kehpager and kehpager.1 to correct directories
386BSD, FreeBSD, NetBSD: (I haven't tested this!)
	Set correct value for use.keyboard.language -field in
		kehpager.init (you can also comment it out if your
		terminals is intelligent enough). You probably also
	 want add
	   use.vt100.national_available: Enabled
	 to kehpager.init (this was default prior version 1.06).
	Copy kehpager.init to library direction
	Edit Makefile and put defination of GLOBAL_INIT_FILE
	  point correct location of kehpager.init
	Compile it with
		make -f Makefile.bsd
	Copy kehpager and kehpager.1 to correct directories
IRIX 4:
	(I get ENOTDEV error when closing terminal, so there is still
	 some problems...)
	Set correct value for use.keyboard.language -field in
		kehpager.init (you can also comment it out if your
		terminals is intelligent enough). You probably also
	 want add
	   use.vt100.national_available: Enabled
	 to kehpager.init (this was default prior version 1.06).
	Copy kehpager.init to library direction
	Edit Makefile and put defination of GLOBAL_INIT_FILE
	  point correct location of kehpager.init
	Compile it with
		make -f Makefile.irix
	Copy kehpager and kehpager.1 to correct directories. If you don't
		hace troff or groff, ask someone to compile kehpager.1


Tested platforms:
	Kehpager works on SunOS 4.1.2 (OS/MP 4.1B), 4.1.3, 5.2, 5.3, 
	HP-UX A.09.01, IRIX 4.0.5 (at least some way).

Compiler:
	Kehpager is compiled with gcc in SunOS 4.1.2, 5.2, 5.3
	In HP-UX it is compiled with cc (ANSI C version).
		(notice that ANSI C version of cc isn't bundled with HP-UX)
	In SunOS 4.1.3 it is compiled with acc.
	In IRIX 4.0.5 it is compiled with cc (in -xansi mode).
	Kehpager compiles without error or warning messages 
		(with gcc's -Wall in SunOs 5.2. Also HP's cc
		 don't give any warnigs even that it is more strict than
		 gcc).

Changes to version 1.1:
	Terminal output is buffered
	New options: -sp, -sp+, -j, -j+, -st, -st+, -rt, -tn, -in,
		-erc, -pm, -pm+, --, -rs, -rs+, -IT, -MN, -MN:n, 
		-U7, -U8
	Option processing is disabable now ('option' --)
 	Composed input for HORN, RING BELOW, LINE BELOW and CIRCUMFLEX BELOW
	Initfile fields: keyboard.toggle_eatspc, input.eat_spaces,
		input.full_justify, keyboard.toggle_time, input.tab_step,
		input.indent_step, keyboard.toggle_pagemode, input.pagemode,
		keyboard.tab_step,keyboard.tab_step.self_insert,
		keyboard.tab_step.enter, keyboard.indent_step,
		keyboard.indent_step.self_insert, keyboard.indent_step.enter, 
		env.size, exit.newline, use.query_size
	charsets: Italian, Mnemonics encoding, 
		more characters from MS-DOS CP437, 
	        Unicode 1.1 with UTF-7 and UTF-8 encodings. 
	        (No support for Unicode decomposition/composition)
	Handling of pagebreaks (FF, richtext's <np>)
	Text/Enriched is better
	Screen updating is better in some situtations 
		(specially SEARCH: -prompt works nicer)
        Updated Text/Enriched according RFC1563 (previous version
                  of enriched specification was RFC1523):
                  - Added FlushBoth environment
                  - Now Text/Enriched allows initial state justification 
                    to be any of FlushLeft, FlushRight or FlushBoth (in 
                    RFC1523 it was FlushBoth ie. fully justified). 
                  > Because kehpager heve difficulties with fully justified
                    text (kehpager may print justified text twise), I changed
                    default state to be FlushLeft. That is: default value
                    of input.full_justify is now false.
	Content-type: text/richtext 
	Compiles with Sun's acc (on SunOS 4) and IRIX's cc
	Many bug fixes
	Support for rc -shell, now $SHELL is matched agaist to table
        Added some changes posted by 
            Jrg Wunsch <joerg_wunsch@tcd-dresden.de> so this propably
            compiles on 386BSD, FreeBSD and NetBSD
        $LINES overdrives use.terminal.lines and $COLUMNS overdrives
                 use.terminal.columns (if env.size is set)
 	I marked VT500 as unsupported, because I don't have seen manuals yet.
        Now kehpager asks terminal size from terminal itself (as
                  'resize' does it). Disable with -rs or 
                  use.query_size: Disabled
        Now esc.c don't eat nulls and binding to Ctrl-space 
		(ie. NUL) is possible

Changes to version 1.14:
                Avoid unnecessary redrawing of window when remapped by setting
                  windows priority temporary to zero (so now SEARCH: -prompt
                  works little nicer)
                Support for Unicode 1.1 with UTF-7 and UTF-8 encodings. 
                  Only small part of Unicode is supported. No support for
                  Unicode decomposition/composition.
                Options: -U7, -U8
                MAP_RFC134 replaced with MAP_UNICODE11
                MAP_UTF7, MAP_UTF8
                Now internal characters are type CHAR_IDX
                Latin/3 213 fixed
                  from LATIN CAPITAL LETTER O WITH DOT ABOVE
                  to LATIN CAPITAL LETTER G WITH DOT ABOVE
                Latin/4 241 fixed
                  from LATIN SMALL LETTER N WITH OGONEK
                  to LATIN SMALL LETTER N WITH CEDILLA
                Latin/4 209 fixed
                  from LATIN CAPITAL LETTER N WITH OGONEK
                  to LATIN CAPITAL LETTER N WITH CEDILLA

Thanks to: 
	Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de>
	Tim Lasko <lasko@regent.enet.dec.com>
	David E A Wilson <david@cs.uow.edu.au>
	Jrg Wunsch <joerg_wunsch@tcd-dresden.de>
