When doing completing prompt with REQUIRE-MATCH? set true, delay
authorChris Hanson <org/chris-hanson/cph>
Mon, 24 Apr 1995 01:10:07 +0000 (01:10 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 24 Apr 1995 01:10:07 +0000 (01:10 +0000)
running completion procedure on final value.  First try VERIFY-MATCH?
procedure, and if it succeeds, don't do any completion.  This
shouldn't change the behavior since VERIFY-MATCH? must be run anyway,
and if the result is already a match, completion does nothing.

This is helpful when the completion procedure is expensive but
VERIFY-MATCH? is relatively cheap.

v7/src/edwin/prompt.scm

index 0b179e3a241500523e0b1576938cc428615aa871..5fc6530172b5ca0b54628c0f56a891f4cd61a095 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: prompt.scm,v 1.164 1995/04/10 16:48:34 cph Exp $
+;;;    $Id: prompt.scm,v 1.165 1995/04/24 01:10:07 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989-94 Massachusetts Institute of Technology
 ;;;
@@ -458,19 +458,21 @@ a repetition of this command will exit."
       (if (and (string-null? string)
               (memq *default-type* '(INVISIBLE-DEFAULT VISIBLE-DEFAULT))
               *default-string*)
-         (set-typein-string! *default-string* false))
-      (case (complete-input-string completion-procedure/complete-string false)
-       ((WAS-ALREADY-EXACT-AND-UNIQUE-COMPLETION
-         WAS-ALREADY-EXACT-COMPLETION)
-        (exit-typein-edit))
-       ((COMPLETED-TO-EXACT-AND-UNIQUE-COMPLETION
-         COMPLETED-TO-EXACT-COMPLETION)
-        (if *completion-confirm?*
-            (temporary-typein-message " [Confirm]")
-            (exit-typein-edit)))
-       (else
-        (update-typein!)
-        (editor-failure))))))
+         (set-typein-string! *default-string* false)))
+    (if (completion-procedure/verify-final-value? (typein-string))
+       (exit-typein-edit)
+       (case (complete-input-string completion-procedure/complete-string #f)
+         ((WAS-ALREADY-EXACT-AND-UNIQUE-COMPLETION
+           WAS-ALREADY-EXACT-COMPLETION)
+          (exit-typein-edit))
+         ((COMPLETED-TO-EXACT-AND-UNIQUE-COMPLETION
+           COMPLETED-TO-EXACT-COMPLETION)
+          (if *completion-confirm?*
+              (temporary-typein-message " [Confirm]")
+              (exit-typein-edit)))
+         (else
+          (update-typein!)
+          (editor-failure))))))
 \f
 ;;;; Completion Primitives