Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!ctrsol!ginosko!uunet!auspex!hitz From: hitz@auspex.auspex.com (Dave Hitz) Newsgroups: comp.editors Subject: Re: vi Turing machine, once again Message-ID: <2309@auspex.auspex.com> Date: 29 Jul 89 18:18:49 GMT References: <18904@unix.cis.pittsburgh.edu> Reply-To: hitz@auspex.auspex.com (Dave Hitz) Distribution: na Organization: Auspex Systems, Santa Clara Lines: 57 In article <18904@unix.cis.pittsburgh.edu> dcarson@unix.cis.pittsburgh.edu (David Carson) writes: > I, too, have had problems getting the Turing machine > simulation to work. > > [...] > > The ":so tm2" succeeds this time, but when I type "g" I get the first > few movements, followed by the error message: "can't put inside a > global/macro". Vi wants undo to work for macros. Unfortunately, vi's undo is very simple. Rather than allow complex macros to break undo, vi disallows complex macros. I believe this is a *big* mistake. I'd much rather give up undo than powerful macros. Fortunately (for those who want real macros), the code that figures out whether a macro will break undo is *very* broken. For instance, throwing in an "mx" (mark location x) at the front of the rhs of a macro often calms vi down. For some reason, this sends vi through an alternate path on which the macro checking is not as strict. Likewise, breaking a single macro into multiple macros that call each other can also fool vi. In the turing machine code I define: map X "bY and then use: 1GkwEX@b instead of 1GkwE"bY@b Using "bY directly doesn't work, but (on most systems anyway), using the macro X does. If it weren't for these bugs I'm exploiting, I would have written the entire turning machine as a single macro. Each of the TM's 20 macros indicate another place where the code wouldn't run inline, but worked as a sub-macro. So what does it mean that you got the "can't put inside a global/macro" message? Probably it means that your UNIX vendor "fixed" vi to recognize that a yank can break undo, even if it's in a called macro. So rise up. Tell your UNIX vendor that you're tired of being coddled like an MS-DOS user! If you intended to undo that macro, you wouldn't have executed it in the first place. Don't let meddling johny-come-lately UNIX vendors destroy the venerable fuck-the-user tradition that has made UNIX great. Make them put it back the way it was. -- Dave Hitz home: 408-739-7116 UUCP: {uunet,mips,sun,bridge2}!auspex!hitz play: 408-970-8970