]> git.eshelyaron.com Git - emacs.git/commitdiff
(Info-directory-list): Don't set path-separator now
authorDave Love <fx@gnu.org>
Tue, 26 Jan 1999 18:54:57 +0000 (18:54 +0000)
committerDave Love <fx@gnu.org>
Tue, 26 Jan 1999 18:54:57 +0000 (18:54 +0000)
we're not shipped with Texinfo.  Simplify path definition.
Substitute all occurrences of instdir in
Info-default-directory-list.

lisp/info.el

index a81da542d36ce3ab95ee6b0ccd51827c4c968dc7..a6acbe512c29ac780da04b647918ce8e817a9859 100644 (file)
@@ -1,6 +1,6 @@
 ;;; info.el --- info package for Emacs.
 
-;; Copyright (C) 1985, 86, 92, 93, 94, 95, 96, 97, 98 Free Software
+;; Copyright (C) 1985, 86, 92, 93, 94, 95, 96, 97, 98, 99 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: FSF
@@ -80,23 +80,12 @@ The Lisp code is executed when the node is selected.")
 
 (defvar Info-directory-list
   (let ((path (getenv "INFOPATH"))
-       ;; This is for older Emacs versions
-       ;; which might get this info.el from the Texinfo distribution.
-       (path-separator (if (boundp 'path-separator) path-separator
-                         (if (eq system-type 'ms-dos) ";" ":")))
        (source (expand-file-name "info/" source-directory))
        (sibling (if installation-directory
                     (expand-file-name "info/" installation-directory)))
        alternative)
     (if path
-       (let ((list nil)
-             idx)
-         (while (> (length path) 0)
-           (setq idx (or (string-match path-separator path) (length path))
-                 list (cons (substring path 0 idx) list)
-                 path (substring path (min (1+ idx)
-                                           (length path)))))
-         (nreverse list))
+       (split-string path (regexp-quote path-separator))
       (if (and sibling (file-exists-p sibling))
          (setq alternative sibling)
        (setq alternative source))
@@ -112,8 +101,16 @@ The Lisp code is executed when the node is selected.")
                              (expand-file-name "lib-src/"
                                                installation-directory)))))
          Info-default-directory-list
-       (reverse (cons alternative
-                      (cdr (reverse Info-default-directory-list)))))))
+       ;; Substitute the alternative for occurences of the
+       ;; installation directory.  The latter occurs last, but maybe
+       ;; more than once, so that it overrides /usr/info in
+       ;; particular.
+       (let ((instdir (car (last Info-default-directory-list))))
+         (mapcar (lambda (dir)
+                   (if (string= dir instdir)
+                       alternative
+                     dir))
+                 Info-default-directory-list)))))
   "List of directories to search for Info documentation files.
 nil means not yet initialized.  In this case, Info uses the environment
 variable INFOPATH to initialize it, or `Info-default-directory-list'