Use PROMPT-OPTIONS-DEFAULT-STRING to determine default prompt. This
authorChris Hanson <org/chris-hanson/cph>
Tue, 30 Oct 2001 19:26:40 +0000 (19:26 +0000)
committerChris Hanson <org/chris-hanson/cph>
Tue, 30 Oct 2001 19:26:40 +0000 (19:26 +0000)
allows caller to specify that history is to be used.

v7/src/edwin/filcom.scm

index 7122b06ac218e849bd9fa9e00ce2a3ad751a130f..b72b645ef1f6c2cdf920c45d37ee39e001756ec5 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;; $Id: filcom.scm,v 1.219 2001/06/07 17:45:01 cph Exp $
+;;; $Id: filcom.scm,v 1.220 2001/10/30 19:26:40 cph Exp $
 ;;;
 ;;; Copyright (c) 1986, 1989-2001 Massachusetts Institute of Technology
 ;;;
@@ -775,43 +775,43 @@ Prefix arg means treat the plaintext file as binary data."
   (prompt-for-pathname* prompt default file-exists? options))
 
 (define (prompt-for-pathname* prompt default verify-final-value options)
-  (let* ((directory
-         (if default
-             (directory-pathname
-              (if (pair? default)
-                  (car default)
-                  default))
-             (buffer-default-directory (selected-buffer))))
-        (insertion
-         (os/pathname->display-string
-          (if (pair? default)
-              (car default)
-              directory))))
-    (prompt-string->pathname
-     (apply prompt-for-completed-string
-           prompt
-           insertion
-           (lambda (string if-unique if-not-unique if-not-found)
-             (filename-complete-string
-              (prompt-string->pathname string insertion directory)
-              (lambda (filename)
-                (if-unique (os/pathname->display-string filename)))
-              (lambda (prefix get-completions)
-                (if-not-unique (os/pathname->display-string prefix)
-                               get-completions))
-              if-not-found))
-           (lambda (string)
-             (filename-completions-list
-              (prompt-string->pathname string insertion directory)))
-           (lambda (string)
-             (file-test-no-errors
-              verify-final-value
-              (prompt-string->pathname string insertion directory)))
-           'DEFAULT-TYPE 'INSERTED-DEFAULT
-           'HISTORY 'PROMPT-FOR-PATHNAME
-           options)
-     insertion
-     directory)))
+  (let ((directory
+        (if default
+            (directory-pathname (if (pair? default) (car default) default))
+            (buffer-default-directory (selected-buffer))))
+       (options
+        (cons* 'DEFAULT-TYPE 'INSERTED-DEFAULT
+               'HISTORY 'PROMPT-FOR-PATHNAME
+               options)))
+    (let ((insertion
+          (or (prompt-options-default-string options)
+              (os/pathname->display-string
+               (if (pair? default)
+                   (car default)
+                   directory)))))
+      (prompt-string->pathname
+       (apply prompt-for-completed-string
+             prompt
+             insertion
+             (lambda (string if-unique if-not-unique if-not-found)
+               (filename-complete-string
+                (prompt-string->pathname string insertion directory)
+                (lambda (filename)
+                  (if-unique (os/pathname->display-string filename)))
+                (lambda (prefix get-completions)
+                  (if-not-unique (os/pathname->display-string prefix)
+                                 get-completions))
+                if-not-found))
+             (lambda (string)
+               (filename-completions-list
+                (prompt-string->pathname string insertion directory)))
+             (lambda (string)
+               (file-test-no-errors
+                verify-final-value
+                (prompt-string->pathname string insertion directory)))
+             options)
+       insertion
+       directory))))
 \f
 ;;;; Filename Completion