From 49ce200945a48c7b65836da243736bfd556e6207 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sun, 19 Jan 1992 04:47:05 +0000 Subject: [PATCH] Pop down the pop-up completions buffer as soon as it is not needed. Previously, this was only popped down manually in shell mode. --- v7/src/edwin/prompt.scm | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/v7/src/edwin/prompt.scm b/v7/src/edwin/prompt.scm index 389f1c32d..d6de555e9 100644 --- a/v7/src/edwin/prompt.scm +++ b/v7/src/edwin/prompt.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/prompt.scm,v 1.150 1991/10/21 12:06:00 cph Exp $ +;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/prompt.scm,v 1.151 1992/01/19 04:47:05 cph Exp $ ;;; -;;; Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology +;;; Copyright (c) 1986, 1989-92 Massachusetts Institute of Technology ;;; ;;; This material was developed by the Scheme project at the ;;; Massachusetts Institute of Technology, Department of @@ -545,17 +545,20 @@ a repetition of this command will exit." (lambda (completion) (if (not (string=? prefix completion)) (insert-completed-string completion) - (completion-message "Sole completion"))) + (completion-message "Sole completion")) + (flush-completions-list)) (lambda (completion generate-completions) (cond ((not (string=? prefix completion)) - (insert-completed-string completion)) + (insert-completed-string completion) + (flush-completions-list)) ((ref-variable completion-auto-help) (pop-up-generated-completions generate-completions)) (else (completion-message "Next char not unique")))) (lambda () (editor-beep) - (completion-message "No completions")))) + (completion-message "No completions") + (flush-completions-list)))) (define (pop-up-generated-completions generate-completions) (message "Making completion list...") @@ -578,7 +581,7 @@ a repetition of this command will exit." (keyboard-read) (kill-pop-up-buffer false)))) (clear-message))))))) - + (define (pop-up-completions-list strings) (with-output-to-temporary-buffer " *Completions*" (lambda () @@ -592,6 +595,11 @@ a repetition of this command will exit." (write-string "Possible completions are:\n") (write-strings-densely strings)))) +(define (flush-completions-list) + (if (let ((buffer (find-buffer " *Completions*"))) + (and buffer (eq? buffer (object-unhash *previous-popped-up-buffer*)))) + (kill-pop-up-buffer false))) + (define (completion-message string) (if (typein-window? (current-window)) (temporary-typein-message (string-append " [" string "]")) -- 2.25.1