From 135430f7fc91117adb9c694f42f97062e894d15e Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 28 Feb 2001 14:56:28 +0000 Subject: [PATCH] Don't require existence of private Info directory. --- v7/src/edwin/info.scm | 21 ++++++++++--------- v7/src/edwin/paths.scm | 46 +++++++++++++++++------------------------- 2 files changed, 30 insertions(+), 37 deletions(-) diff --git a/v7/src/edwin/info.scm b/v7/src/edwin/info.scm index a0b97ce78..5dac72620 100644 --- a/v7/src/edwin/info.scm +++ b/v7/src/edwin/info.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: info.scm,v 1.135 2000/08/07 02:36:23 cph Exp $ +;;; $Id: info.scm,v 1.136 2001/02/28 14:56:28 cph Exp $ ;;; -;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology +;;; Copyright (c) 1986, 1989-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 @@ -873,15 +873,16 @@ The name may be an abbreviation of the reference name." => os/parse-path-string) (else (ref-variable info-default-directory-list - buffer)))) - (info-dir (edwin-info-directory))) + buffer))))) (map ->namestring - (if (and (file-directory? info-dir) - (not (there-exists? directories - (lambda (dir) - (pathname=? info-dir dir))))) - (append directories (list info-dir)) - directories))))) + (let ((info-dir (edwin-info-directory))) + (if (and info-dir + (file-directory? info-dir) + (not (there-exists? directories + (lambda (dir) + (pathname=? info-dir dir))))) + (append directories (list info-dir)) + directories)))))) (set-variable-local-value! buffer variable directories) directories) directories))))) diff --git a/v7/src/edwin/paths.scm b/v7/src/edwin/paths.scm index 70590e7ee..5b2b873c3 100644 --- a/v7/src/edwin/paths.scm +++ b/v7/src/edwin/paths.scm @@ -1,8 +1,8 @@ #| -*-Scheme-*- -$Id: paths.scm,v 1.14 1999/01/02 06:11:34 cph Exp $ +$Id: paths.scm,v 1.15 2001/02/28 14:56:13 cph Exp $ -Copyright (c) 1989-1999 Massachusetts Institute of Technology +Copyright (c) 1989-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 @@ -23,37 +23,29 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (declare (usual-integrations)) -(define edwin-library-directory-pathname - (let ((directory (pathname-as-directory "edwin"))) - (lambda (envvar name) - (cond ((get-environment-variable envvar) - => (lambda (name) - (pathname-as-directory (merge-pathnames name)))) - ((system-library-directory-pathname - (merge-pathnames name directory))) - (else - (error "Can't find edwin library directory:" name)))))) - -(define (edwin-etc-pathname filename) - (let ((pathname (merge-pathnames filename (edwin-etc-directory)))) - (if (not (file-exists? pathname)) - (error "Unable to find file:" (->namestring pathname))) - pathname)) +(define (edwin-library-directory-pathname envvar name required?) + (let ((name (get-environment-variable envvar))) + (if name + (pathname-as-directory (merge-pathnames name)) + (or (system-library-directory-pathname + (merge-pathnames name (pathname-as-directory "edwin"))) + (and required? + (error "Can't find edwin library directory:" name)))))) (define (edwin-binary-directory) - (edwin-library-directory-pathname - "EDWIN_BINARY_DIRECTORY" - "autoload")) + (edwin-library-directory-pathname "EDWIN_BINARY_DIRECTORY" "autoload" #t)) (define (edwin-info-directory) - (edwin-library-directory-pathname - "EDWIN_INFO_DIRECTORY" - "info")) + (edwin-library-directory-pathname "EDWIN_INFO_DIRECTORY" "info" #f)) (define (edwin-etc-directory) - (edwin-library-directory-pathname - "EDWIN_ETC_DIRECTORY" - "etc")) + (edwin-library-directory-pathname "EDWIN_ETC_DIRECTORY" "etc" #t)) + +(define (edwin-etc-pathname filename) + (let ((pathname (merge-pathnames filename (edwin-etc-directory)))) + (if (not (file-exists? pathname)) + (error "Unable to find file:" (->namestring pathname))) + pathname)) (define (edwin-tutorial-pathname) (edwin-etc-pathname "TUTORIAL")) -- 2.25.1