Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!auspex!hitz From: hitz@auspex.auspex.com (Dave Hitz) Newsgroups: comp.editors Subject: Re: Vi Turing machine question Keywords: vi Message-ID: <2286@auspex.auspex.com> Date: 25 Jul 89 18:14:07 GMT References: <1570@agora.UUCP> Reply-To: hitz@auspex.auspex.com (Dave Hitz) Organization: Auspex Systems, Santa Clara Lines: 40 In article <1570@agora.UUCP> rickc@agora.UUCP (Rick Coates) writes: > > >First, I thought that the Turing machine simulation in vi is clever - >a real tour de force. > >When I tried it on MKS vi (I would give you a version number if their >documentation gave one), however, it bombed. Upon investigation, >it is the > >map k ^V|D > >(where ^V is the control V character) >line that is causing trouble. Then, I tried it from inside unix vi (instead >of :so). No luck. Even with 'remap' set, unix vi gives the message I >got from MKS - 'missing rhs'. > >What gives here? >...!tektronix!reed!percival!agora!rickc What the "k" map does is clear the current line. The '|' key with no arguments moves to the beginning of the current line, and 'D' clears the rest of the line. However, in ex mode, the '|' character is a command seperator, so to get it into the map itself, I quote it with ^V. Since MKS vi is complaining that there is no right hand side of the macro, it sounds like it didn't handle the quoting correctly, and interpreted the '|' as the end of the map. The TM macros are very senstive to the exact behavior of vi. In fact, they rely on a number of bugs in vi. I've been amazed that they run on all UNIX derived versions of vi that I've used, but not surprised that a new implementation of vi would break with them. Why don't you send MKS the macros and tell them their vi just isn't up to snuff if it can't run them? -- Dave Hitz home: 408-739-7116 UUCP: {uunet,mips,sun,bridge2}!auspex!hitz play: 408-970-8970