comparison lisp/info.el @ 24513:2db3b19a94bb

(Info-directory-list): Revert change to re-writing Info-default-directory-list, but put `alternative' first. (Info-insert-dir): Modify selecting the top dir file as a consequence.
author Dave Love <fx@gnu.org>
date Wed, 24 Mar 1999 14:25:58 +0000
parents baf6798c9df8
children 2d0999df43c7
comparison
equal deleted inserted replaced
24512:ca92d7df3b48 24513:2db3b19a94bb
85 (expand-file-name "info/" installation-directory))) 85 (expand-file-name "info/" installation-directory)))
86 alternative) 86 alternative)
87 (if path 87 (if path
88 (split-string path (regexp-quote path-separator)) 88 (split-string path (regexp-quote path-separator))
89 (if (and sibling (file-exists-p sibling)) 89 (if (and sibling (file-exists-p sibling))
90 (setq alternative sibling) 90 (setq alternative sibling) ; uninstalled, Emacs builddir != srcdir
91 (setq alternative source)) 91 (setq alternative source)) ; uninstalled, builddir != srcdir
92 (if (or (member alternative Info-default-directory-list) 92 (if (or (member alternative Info-default-directory-list)
93 (not (file-exists-p alternative)) 93 (not (file-exists-p alternative))
94 ;; On DOS/NT, we use movable executables always, 94 ;; On DOS/NT, we use movable executables always,
95 ;; and we must always find the Info dir at run time. 95 ;; and we must always find the Info dir at run time.
96 (if (or (eq system-type 'ms-dos) (eq system-type 'windows-nt)) 96 (if (or (eq system-type 'ms-dos) (eq system-type 'windows-nt))
99 ;; exec-directory also. 99 ;; exec-directory also.
100 (not (string= exec-directory 100 (not (string= exec-directory
101 (expand-file-name "lib-src/" 101 (expand-file-name "lib-src/"
102 installation-directory))))) 102 installation-directory)))))
103 Info-default-directory-list 103 Info-default-directory-list
104 ;; Substitute the alternative for occurences of the 104 ;; `alternative' contains the Info files that came with this
105 ;; installation directory. The latter occurs last, but maybe 105 ;; version, so we should look there first. `Info-insert-dir'
106 ;; more than once, so that it overrides /usr/info in 106 ;; currently expects to find `alternative' first on the list.
107 ;; particular. 107 (cons alternative
108 (let ((instdir (car (last Info-default-directory-list)))) 108 (reverse (cdr (reverse Info-default-directory-list)))))))
109 (mapcar (lambda (dir)
110 (if (string= dir instdir)
111 alternative
112 dir))
113 Info-default-directory-list)))))
114 "List of directories to search for Info documentation files. 109 "List of directories to search for Info documentation files.
115 nil means not yet initialized. In this case, Info uses the environment 110 nil means not yet initialized. In this case, Info uses the environment
116 variable INFOPATH to initialize it, or `Info-default-directory-list' 111 variable INFOPATH to initialize it, or `Info-default-directory-list'
117 if there is no INFOPATH variable in the environment. 112 if there is no INFOPATH variable in the environment.
118 The last element of `Info-default-directory-list' is the directory 113 The last element of `Info-default-directory-list' is the directory
646 641
647 (or buffers 642 (or buffers
648 (error "Can't find the Info directory node")) 643 (error "Can't find the Info directory node"))
649 ;; Distinguish the dir file that comes with Emacs from all the 644 ;; Distinguish the dir file that comes with Emacs from all the
650 ;; others. Yes, that is really what this is supposed to do. 645 ;; others. Yes, that is really what this is supposed to do.
651 ;; If it doesn't work, fix it. 646 ;; The definition of `Info-directory-list' puts it first on that
652 (setq buffer (car buffers) 647 ;; list and so last in `buffers' at this point.
653 others (cdr buffers)) 648 (setq buffer (car (last buffers))
649 others (delq buffer buffers))
654 650
655 ;; Insert the entire original dir file as a start; note that we've 651 ;; Insert the entire original dir file as a start; note that we've
656 ;; already saved its default directory to use as the default 652 ;; already saved its default directory to use as the default
657 ;; directory for the whole concatenation. 653 ;; directory for the whole concatenation.
658 (insert-buffer buffer) 654 (insert-buffer buffer)