[fa.info-vax] Automatic TERM initialization

info-vax (12/22/82)

>From decvax!idis!mi-cec!dvk@Berkeley  Tue Dec 21 23:52:39 1982
Received: by UCBVAX.BERKELEY.ARPA (3.227 [10/22/82])
	id A13678; 21-Dec-82 23:53:15-PST (Tue)
Mail-From: ARPANET host SANDIA rcvd at 21-Dec-82 1105-PST
Mail-From: ARPANET site MIT-AI rcvd at 21-Dec-82 1208-MST
To: idis!decvax!ucbvax!info-vax@Berkeley
In-Real-Life: Dan Klein, Mellon Institute, Pittsburgh
Phone-Number: (412) 578-3382
Remailed-Date: 21 Dec 1982 1730-PST
Remailed-From: the tty of Geoffrey S. Goodfellow  <Geoff5 at SRI-CSL>
Remailed-To: Info-VAX@SRI-CSL: ;

For those of you who use EMACS (or VI, under Eunice), here is a handy command
file to initialize the environment variable (logical name) TERM to your
terminal type. It reads the Eunice file ETC:TTYTYPE., but you can call it what
you will if you don't run Eunice. The entries are (on a line by line basis)

ttynn termtype

where termtype is the name Emacs expects (vt100, fox, concept, ...). This file
should be called from your LOGIN.COM, but we have it in SYSLOGIN.COM.

		-Dan Klein, Mellon Institute, Pittsburgh
==============================================================================
$!****************TERMINIT.COM**********************
$!
$ If "''F$Mode()'" .eqs. "BATCH" then Exit
$ Open/Error=No_File TTYType ETC:TTYTYPE.
$Loop:
$ Read/End_Of_File=Not_Legal/Error=Bogus_File TTYType TypePair
$ PairLength = 'F$Length(TypePair)'
$ Space = 'F$Locate(" ",TypePair)'
$ Mark = 'Space' + 1
$ TermLength = 'PairLength' - 'Space'
$ If 'Space' .eq. 'PairLength' Then Goto Bogus_File
$ TypeString := "''F$Extract(0,Space,TypePair)'"
$ TermString := 'F$Extract(Mark,TermLength,TypePair)'
$ If "''F$Logical(TermString)'" .nes. "''F$Logical(""TT"")'" then Goto Loop
$ Define TERM "''TypeString'"
$ Close TTYType
$ Exit
$Bogus_File:
$	Write SYS$OUTPUT "Bogus entry in ETC:TTYTYPE - ""''TypePair'"""
$Not_Legal:
$	Write SYS$OUTPUT "Can't find your terminal type!"
$	Close TTYType
$	Exit
$No_File:
$	Write SYS$OUTPUT "Can't find ETC:TTYTYPE!
$	Close TTYType
$	Exit
$