# HG changeset patch # User Eric S. Raymond # Date 733197500 0 # Node ID 9721e0530cd97be78e28717f8e5bbca200038427 # Parent f7a3795bd1c50a1da031b7951a35c8a1598a7e72 (undo-with-space) Added. C-x C-u now bound to this rather than undo. This change was inspired by the LCD package undo-with-space by Thomas Narten, but my code is simpler and uses the 19 event features. diff -r f7a3795bd1c5 -r 9721e0530cd9 lisp/=gosmacs.el --- a/lisp/=gosmacs.el Sat Mar 27 01:58:16 1993 +0000 +++ b/lisp/=gosmacs.el Sat Mar 27 01:58:20 1993 +0000 @@ -46,7 +46,7 @@ ("\C-x\C-n" next-error) ("\C-x\C-o" switch-to-buffer) ("\C-x\C-r" insert-file) - ("\C-x\C-u" undo) + ("\C-x\C-u" undo-with-space) ("\C-x\C-v" find-file-other-window) ("\C-x\C-z" shrink-window) ("\C-x!" shell-command) @@ -114,4 +114,21 @@ (interactive) (recenter 0)) +(defun undo-with-space () + "Enter an undo loop that continues while you type SPC characters. Exit +with ESC; any other character exits and begins a new command." + (interactive) + (undo-start) + (undo-more 1) + (message "Hit to undo more") + (let ((event 32)) + (while (equal event 32) + (message "undoing..") + (undo-more 1) + (message "Hit to undo more") + (setq event (read-event))) + (message "Finished undoing.") + (if (not (equal event 27)) + (setq unread-command-event event)))) + ;;; gosmacs.el ends here