Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!seismo!lll-crg!lll-lcc!well!swalton
From: swalton@well.UUCP (Stephen R. Walton)
Newsgroups: comp.emacs
Subject: Re: Termcaps in Gnu Emacs
Message-ID: <2234@well.UUCP>
Date: Thu, 18-Dec-86 11:49:13 EST
Article-I.D.: well.2234
Posted: Thu Dec 18 11:49:13 1986
Date-Received: Fri, 19-Dec-86 00:12:45 EST
References: <658@cullvax.UUCP>
Reply-To: swalton@well.UUCP (Stephen R. Walton)
Organization: Whole Earth Lectronic Link, Sausalito CA
Lines: 33
Keywords: termcap GNU
Summary: Write your own and point TERMCAP at it

In article <658@cullvax.UUCP> drw@cullvax.UUCP (Dale Worley) writes:
>I would like to play with a termcap for a particular terminal.  I
>don't want to have to edit /etc/termcap to do this.  But it seems that
>Gnu Emacs (at least version 17) only looks at the TERM environment
>variable.  Could it be altered so that it uses TERMCAP environment
>variable if it is present, and if not, then the TERM variable?
>
this isn't quite true.  The logic is: check the TERMCAP environment
variable.  If it is set and the value does not begin with a slash (/),
assume it is a TERMCAP entry and see if it matches what is set in the
TERM variable.  If it is set and the name does begin with a slash, then
it is the name of the TERMCAP file.

My .login contains something like
	echo -n "Terminal? "
	set term=$<
	fgrep "$term|" ~/.termcap >/dev/null
	if ($status == 0) then
		setenv TERMCAP ~/.termcap
	else
		setenv TERMCAP /etc/termcap
	endif
	eval `tset -sQ`
which reads a line from stdin to get the terminal type, looks in my
personal termcap file (~/.termcap) for an entry with that name, sets
TERMCAP to point there if it finds it or to /etc/termcap if it
doesn't, then use tset to set the TERMCAP environment variable to the
actual entry for my terminal.  This last step isn't strictly necessary,
but speeds up access tremendously.
						Steve Walton
					ametek!walton@csvax.caltech.edu
					walton@caltech.bitnet
					...!seismo!cit-vax!ametek!walton