The CR in a map via .exrc: A new question

Chris Torek chris at mimsy.UUCP
Sun Mar 27 13:32:55 AEST 1988


In article <1598 at ogcvax.UUCP> schaefer at ogcvax.UUCP (Barton E. Schaefer) writes:
>I suppose it had to happen eventually.  I've been able to figure out
>solutions for nearly all the vi map problems posted here, but the one I
>tried today has got me stumped.  Does anybody know how to include a
>control-D character in a map or map! in a ".exrc" file?

Looking at the source, the answer I find is that it cannot be done.
The culprit is the `getchar' routine, which reads (in part)

	do
		c = getcd();
	while (!globp && c == CTRL('d'));

Probably a minimal change to fix it would be

	do
		c = getcd();
	while (!globp && intty && c == CTRL('d'));

(see /usr/src/ucb/ex/ex_get.c and /usr/src/ucb/ex/ex_io.c.)  `map' and
`map!' in ex mode would still fail, but :map and :map! in open or
visual would continue to work (those work by stuffing the command into
a buffer and making globp point at it).
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.questions mailing list