From 45302d0d79e5652f54d318af7aba8740c90611e4 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 24 Apr 1995 01:10:07 +0000 Subject: [PATCH] When doing completing prompt with REQUIRE-MATCH? set true, delay 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 | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/v7/src/edwin/prompt.scm b/v7/src/edwin/prompt.scm index 0b179e3a2..5fc653017 100644 --- a/v7/src/edwin/prompt.scm +++ b/v7/src/edwin/prompt.scm @@ -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)))))) ;;;; Completion Primitives -- 2.25.1