From 38264cc938d9f2fb63f1697b4ec3dc9b86640e5f Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 26 May 2012 14:58:01 -0700 Subject: [PATCH] Replace w32-init-info through the magic of custom-initialize-delay * lisp/w32-fns.el (w32-init-info): Remove. * lisp/paths.el (Info-default-directory-list): Add w32-init-info equivalent. --- lisp/ChangeLog | 4 +++- lisp/paths.el | 31 +++++++++++++++++++++---------- lisp/w32-fns.el | 18 ------------------ 3 files changed, 24 insertions(+), 29 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 918048ce62f..d3ba1caf608 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,6 +1,8 @@ 2012-05-26 Glenn Morris - * paths.el (Info-default-directory-list): + * w32-fns.el (w32-init-info): Remove. + * paths.el (Info-default-directory-list): Add w32-init-info equivalent. + * info.el (info-initialize): For self-contained NS builds, put the included info/ directory at the front. (Bug#2791) diff --git a/lisp/paths.el b/lisp/paths.el index a0d5cc7775d..ffb4077b0c2 100644 --- a/lisp/paths.el +++ b/lisp/paths.el @@ -62,16 +62,27 @@ (concat pfx sfx "info/")) suffixes))) (prune-directory-list dirs))) - prefixes)))) - ;; If $(prefix)/share/info is not one of the standard info - ;; directories, they are probably installing an experimental - ;; version of Emacs, so make sure that experimental version's Info - ;; files override the ones in standard directories. - (if (member config-dir standard-info-dirs) - ;; FIXME? What is the point of adding it again at the end - ;; when it is already present earlier in the list? - (nconc standard-info-dirs (list config-dir)) - (cons config-dir standard-info-dirs))) + prefixes))) + ;; If $(prefix)/share/info is not one of the standard info + ;; directories, they are probably installing an experimental + ;; version of Emacs, so make sure that experimental version's Info + ;; files override the ones in standard directories. + (dirs + (if (member config-dir standard-info-dirs) + ;; FIXME? What is the point of adding it again at the end + ;; when it is already present earlier in the list? + (nconc standard-info-dirs (list config-dir)) + (cons config-dir standard-info-dirs)))) + (if (not (eq system-type 'windows-nt)) + dirs + ;; Include the info directory near where Emacs executable was installed. + (let* ((instdir (file-name-directory invocation-directory)) + (dir1 (expand-file-name "../info/" instdir)) + (dir2 (expand-file-name "../../../info/" instdir))) + (cond ((file-exists-p dir1) (append dirs (list dir1))) + ((file-exists-p dir2) (append dirs (list dir2))) + (t dirs))))) + "Default list of directories to search for Info documentation files. They are searched in the order they are given in the list. Therefore, the directory of Info files that come with Emacs diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el index aff2df3dc77..1769ee73be5 100644 --- a/lisp/w32-fns.el +++ b/lisp/w32-fns.el @@ -192,24 +192,6 @@ You should set this to t when using a non-system shell.\n\n")))) (w32-get-locale-info locale) (w32-get-locale-info locale t)))))) -;; Setup Info-default-directory-list to include the info directory -;; near where Emacs executable was installed. We used to set INFOPATH, -;; but when this is set Info-default-directory-list is ignored. We -;; also cannot rely upon what is set in paths.el because they assume -;; that configuration during build time is correct for runtime. -(defun w32-init-info () - (let* ((instdir (file-name-directory invocation-directory)) - (dir1 (expand-file-name "../info/" instdir)) - (dir2 (expand-file-name "../../../info/" instdir))) - (if (file-exists-p dir1) - (setq Info-default-directory-list - (append Info-default-directory-list (list dir1))) - (if (file-exists-p dir2) - (setq Info-default-directory-list - (append Info-default-directory-list (list dir2))))))) - -(add-hook 'before-init-hook 'w32-init-info) - ;; The variable source-directory is used to initialize Info-directory-list. ;; However, the common case is that Emacs is being used from a binary ;; distribution, and the value of source-directory is meaningless in that -- 2.39.2