Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!hpda!hpsemc!bd From: bd@hpsemc.HP.COM (bob desinger) Newsgroups: comp.emacs Subject: Re: undo Message-ID: <690011@hpsemc.HP.COM> Date: 22 Apr 88 16:03:28 GMT References: <282@litp.UUCP> Organization: HP SEMC, Cupertino, CA Lines: 11 Francois-Xavier Testard-Vaillant (fxtv@litp.UUCP) writes: > I would appreciate help about the undo mechanism of editors such as > emacs. What are the basic tools used to implement this? Are they > efficient? For GNU Emacs, see dist-*/src/undo.c and dist-*/src/undo.h. The code there uses structs, so it's somewhat hairy. It copies data using the extremely fast bcopy() routine, so it's quite efficient. (Remember that premature optimization is the root of all evil---don't make it fast before you make it right.) -- bd