Add new OS-specific procedure DIRED-PATHNAME-WILD? so that unix can
authorChris Hanson <org/chris-hanson/cph>
Wed, 2 Oct 1996 17:00:35 +0000 (17:00 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 2 Oct 1996 17:00:35 +0000 (17:00 +0000)
support the full range of filename expansion provided by the shell.

v7/src/edwin/dired.scm
v7/src/edwin/dos.scm
v7/src/edwin/os2.scm
v7/src/edwin/unix.scm

index aaac40a89edf310a3d4be5193bb75f4c74d8c453..65ccde6b4296f7e558f6b3fba27237e439f95f0c 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: dired.scm,v 1.164 1996/09/06 17:10:57 cph Exp $
+;;;    $Id: dired.scm,v 1.165 1996/10/02 17:00:10 cph Exp $
 ;;;
 ;;;    Copyright (c) 1986, 1989-96 Massachusetts Institute of Technology
 ;;;
@@ -252,13 +252,13 @@ Type `h' after entering dired for more info."
 (define (read-directory pathname file-list switches mark)
   (if (eq? 'ALL file-list)
       (insert-directory! (let ((dir (pathname-as-directory pathname)))
-                          (if (and (not (pathname-wild? pathname))
+                          (if (and (not (dired-pathname-wild? pathname))
                                    (not (pathname=? pathname dir))
                                    (file-directory? pathname))
                               dir
                               pathname))
                         switches mark
-                        (if (pathname-wild? pathname)
+                        (if (dired-pathname-wild? pathname)
                             'WILDCARD
                             'DIRECTORY))
       (let ((mark (mark-left-inserting-copy mark)))
index a5c99e5fb25612198071e870f3fc5bbb3b76065a..359ca1f08244e9fcfa974dc48b6f6fc6070f3446 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: dos.scm,v 1.36 1996/05/04 17:38:40 cph Exp $
+;;;    $Id: dos.scm,v 1.37 1996/10/02 17:00:28 cph Exp $
 ;;;
 ;;;    Copyright (c) 1992-96 Massachusetts Institute of Technology
 ;;;
    " "
    (file-time->ls-string (file-attributes/modification-time attr) now)
    " "
-   name))
\ No newline at end of file
+   name))
+
+(define dired-pathname-wild?
+  pathname-wild?)
\ No newline at end of file
index 6e1908acf22d910210cc228fba5c8c256ff40c6a..1d0047be12e3677e53afa78e9b4d520148ce10bc 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: os2.scm,v 1.32 1996/05/12 07:14:12 cph Exp $
+;;;    $Id: os2.scm,v 1.33 1996/10/02 17:00:22 cph Exp $
 ;;;
 ;;;    Copyright (c) 1994-96 Massachusetts Institute of Technology
 ;;;
    (file-time->ls-string (file-attributes/modification-time attr) now)
    " "
    name))
-
+\f
 (define (os2/read-dired-files file all-files?)
   (let loop
       ((pathnames
                (if attr
                    (cons (cons (file-namestring (car pathnames)) attr) result)
                    result))))))
+
+(define dired-pathname-wild?
+  pathname-wild?)
 \f
 ;;;; Compressed Files
 
index 2da8323cae61d0c7d24e55571f6a5572d2cb6e7d..68482e672df02422670dd4b99e8a9b2fbfbd5a9c 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: unix.scm,v 1.71 1996/05/12 07:14:21 cph Exp $
+;;;    $Id: unix.scm,v 1.72 1996/10/02 17:00:35 cph Exp $
 ;;;
 ;;;    Copyright (c) 1989-96 Massachusetts Institute of Technology
 ;;;
@@ -610,6 +610,12 @@ CANNOT contain the 'F' option."
                      (loop (fix:+ space 1)))
                (list (substring switches start end))))
          '()))))
+
+(define (dired-pathname-wild? pathname)
+  (let ((namestring (file-namestring pathname)))
+    (or (string-find-next-char namestring #\*)
+       (string-find-next-char namestring #\?)
+       (string-find-next-char namestring #\[))))
 \f
 ;;;; Subprocess/Shell Support