From: Brian A. LaMacchia Date: Mon, 6 Apr 1992 20:14:08 +0000 (+0000) Subject: Added support for .KY files. X-Git-Tag: 20090517-FFI~9513 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=3dc0ce960272311cf5153573ee06acc44ddbbb3b;p=mit-scheme.git Added support for .KY files. --- diff --git a/v7/src/edwin/edwin.pkg b/v7/src/edwin/edwin.pkg index 41db2686a..ca009da67 100644 --- a/v7/src/edwin/edwin.pkg +++ b/v7/src/edwin/edwin.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/edwin.pkg,v 1.83 1992/04/04 13:07:07 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/edwin.pkg,v 1.84 1992/04/06 20:13:54 bal Exp $ Copyright (c) 1989-92 Massachusetts Institute of Technology @@ -535,8 +535,10 @@ MIT in each case. |# prompt-for-command prompt-for-completed-string prompt-for-confirmation? + prompt-for-confirmed-password prompt-for-key prompt-for-number + prompt-for-password prompt-for-string prompt-for-string-table-name prompt-for-string-table-value diff --git a/v7/src/edwin/prompt.scm b/v7/src/edwin/prompt.scm index 7e2467f3c..bdc348f77 100644 --- a/v7/src/edwin/prompt.scm +++ b/v7/src/edwin/prompt.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/prompt.scm,v 1.153 1992/02/17 22:09:37 cph Exp $ +;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/prompt.scm,v 1.154 1992/04/06 20:14:08 bal Exp $ ;;; ;;; Copyright (c) 1986, 1989-92 Massachusetts Institute of Technology ;;; @@ -771,4 +771,42 @@ Whilst editing the command, the following commands are available: "Inserts the next element of `command-history' into the minibuffer." "p" (lambda (argument) - ((ref-command next-complex-command) (- argument)))) \ No newline at end of file + ((ref-command next-complex-command) (- argument)))) + +;;; Password Prompts + +;;; These procedures are used by the encrypt/decrypt-file routines +;;; in unix.scm which deal with .KY files. + +(define (prompt-for-password prompt) + (prompt-for-typein + prompt false + (lambda () + (let loop ((ts "")) + (let ((input (keyboard-read))) + (if (and (char? input) (char-ascii? input)) + (cond ((char=? input #\Return) + ts) + ((char=? input #\C-g) + (abort-current-command)) + ((char=? input #\Rubout) + (let ((new-string (string-head ts (-1+ (string-length ts))))) + (set-typein-string! + (make-string (string-length new-string) #\.) true) + (loop new-string))) + (else + (set-typein-string! + (make-string (1+ (string-length ts)) #\.) true) + (loop (string-append ts (char->string input))))) + (loop ts))))))) + +(define (prompt-for-confirmed-password) + (let ((password1 (prompt-for-password "Password: "))) + (let ((password2 (prompt-for-password "Verify: "))) + (if (string=? password1 password2) + password1 + (begin + (editor-beep) + (message "Passwords do not match!") + (abort-current-command)))))) +