[comp.emacs] Undo

fxtv@geocub.UUCP (Vaillant) (04/15/88)

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? 

Francois-Xavier Testard-Vaillant
UUCP: uunet!mcvax!inria!fxtv

bd@hpsemc.HP.COM (bob desinger) (04/22/88)

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

tmoody@sjuphil.uucp (T. Moody) (05/22/91)

Is there any PC-based version of emacs that has Undo?  My own view is
that an editor that supports regular expression search and replace needs
to have undo, since reg. exps. make it possible to screw up files in
ways that are not readily reversible manually.  I know that Micro-emacs
does not (yet) have undo, but I don't know about the latest version of
Freemacs, and I've never seen Jove.
-- 
Todd Moody * tmoody@sjuphil.sju.edu
            "In what furnace was thy brain?"  -- William Blake