[mcclim-cvs] CVS mcclim/Drei

thenriksen thenriksen at common-lisp.net
Wed Jan 23 10:16:26 UTC 2008


Update of /project/mcclim/cvsroot/mcclim/Drei
In directory clnet:/tmp/cvs-serv6127/Drei

Modified Files:
	input-editor.lisp 
Log Message:
I decided that input-editing was too simple, so I added some more incomprehensible complexity.

This should ensure commercial CLIM never copies code from us.

Incidentally, also fixes prompting semantics, probably broke something else though.


--- /project/mcclim/cvsroot/mcclim/Drei/input-editor.lisp	2008/01/19 09:38:20	1.23
+++ /project/mcclim/cvsroot/mcclim/Drei/input-editor.lisp	2008/01/23 10:16:25	1.24
@@ -155,8 +155,7 @@
   ;; already at the input position or if we are rescanning. This is so
   ;; we can support fancy accept methods such as the one for
   ;; `command-or-form'
-  (unless (or (stream-rescanning-p stream)
-              (= (stream-scan-pointer stream) (input-position stream)))
+  (unless (stream-rescanning-p stream)
     (call-next-method)
     ;; We skip ahead of any noise strings to put us past the
     ;; prompt. This is safe, because the noise strings are to be
@@ -478,7 +477,8 @@
     (with-accessors ((insertion-pointer stream-insertion-pointer)
                      (scan-pointer stream-scan-pointer)
                      (activation-gesture activation-gesture)) stream
-      (let ((buffer (buffer (view (drei-instance stream)))))
+      (let ((buffer (buffer (view (drei-instance stream))))
+            (last-was-noisy nil)) ; T if last passed gesture is noise-string
         (loop
            (loop
               while (< scan-pointer insertion-pointer)
@@ -486,7 +486,8 @@
               do (let ((gesture (buffer-object buffer scan-pointer)))
                    ;; Skip noise strings.
                    (cond ((typep gesture 'noise-string)
-                          (incf scan-pointer))
+                          (incf scan-pointer)
+                          (setf last-was-noisy t))
                          ((and (not peek-p)
                                (typep gesture 'accept-result))
                           (incf scan-pointer)
@@ -512,8 +513,10 @@
                           (unless peek-p
                             (incf scan-pointer))
                           (return-from stream-read-gesture gesture))
-                         (t (incf scan-pointer)))))
-           (setf (stream-rescanning stream) nil)
+                         (t (incf scan-pointer)
+                            (setf last-was-noisy nil)))))
+           (unless last-was-noisy ; This prevents double-prompting.
+             (setf (stream-rescanning stream) nil))
            (when activation-gesture
              (return-from stream-read-gesture
                (prog1 activation-gesture




More information about the Mcclim-cvs mailing list