emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/type-break.el,v


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lisp/type-break.el,v
Date: Tue, 30 Jan 2007 19:36:41 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      07/01/30 19:36:41

Index: type-break.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/type-break.el,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- type-break.el       21 Jan 2007 03:53:10 -0000      1.43
+++ type-break.el       30 Jan 2007 19:36:41 -0000      1.44
@@ -1120,6 +1120,13 @@
 
 ;;; Demo wrappers
 
+(defun type-break-catch-up-event ()
+  ;; If the last input event is a down-event, read and discard the
+  ;; corresponding up-event too, to avoid triggering another prompt.
+  (and (eventp last-input-event)
+       (memq 'down (event-modifiers last-input-event))
+       (read-event)))
+
 ;; This is a wrapper around hanoi that calls it with an arg large enough to
 ;; make the largest discs possible that will fit in the window.
 ;; Also, clean up the *Hanoi* buffer after we're done.
@@ -1132,9 +1139,11 @@
         (hanoi (/ (window-width) 8))
         ;; Wait for user to come back.
         (read-event)
+       (type-break-catch-up-event)
         (kill-buffer "*Hanoi*"))
     (quit
      (read-event)
+     (type-break-catch-up-event)
      (and (get-buffer "*Hanoi*")
           (kill-buffer "*Hanoi*")))))
 
@@ -1153,12 +1162,14 @@
             (life 3)
             ;; wait for user to return
             (read-event)
+           (type-break-catch-up-event)
             (kill-buffer "*Life*"))
         (life-extinct
          (message "%s" (get 'life-extinct 'error-message))
          ;; restart demo
          (setq continue t))
         (quit
+        (type-break-catch-up-event)
          (and (get-buffer "*Life*")
               (kill-buffer "*Life*")))))))
 
@@ -1245,6 +1256,7 @@
             (goto-char (point-min))
             (sit-for 60))
           (read-event)
+         (type-break-catch-up-event)
           (kill-buffer buffer-name))
       (quit
        (and (get-buffer buffer-name)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]