Don't treat input events as commands unless they're button events.
authorChris Hanson <org/chris-hanson/cph>
Thu, 23 Sep 1993 07:09:12 +0000 (07:09 +0000)
committerChris Hanson <org/chris-hanson/cph>
Thu, 23 Sep 1993 07:09:12 +0000 (07:09 +0000)
Even the latter case doesn't always want to be treated that way, but
there's no good way to figure out what the correct treatment is.

v7/src/edwin/comred.scm

index 0d3cf2207e7beffc29312fa193c6efa7ac36b2ca..2dc662c1416ab41524d6a11d56d27c6aae803987 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: comred.scm,v 1.106 1993/09/15 20:30:50 cph Exp $
+;;;    $Id: comred.scm,v 1.107 1993/09/23 07:09:12 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989-93 Massachusetts Institute of Technology
 ;;;
                   (if (queue-empty? command-reader-override-queue)
                       (let ((input (get-next-keyboard-char)))
                         (if (input-event? input)
-                            (apply-input-event input)
+                            (begin
+                              (apply-input-event input)
+                              (if (not (eq? 'BUTTON (input-event/type input)))
+                                  (preserve-command-state!)))
                             (begin
                               (set! *command-key* input)
                               (clear-message)
                                                      (window-point window))
                                  false)))))
                       ((dequeue! command-reader-override-queue)))))))))))))
-
+\f
 (define (bind-abort-editor-command thunk)
   (call-with-current-continuation
    (lambda (continuation)
     (if (not restart) (error "Missing ABORT-EDITOR-COMMAND restart."))
     (keyboard-macro-disable)
     (invoke-restart restart input)))
-\f
+
 (define (get-next-keyboard-char)
   (if *executing-keyboard-macro?*
       (begin
   (if *defining-keyboard-macro?*
       (keyboard-macro-finalize-keys)))
 
+(define (preserve-command-state!)
+  (set! *next-argument* *command-argument*)
+  (set! *next-message* *command-message*)
+  (set! *command* *last-command*)
+  unspecific)
+
 (define (override-next-command! override)
   (enqueue! command-reader-override-queue override))
-
+\f
 (define-integrable (current-command-key)
   *command-key*)