From 44ba8a87a63018bd5e2106b0455f16f88ff0717b Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 2 Oct 1996 17:00:35 +0000 Subject: [PATCH] Add new OS-specific procedure DIRED-PATHNAME-WILD? so that unix can support the full range of filename expansion provided by the shell. --- v7/src/edwin/dired.scm | 6 +++--- v7/src/edwin/dos.scm | 7 +++++-- v7/src/edwin/os2.scm | 7 +++++-- v7/src/edwin/unix.scm | 8 +++++++- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/v7/src/edwin/dired.scm b/v7/src/edwin/dired.scm index aaac40a89..65ccde6b4 100644 --- a/v7/src/edwin/dired.scm +++ b/v7/src/edwin/dired.scm @@ -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))) diff --git a/v7/src/edwin/dos.scm b/v7/src/edwin/dos.scm index a5c99e5fb..359ca1f08 100644 --- a/v7/src/edwin/dos.scm +++ b/v7/src/edwin/dos.scm @@ -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 ;;; @@ -256,4 +256,7 @@ " " (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 diff --git a/v7/src/edwin/os2.scm b/v7/src/edwin/os2.scm index 6e1908acf..1d0047be1 100644 --- a/v7/src/edwin/os2.scm +++ b/v7/src/edwin/os2.scm @@ -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 ;;; @@ -218,7 +218,7 @@ (file-time->ls-string (file-attributes/modification-time attr) now) " " name)) - + (define (os2/read-dired-files file all-files?) (let loop ((pathnames @@ -238,6 +238,9 @@ (if attr (cons (cons (file-namestring (car pathnames)) attr) result) result)))))) + +(define dired-pathname-wild? + pathname-wild?) ;;;; Compressed Files diff --git a/v7/src/edwin/unix.scm b/v7/src/edwin/unix.scm index 2da8323ca..68482e672 100644 --- a/v7/src/edwin/unix.scm +++ b/v7/src/edwin/unix.scm @@ -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 #\[)))) ;;;; Subprocess/Shell Support -- 2.25.1