Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!think!barmar From: barmar@think.COM (Barry Margolin) Newsgroups: comp.emacs Subject: Keyboard macros Turing-equivalent (was Re: Copy From Above?) Message-ID: <36460@think.UUCP> Date: 16 Feb 89 19:10:05 GMT References: <690026@hpsemc.HP.COM> <36077@bbn.COM> Sender: news@think.UUCP Reply-To: barmar@kulla.think.com.UUCP (Barry Margolin) Organization: Thinking Machines Corporation, Cambridge, MA Lines: 31 In article <36077@bbn.COM> mesard@BBN.COM (Wayne Mesard) writes: >[[Hypothesis of the day: It is possible to build an arbitrarily complex >Turing machine using Emacs keyboard macros :-) ]] > >[[Followups refuting the previous sentence (after all its got a >net.insurance.policy (i.e. a smiley)), or showing a way to do the macro >in only six keystrokes to /dev/null.]] I hope this doesn't count as a refutation... I don't think GNU Emacs keyboard macros are Turing-equivalent, but I think Gosling Emacs may have been. The major missing feature in most Emacs keyboard macros is a decent conditional. You can loop a user-specified number of times (using a numeric argument), and you can ask the user whether to continue (c-x q -- kbd-macro-query), but there is usually no built-in way for a keyboard macro to make decisions on its own (I don't count using m-esc (eval-expression), since the point is to NOT resort to Lisp, and for a similar reason m-! is not allowed). Gosling Emacs, on the other hand, had a whole bunch of commands that existed solely to provide control structure in macros. The only ones I remember specifically were c-x { and c-x } (although I may have the prefix wrong), which began and ended blocks of commands (so you didn't have to use nested keyboard macros whenever you wanted to group things). Barry Margolin Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar