summaryrefslogtreecommitdiff
path: root/lisp/=gosmacs.el
diff options
context:
space:
mode:
authorEric S. Raymond <esr@snark.thyrsus.com>1993-03-27 01:58:20 +0000
committerEric S. Raymond <esr@snark.thyrsus.com>1993-03-27 01:58:20 +0000
commit3783b1701b57b1adf35cf2e6e294e79f5d16be02 (patch)
tree73f667eea24f9ea235ec69adb34a6d1ac29118d5 /lisp/=gosmacs.el
parent3fcff24c4462af0a133820649c532f4d49a700e5 (diff)
downloademacs-3783b1701b57b1adf35cf2e6e294e79f5d16be02.tar.gz
(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.
Diffstat (limited to 'lisp/=gosmacs.el')
-rw-r--r--lisp/=gosmacs.el19
1 files changed, 18 insertions, 1 deletions
diff --git a/lisp/=gosmacs.el b/lisp/=gosmacs.el
index 93bbbaa5b80..359ea1cc344 100644
--- a/lisp/=gosmacs.el
+++ b/lisp/=gosmacs.el
@@ -46,7 +46,7 @@ Use \\[set-gnu-bindings] to restore previous global bindings."
("\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 @@ From the window at the lower right corner, select the one at the upper left."
(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 <space> to undo more")
+ (let ((event 32))
+ (while (equal event 32)
+ (message "undoing..")
+ (undo-more 1)
+ (message "Hit <space> to undo more")
+ (setq event (read-event)))
+ (message "Finished undoing.")
+ (if (not (equal event 27))
+ (setq unread-command-event event))))
+
;;; gosmacs.el ends here