Skip to content

Instantly share code, notes, and snippets.

@papaeye
Created June 21, 2012 15:42
Show Gist options
  • Save papaeye/2966536 to your computer and use it in GitHub Desktop.
Save papaeye/2966536 to your computer and use it in GitHub Desktop.
A patch to fix infopath for self-contained emacs23.4/24.1
diff --git a/lisp/info.el b/lisp/info.el
index e5c258a..30d944f 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -597,7 +597,19 @@ in `Info-file-supports-index-cookies-list'."
(append (split-string (substring path 0 -1) sep)
(Info-default-dirs))
(split-string path sep))
- (Info-default-dirs)))))))
+ (Info-default-dirs))))
+ ;; For a self-contained (ie relocatable) NS build, AFAICS we
+ ;; always want the included info directory to be at the head of
+ ;; the search path, unless it's already in INFOPATH somewhere.
+ ;; It's at the head of Info-default-directory-list,
+ ;; but there's no way to get it at the head of Info-directory-list
+ ;; except by doing it here.
+ (and path
+ (or (featurep 'ns) (featurep 'mac))
+ (let ((dir (expand-file-name "../info" data-directory)))
+ (and (file-directory-p dir)
+ (not (member dir (split-string path ":" t)))
+ (push dir Info-directory-list)))))))
;;;###autoload
(defun info-other-window (&optional file-or-node)
diff --git a/lisp/paths.el b/lisp/paths.el
index 6f3ea80..baf6435 100644
--- a/lisp/paths.el
+++ b/lisp/paths.el
@@ -53,7 +53,12 @@ comparison."
(defvar Info-default-directory-list
(let* ((config-dir
- (file-name-as-directory configure-info-directory))
+ (file-name-as-directory
+ ;; Self-contained NS build with info/ in the app-bundle.
+ (or (and (or (featurep 'ns) (featurep 'mac))
+ (let ((dir (expand-file-name "../info" data-directory)))
+ (if (file-directory-p dir) dir)))
+ configure-info-directory)))
(config
(list config-dir))
(unpruned-prefixes
@papaeye
Copy link
Author

papaeye commented Jun 21, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment