From f601cd3e35ea507c8e5a253e1ff20b4c6f4f79cd Mon Sep 17 00:00:00 2001 From: Dave Love Date: Wed, 24 Mar 1999 14:25:58 +0000 Subject: [PATCH] (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. --- lisp/info.el | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/lisp/info.el b/lisp/info.el index a6acbe512c2..0deffb71bda 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -87,8 +87,8 @@ The Lisp code is executed when the node is selected.") (if path (split-string path (regexp-quote path-separator)) (if (and sibling (file-exists-p sibling)) - (setq alternative sibling) - (setq alternative source)) + (setq alternative sibling) ; uninstalled, Emacs builddir != srcdir + (setq alternative source)) ; uninstalled, builddir != srcdir (if (or (member alternative Info-default-directory-list) (not (file-exists-p alternative)) ;; On DOS/NT, we use movable executables always, @@ -101,16 +101,11 @@ The Lisp code is executed when the node is selected.") (expand-file-name "lib-src/" installation-directory))))) 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))))) + ;; `alternative' contains the Info files that came with this + ;; version, so we should look there first. `Info-insert-dir' + ;; currently expects to find `alternative' first on the list. + (cons alternative + (reverse (cdr (reverse 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' @@ -648,9 +643,10 @@ In standalone mode, \\\\[Info-exit] exits Emacs itself." (error "Can't find the Info directory node")) ;; Distinguish the dir file that comes with Emacs from all the ;; others. Yes, that is really what this is supposed to do. - ;; If it doesn't work, fix it. - (setq buffer (car buffers) - others (cdr buffers)) + ;; The definition of `Info-directory-list' puts it first on that + ;; list and so last in `buffers' at this point. + (setq buffer (car (last buffers)) + others (delq buffer buffers)) ;; Insert the entire original dir file as a start; note that we've ;; already saved its default directory to use as the default -- 2.39.2