From 256d6024eb3363de7dd25fa544ed41311f3f17f9 Mon Sep 17 00:00:00 2001 From: "Brian A. LaMacchia" Date: Fri, 6 Sep 1991 16:19:44 +0000 Subject: [PATCH] Changed filename-complete-string so that matches which complete to directory names act as though the completion is non-unique. Before, if the only directory in /tmp beginning with "f" was "foo", then completing on "/tmp/f" would complete to "/tmp/foo", and the if-unique proc. would be invoked with "/tmp/foo/". Now, we invoke if-non-unique with "/tmp/foo/". --- v7/src/edwin/filcom.scm | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/v7/src/edwin/filcom.scm b/v7/src/edwin/filcom.scm index 8c884f91f..bc92d3911 100644 --- a/v7/src/edwin/filcom.scm +++ b/v7/src/edwin/filcom.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/filcom.scm,v 1.157 1991/05/21 21:46:35 cph Exp $ +;;; $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/filcom.scm,v 1.158 1991/09/06 16:19:44 bal Exp $ ;;; ;;; Copyright (c) 1986, 1989-91 Massachusetts Institute of Technology ;;; @@ -598,11 +598,18 @@ If a file with the new name already exists, confirmation is requested first." (define (loop directory filenames) (let ((unique-case (lambda (filename) - (if-unique - (let ((filename (os/make-filename directory filename))) - (if (os/file-directory? filename) - (os/filename-as-directory filename) - filename))))) + (let ((filename (os/make-filename directory filename))) + (if (os/file-directory? filename) + ;; Note: We assume here that all directories contain + ;; at least one file. Thus directory names should + ;; complete, but not uniquely. + (let ((dir (os/filename-as-directory filename))) + (if-not-unique dir + (lambda () + (canonicalize-filename-completions + dir + (os/directory-list dir))))) + (if-unique filename))))) (non-unique-case (lambda (filenames*) (let ((string (string-greatest-common-prefix filenames*))) -- 2.25.1