From d21c0d45dfee8060c3d7bf3b38ee5daabf67dbc8 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 30 Jun 2000 02:59:57 +0000 Subject: [PATCH] Simplify handling of file-URL completion: this is now identical for all file URLs, so have only one method for that class. --- v7/src/imail/imail-file.scm | 40 ++++++++++++++++++------------------ v7/src/imail/imail-rmail.scm | 3 +-- v7/src/imail/imail-umail.scm | 3 +-- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/v7/src/imail/imail-file.scm b/v7/src/imail/imail-file.scm index 2bab9b1a0..d13d36306 100644 --- a/v7/src/imail/imail-file.scm +++ b/v7/src/imail/imail-file.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imail-file.scm,v 1.49 2000/06/23 19:29:41 cph Exp $ +;;; $Id: imail-file.scm,v 1.50 2000/06/30 02:59:54 cph Exp $ ;;; ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology ;;; @@ -42,25 +42,25 @@ (define-method url-exists? ((url )) (file-exists? (file-url-pathname url))) -(define (define-file-url-completers class) - (define-method %url-complete-string - ((string ) (default-url class) - if-unique if-not-unique if-not-found) - (pathname-complete-string - (merge-pathnames string (file-url-pathname default-url)) - (lambda (pathname) pathname #t) - (lambda (string) - (if-unique (->namestring string))) - (lambda (prefix get-completions) - (if-not-unique (->namestring prefix) - (lambda () (map ->namestring (get-completions))))) - if-not-found)) - (define-method %url-string-completions - ((string ) (default-url class)) - (map ->namestring - (pathname-completions-list - (merge-pathnames string (file-url-pathname default-url)) - (lambda (pathname) pathname #t))))) +(define-method %url-complete-string + ((string ) (default-url ) + if-unique if-not-unique if-not-found) + (pathname-complete-string + (merge-pathnames string (file-url-pathname default-url)) + (lambda (pathname) pathname #t) + (lambda (string) + (if-unique (->namestring string))) + (lambda (prefix get-completions) + (if-not-unique (->namestring prefix) + (lambda () (map ->namestring (get-completions))))) + if-not-found)) + +(define-method %url-string-completions + ((string ) (default-url )) + (map ->namestring + (pathname-completions-list + (merge-pathnames string (file-url-pathname default-url)) + (lambda (pathname) pathname #t)))) ;;;; Server operations diff --git a/v7/src/imail/imail-rmail.scm b/v7/src/imail/imail-rmail.scm index 88dada042..4980cac69 100644 --- a/v7/src/imail/imail-rmail.scm +++ b/v7/src/imail/imail-rmail.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imail-rmail.scm,v 1.46 2000/06/30 02:57:22 cph Exp $ +;;; $Id: imail-rmail.scm,v 1.47 2000/06/30 02:59:55 cph Exp $ ;;; ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology ;;; @@ -26,7 +26,6 @@ (define-class ()) (define-url-protocol "rmail" ) -(define-file-url-completers ) (define make-rmail-url (let ((constructor (instance-constructor '(PATHNAME)))) diff --git a/v7/src/imail/imail-umail.scm b/v7/src/imail/imail-umail.scm index 602541bee..6d59471b6 100644 --- a/v7/src/imail/imail-umail.scm +++ b/v7/src/imail/imail-umail.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: imail-umail.scm,v 1.35 2000/06/30 02:57:23 cph Exp $ +;;; $Id: imail-umail.scm,v 1.36 2000/06/30 02:59:57 cph Exp $ ;;; ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology ;;; @@ -26,7 +26,6 @@ (define-class ()) (define-url-protocol "umail" ) -(define-file-url-completers ) (define make-umail-url (let ((constructor (instance-constructor '(PATHNAME)))) -- 2.25.1