diff options
| author | Glenn Morris | 2012-05-26 14:58:01 -0700 |
|---|---|---|
| committer | Glenn Morris | 2012-05-26 14:58:01 -0700 |
| commit | 38264cc938d9f2fb63f1697b4ec3dc9b86640e5f (patch) | |
| tree | 1ed39feb138b0a8d2707505a4f0a66286db9f488 | |
| parent | eb7afdaddc286b57253cf0cd643b2ea594fb130c (diff) | |
| download | emacs-38264cc938d9f2fb63f1697b4ec3dc9b86640e5f.tar.gz emacs-38264cc938d9f2fb63f1697b4ec3dc9b86640e5f.zip | |
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.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/paths.el | 31 | ||||
| -rw-r--r-- | 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 @@ | |||
| 1 | 2012-05-26 Glenn Morris <rgm@gnu.org> | 1 | 2012-05-26 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * paths.el (Info-default-directory-list): | 3 | * w32-fns.el (w32-init-info): Remove. |
| 4 | * paths.el (Info-default-directory-list): Add w32-init-info equivalent. | ||
| 5 | |||
| 4 | * info.el (info-initialize): For self-contained NS builds, put the | 6 | * info.el (info-initialize): For self-contained NS builds, put the |
| 5 | included info/ directory at the front. (Bug#2791) | 7 | included info/ directory at the front. (Bug#2791) |
| 6 | 8 | ||
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 @@ | |||
| 62 | (concat pfx sfx "info/")) | 62 | (concat pfx sfx "info/")) |
| 63 | suffixes))) | 63 | suffixes))) |
| 64 | (prune-directory-list dirs))) | 64 | (prune-directory-list dirs))) |
| 65 | prefixes)))) | 65 | prefixes))) |
| 66 | ;; If $(prefix)/share/info is not one of the standard info | 66 | ;; If $(prefix)/share/info is not one of the standard info |
| 67 | ;; directories, they are probably installing an experimental | 67 | ;; directories, they are probably installing an experimental |
| 68 | ;; version of Emacs, so make sure that experimental version's Info | 68 | ;; version of Emacs, so make sure that experimental version's Info |
| 69 | ;; files override the ones in standard directories. | 69 | ;; files override the ones in standard directories. |
| 70 | (if (member config-dir standard-info-dirs) | 70 | (dirs |
| 71 | ;; FIXME? What is the point of adding it again at the end | 71 | (if (member config-dir standard-info-dirs) |
| 72 | ;; when it is already present earlier in the list? | 72 | ;; FIXME? What is the point of adding it again at the end |
| 73 | (nconc standard-info-dirs (list config-dir)) | 73 | ;; when it is already present earlier in the list? |
| 74 | (cons config-dir standard-info-dirs))) | 74 | (nconc standard-info-dirs (list config-dir)) |
| 75 | (cons config-dir standard-info-dirs)))) | ||
| 76 | (if (not (eq system-type 'windows-nt)) | ||
| 77 | dirs | ||
| 78 | ;; Include the info directory near where Emacs executable was installed. | ||
| 79 | (let* ((instdir (file-name-directory invocation-directory)) | ||
| 80 | (dir1 (expand-file-name "../info/" instdir)) | ||
| 81 | (dir2 (expand-file-name "../../../info/" instdir))) | ||
| 82 | (cond ((file-exists-p dir1) (append dirs (list dir1))) | ||
| 83 | ((file-exists-p dir2) (append dirs (list dir2))) | ||
| 84 | (t dirs))))) | ||
| 85 | |||
| 75 | "Default list of directories to search for Info documentation files. | 86 | "Default list of directories to search for Info documentation files. |
| 76 | They are searched in the order they are given in the list. | 87 | They are searched in the order they are given in the list. |
| 77 | Therefore, the directory of Info files that come with Emacs | 88 | 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")))) | |||
| 192 | (w32-get-locale-info locale) | 192 | (w32-get-locale-info locale) |
| 193 | (w32-get-locale-info locale t)))))) | 193 | (w32-get-locale-info locale t)))))) |
| 194 | 194 | ||
| 195 | ;; Setup Info-default-directory-list to include the info directory | ||
| 196 | ;; near where Emacs executable was installed. We used to set INFOPATH, | ||
| 197 | ;; but when this is set Info-default-directory-list is ignored. We | ||
| 198 | ;; also cannot rely upon what is set in paths.el because they assume | ||
| 199 | ;; that configuration during build time is correct for runtime. | ||
| 200 | (defun w32-init-info () | ||
| 201 | (let* ((instdir (file-name-directory invocation-directory)) | ||
| 202 | (dir1 (expand-file-name "../info/" instdir)) | ||
| 203 | (dir2 (expand-file-name "../../../info/" instdir))) | ||
| 204 | (if (file-exists-p dir1) | ||
| 205 | (setq Info-default-directory-list | ||
| 206 | (append Info-default-directory-list (list dir1))) | ||
| 207 | (if (file-exists-p dir2) | ||
| 208 | (setq Info-default-directory-list | ||
| 209 | (append Info-default-directory-list (list dir2))))))) | ||
| 210 | |||
| 211 | (add-hook 'before-init-hook 'w32-init-info) | ||
| 212 | |||
| 213 | ;; The variable source-directory is used to initialize Info-directory-list. | 195 | ;; The variable source-directory is used to initialize Info-directory-list. |
| 214 | ;; However, the common case is that Emacs is being used from a binary | 196 | ;; However, the common case is that Emacs is being used from a binary |
| 215 | ;; distribution, and the value of source-directory is meaningless in that | 197 | ;; distribution, and the value of source-directory is meaningless in that |