Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site umcp-cs.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!ihnp4!qantel!dual!lll-crg!gymble!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.emacs Subject: Termcap insert mode (was Re: Gnu Emacs on Suns/redisplay) Message-ID: <1830@umcp-cs.UUCP> Date: Sat, 12-Oct-85 19:54:13 EDT Article-I.D.: umcp-cs.1830 Posted: Sat Oct 12 19:54:13 1985 Date-Received: Mon, 14-Oct-85 05:35:59 EDT References: <2766@sun.uucp> <1324@teddy.UUCP> <301@log-hb.UUCP> <1354@teddy.UUCP> <2630@pegasus.UUCP> Distribution: net Organization: U of Maryland, Computer Science Dept., College Park, MD Lines: 55 >< From the list of capabilities from Termcap(5) BSD4.2 (it is the same on >< Sun Version 2, also): >< >< ei str End insert mode; give ":ei=:" if ic >< im str Insert mode (enter); give ":im=:" if ic >< > Actually, in this case I've always considered the termcap manual > page to be plain wrong. Current usage of both termcap and terminfo, > in curses, for example, assumes that ei and im are only defined if > they really have some meaning. The same statement can be made for > all string variables. > Tony Hansen You are, I believe, speaking of System V; so this may not apply there. Under 4BSD, however, the manual entry is correct, if cryptic. The code in `vi' runs approximately like this: imstr = tgetstr("im", &p); eistr = tgetstr("ei", &p); icstr = tgetstr("ic", &p); ipstr = tgetstr("ip", &p); . . . /* enter insert/append mode */ if (imstr != NULL && eistr != NULL) { /* * Terminal has insert capability, use it. */ tputs(imstr, ...); while ((c = getchar()) != ESCAPE) { if (icstr != NULL) tputs(icstr, ...); putchar(c); if (ipstr != NULL) tputs(ipstr, ...); } tputs(eistr, ...); } else { /* * No insert mode, fake it if redraw set. */ . . . } The `im' and `ei' capabilities *must be set*, even if they are set to the null string. If they are not set, vi will not send the `ic' and `ip' strings, though your terminal may need only those. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251) UUCP: seismo!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@mimsy.umd.edu