comparison lisp/info.el @ 13620:e5b36a1526dd

(Info-directory-list): Use source-directory.
author Richard M. Stallman <rms@gnu.org>
date Tue, 21 Nov 1995 21:11:16 +0000
parents 1121cd08e87f
children 155a595b6083
comparison
equal deleted inserted replaced
13619:3fa8cd29e1da 13620:e5b36a1526dd
52 (let ((path (getenv "INFOPATH")) 52 (let ((path (getenv "INFOPATH"))
53 ;; This is for older Emacs versions 53 ;; This is for older Emacs versions
54 ;; which might get this info.el from the Texinfo distribution. 54 ;; which might get this info.el from the Texinfo distribution.
55 (path-separator (if (boundp 'path-separator) path-separator 55 (path-separator (if (boundp 'path-separator) path-separator
56 (if (eq system-type 'ms-dos) ";" ":"))) 56 (if (eq system-type 'ms-dos) ";" ":")))
57 (source (expand-file-name "info/" source-directory))
57 (sibling (if installation-directory 58 (sibling (if installation-directory
58 (expand-file-name "info/" installation-directory)))) 59 (expand-file-name "info/" installation-directory)))
60 alternative)
59 (if path 61 (if path
60 (let ((list nil) 62 (let ((list nil)
61 idx) 63 idx)
62 (while (> (length path) 0) 64 (while (> (length path) 0)
63 (setq idx (or (string-match path-separator path) (length path)) 65 (setq idx (or (string-match path-separator path) (length path))
64 list (cons (substring path 0 idx) list) 66 list (cons (substring path 0 idx) list)
65 path (substring path (min (1+ idx) 67 path (substring path (min (1+ idx)
66 (length path))))) 68 (length path)))))
67 (nreverse list)) 69 (nreverse list))
68 (if (or (null sibling) 70 (if (and sibling (file-exists-p sibling))
69 (member sibling Info-default-directory-list) 71 (setq alternative sibling)
70 (not (file-exists-p sibling)) 72 (setq alternative source))
73 (if (or (member alternative Info-default-directory-list)
74 (not (file-exists-p alternative))
71 ;; On DOS/NT, we use movable executables always, 75 ;; On DOS/NT, we use movable executables always,
72 ;; and we must always find the Info dir at run time. 76 ;; and we must always find the Info dir at run time.
73 (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))
74 nil 78 nil
75 ;; Use invocation-directory for Info only if we used it for 79 ;; Use invocation-directory for Info only if we used it for
76 ;; exec-directory also. 80 ;; exec-directory also.
77 (not (string= exec-directory 81 (not (string= exec-directory
78 (expand-file-name "lib-src/" 82 (expand-file-name "lib-src/"
79 installation-directory))))) 83 installation-directory)))))
80 Info-default-directory-list 84 Info-default-directory-list
81 (reverse (cons sibling (cdr (reverse Info-default-directory-list))))))) 85 (reverse (cons alternative
86 (cdr (reverse Info-default-directory-list)))))))
82 "List of directories to search for Info documentation files. 87 "List of directories to search for Info documentation files.
83 nil means not yet initialized. In this case, Info uses the environment 88 nil means not yet initialized. In this case, Info uses the environment
84 variable INFOPATH to initialize it, or `Info-default-directory-list' 89 variable INFOPATH to initialize it, or `Info-default-directory-list'
85 if there is no INFOPATH variable in the environment. 90 if there is no INFOPATH variable in the environment.
86 The last element of `Info-default-directory-list' is the directory 91 The last element of `Info-default-directory-list' is the directory