Don't require existence of private Info directory.
authorChris Hanson <org/chris-hanson/cph>
Wed, 28 Feb 2001 14:56:28 +0000 (14:56 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 28 Feb 2001 14:56:28 +0000 (14:56 +0000)
v7/src/edwin/info.scm
v7/src/edwin/paths.scm

index a0b97ce785b401b35c79367c1b79fe091ee22d04..5dac7262065652ebf6035e8310d3d6625c014fbe 100644 (file)
@@ -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)))))
index 70590e7ee58bcb4f0f4113a3ce17b2a6ec9f793c..5b2b873c37b530b90a7d26af230b8c7d0fa42a4a 100644 (file)
@@ -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"))