Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!genrad!wjh12!n44a!ima!cca!editor-p From: editor-p@cca.UUCP Newsgroups: fa.editor-p Subject: Undo/Redo Message-ID: <4800@cca.UUCP> Date: Fri, 3-Jun-83 04:37:55 EDT Article-I.D.: cca.4800 Posted: Fri Jun 3 04:37:55 1983 Date-Received: Mon, 6-Jun-83 17:44:14 EDT Lines: 46 >From Laws@SRI-AI Fri Jun 3 04:37:48 1983 I am as fallible as anyone, and I have been known to make mode errors. This is true even in EMACS, where I habitually forget to escape from incremental search mode after finding my target. If one types control sequences while in text mode, there is currently little that can be done except to erase and start over. Someday editors will allow you to execute commands directly from the text buffer, thus letting you recover with minimal trouble. (I think the Mainsail editor may have this capability.) Even simpler for the user would be a command that parses back through the current insertion to find the intended command, erases it from the text, and executes it. Surely this isn't too difficult. If one types text while in control mode, all hell can break loose. EMACS makes this almost impossible because one wouldn't type text while holding control keys. VI also protects the user since the text has no effect until a return is entered, at which time very few text strings can be parsed as valid commands. Any garbage which happens to be executable can be undone with a single "u" command. (A stack of killed text segments is also kept, but it is almost never needed for recovery from mode errors.) This undo command is exceedingly useful. I could not be happy in any editor that lacked it. This is one of my chief gripes about EMACS, although I don't think it has come up in this discussion before. EMACS keeps most deleted text around, but you cannot recover single characters that you have deleted and you cannot recover from arbitrary text transformations (e.g., accidentally invoking region fill). My (nonmode) errors in EMACS tend to be very serious, forcing me to save my work often so that I can recover by restoring the entire file. I do not have this problem in VI, and I feel more free to experiment with commands that might have unknown effects. In anthropomorphic terms, I feel that EMACS is just waiting to trap me, whereas VI is doing its best to be helpful. One more point on the subject of redo/undo: VI offers the "." command for "redo the previous command". This is one of my most used editing commands. (It is in addition to macro definition, which is helpful but much less necessary in VI than in EMACS.) I sorely miss a redo command in EMACS, and suggest that one be added. On the other side, VI could use a "real-time" macro definition facility such as the EMACS keyboard macro. -- Ken Laws -------