mechanisms previously used to detect the same thing.
;;; -*-Scheme-*-
;;;
-;;; $Id: filcom.scm,v 1.216 2001/05/10 19:06:17 cph Exp $
+;;; $Id: filcom.scm,v 1.217 2001/05/12 20:02:19 cph Exp $
;;;
;;; Copyright (c) 1986, 1989-2001 Massachusetts Institute of Technology
;;;
boolean?)
(define (pathname->buffer-name pathname)
- (let ((pathname
- (let ((pathname (->pathname pathname)))
- (if (pathname-name pathname)
- pathname
- (directory-pathname-as-file pathname)))))
- (let ((name (file-namestring pathname)))
- (if (string-null? name)
- (->namestring pathname)
- name))))
+ (let ((pathname (directory-pathname-as-file (->pathname pathname))))
+ (if (directory-pathname? pathname)
+ (->namestring pathname)
+ (file-namestring pathname))))
(define (pathname->buffer pathname)
(let ((pathname (->pathname pathname)))
(set-visited-pathname
(selected-buffer)
(let ((pathname (->pathname filename)))
- (and (not (string-null? (file-namestring pathname)))
+ (and (not (directory-pathname? pathname))
pathname)))))
(define (set-visited-pathname buffer pathname)
- (if (and pathname (not (pathname-name pathname)))
+ (if (and pathname (directory-pathname? pathname))
(editor-error "File name cannot be a directory: "
(->namestring pathname)))
(set-buffer-pathname! buffer pathname)
(define (filename-complete-string pathname
if-unique if-not-unique if-not-found)
(let ((directory (directory-namestring pathname))
- (prefix (file-namestring pathname))
(if-directory
(lambda (directory)
(if-not-unique directory
(os/directory-list directory)))))))
(cond ((not (file-test-no-errors file-directory? directory))
(if-not-found))
- ((string-null? prefix)
+ ((directory-pathname? pathname)
(if-directory directory))
(else
- (let ((filenames (os/directory-list-completions directory prefix))
+ (let ((filenames
+ (os/directory-list-completions directory
+ (file-namestring pathname)))
(unique-case
(lambda (filename)
(let ((pathname (merge-pathnames filename directory)))
;;; -*-Scheme-*-
;;;
-;;; $Id: print.scm,v 1.19 2000/04/30 22:17:07 cph Exp $
+;;; $Id: print.scm,v 1.20 2001/05/12 20:02:33 cph Exp $
;;;
-;;; Copyright (c) 1991-2000 Massachusetts Institute of Technology
+;;; Copyright (c) 1991-2001 Massachusetts Institute of Technology
;;;
;;; This program is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program; if not, write to the Free Software
-;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+;;; 02111-1307, USA.
;;;; Print Buffers and Regions
(and buffer
(or (let ((pathname (buffer-pathname buffer)))
(and pathname
- (let ((filename (file-namestring pathname)))
- (and (not (string-null? filename))
- filename))))
+ (not (directory-pathname? pathname))
+ (file-namestring pathname)))
(string-append "Edwin buffer " (buffer-name buffer)))))))
(if (or (not buffer-title)
(and (group-start? (region-start region))
;;; -*-Scheme-*-
;;;
-;;; $Id: imail-util.scm,v 1.35 2001/03/19 22:17:37 cph Exp $
+;;; $Id: imail-util.scm,v 1.36 2001/05/12 20:03:21 cph Exp $
;;;
;;; Copyright (c) 1999-2001 Massachusetts Institute of Technology
;;;
(lambda () (filtered-list pathname filter))))))
(cond ((not (safe-file-directory? (directory-pathname pathname)))
(if-not-found))
- ((string-null? (file-namestring pathname))
+ ((directory-pathname? pathname)
(if-directory pathname))
(else
(let ((pathnames (filtered-completions pathname filter)))
(string-greatest-common-prefix
(map ->namestring pathnames)))
(lambda () pathnames)))
- ((string-null? (file-namestring (car pathnames)))
+ ((directory-pathname? (car pathnames))
(if-directory (car pathnames)))
(else
(if-unique (car pathnames)))))))))
#| -*-Scheme-*-
-$Id: dosdir.scm,v 1.9 1999/06/21 21:05:27 cph Exp $
+$Id: dosdir.scm,v 1.10 2001/05/12 20:03:01 cph Exp $
-Copyright (c) 1992, 1999 Massachusetts Institute of Technology
+Copyright (c) 1992, 1999-2001 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+USA.
|#
;;;; DOS Directory Reader
(define (directory-read-nosort pattern)
(let ((pattern
(let ((pattern (adjust-directory-pattern (merge-pathnames pattern))))
- (let ((name (pathname-name pattern))
- (type (pathname-type pattern)))
- (if (or name type)
- pattern
- (make-pathname (pathname-host pattern)
- (pathname-device pattern)
- (pathname-directory pattern)
- 'WILD
- 'WILD
- (pathname-version pattern)))))))
+ (if (directory-pathname? pattern)
+ (make-pathname (pathname-host pattern)
+ (pathname-device pattern)
+ (pathname-directory pattern)
+ 'WILD
+ 'WILD
+ (pathname-version pattern))
+ pattern))))
(let ((directory-path (directory-pathname pattern)))
(map (lambda (pathname)
(merge-pathnames pathname directory-path))
#| -*-Scheme-*-
-$Id: unxdir.scm,v 14.11 1999/01/02 06:19:10 cph Exp $
+$Id: unxdir.scm,v 14.12 2001/05/12 20:03:03 cph Exp $
-Copyright (c) 1988-1999 Massachusetts Institute of Technology
+Copyright (c) 1988-2001 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+USA.
|#
;;;; Directory Operations -- unix
(define (directory-read-nosort pattern)
(let ((pattern
(let ((pattern (merge-pathnames pattern)))
- (let ((name (pathname-name pattern))
- (type (pathname-type pattern)))
- (if (or name type)
- pattern
- (make-pathname (pathname-host pattern)
- (pathname-device pattern)
- (pathname-directory pattern)
- 'WILD
- 'WILD
- (pathname-version pattern)))))))
+ (if (directory-pathname? pattern)
+ (make-pathname (pathname-host pattern)
+ (pathname-device pattern)
+ (pathname-directory pattern)
+ 'WILD
+ 'WILD
+ (pathname-version pattern))
+ pattern))))
(let ((directory-path (directory-pathname pattern)))
(map (lambda (pathname)
(merge-pathnames pathname directory-path))