comparison lisp/info.el @ 11781:fe6619d546fd

(Info-directory-list): Use installation-directory, not invocation-directory. Cope if it is nil.
author Richard M. Stallman <rms@gnu.org>
date Tue, 09 May 1995 05:36:55 +0000
parents 51816af03215
children 0b8b8be6a3fd
comparison
equal deleted inserted replaced
11780:6ae23eecab6a 11781:fe6619d546fd
56 (defvar Info-directory-list 56 (defvar Info-directory-list
57 (let ((path (getenv "INFOPATH")) 57 (let ((path (getenv "INFOPATH"))
58 (sep (if (or (eq system-type 'ms-dos) 58 (sep (if (or (eq system-type 'ms-dos)
59 (eq system-type 'windows-nt)) 59 (eq system-type 'windows-nt))
60 ";" ":")) 60 ";" ":"))
61 (sibling (expand-file-name "../info/" (invocation-directory)))) 61 (sibling (if installation-directory
62 (expand-file-name "info/" installation-directory))))
62 (if path 63 (if path
63 (let ((list nil) 64 (let ((list nil)
64 idx) 65 idx)
65 (while (> (length path) 0) 66 (while (> (length path) 0)
66 (setq idx (or (string-match sep path) (length path)) 67 (setq idx (or (string-match sep path) (length path))
67 list (cons (substring path 0 idx) list) 68 list (cons (substring path 0 idx) list)
68 path (substring path (min (1+ idx) 69 path (substring path (min (1+ idx)
69 (length path))))) 70 (length path)))))
70 (nreverse list)) 71 (nreverse list))
71 (if (or (member sibling Info-default-directory-list) 72 (if (or (null sibling)
73 (member sibling Info-default-directory-list)
72 (not (file-exists-p sibling)) 74 (not (file-exists-p sibling))
73 ;; On DOS/NT, we use movable executables always, 75 ;; On DOS/NT, we use movable executables always,
74 ;; and we must always find the Info dir at run time. 76 ;; and we must always find the Info dir at run time.
75 (if (or (eq system-type 'ms-dos) (eq system-type 'windows-nt)) 77 (if (or (eq system-type 'ms-dos) (eq system-type 'windows-nt))
76 nil 78 nil
77 ;; Use invocation-directory for Info only if we used it for 79 ;; Use invocation-directory for Info only if we used it for
78 ;; exec-directory also. 80 ;; exec-directory also.
79 (not (string= exec-directory 81 (not (string= exec-directory
80 (expand-file-name "../lib-src/" 82 (expand-file-name "lib-src/"
81 (invocation-directory)))))) 83 installation-directory)))))
82 Info-default-directory-list 84 Info-default-directory-list
83 (reverse (cons sibling (cdr (reverse Info-default-directory-list))))))) 85 (reverse (cons sibling (cdr (reverse Info-default-directory-list)))))))
84 "List of directories to search for Info documentation files. 86 "List of directories to search for Info documentation files.
85 nil means not yet initialized. In this case, Info uses the environment 87 nil means not yet initialized. In this case, Info uses the environment
86 variable INFOPATH to initialize it, or `Info-default-directory-list' 88 variable INFOPATH to initialize it, or `Info-default-directory-list'