]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't mess with INFOPATH in ns builds
authorGlenn Morris <rgm@gnu.org>
Sat, 26 May 2012 21:23:28 +0000 (14:23 -0700)
committerGlenn Morris <rgm@gnu.org>
Sat, 26 May 2012 21:23:28 +0000 (14:23 -0700)
It's not necessary, and would break if INFOPATH was already set (bug#2791).
Ref also
http://lists.gnu.org/archive/html/emacs-devel/2009-05/msg00035.html
http://lists.gnu.org/archive/html/emacs-devel/2005-06/msg00064.html

* lisp/paths.el (Info-default-directory-list):
* lisp/info.el (info-initialize): For self-contained NS builds, put the
included info/ directory at the front.

* src/nsterm.m (ns_init_paths): Don't mess with INFOPATH.

lisp/ChangeLog
lisp/info.el
lisp/paths.el
src/ChangeLog
src/nsterm.m

index 48cc0ca22ae5bbd49910a4c20009219cd1ea57c1..918048ce62f82aff98431cdcd12ed9636be46ccb 100644 (file)
@@ -1,5 +1,9 @@
 2012-05-26  Glenn Morris  <rgm@gnu.org>
 
+       * paths.el (Info-default-directory-list):
+       * info.el (info-initialize): For self-contained NS builds, put the
+       included info/ directory at the front.  (Bug#2791)
+
        * paths.el (Info-default-directory-list): Make it a defcustom,
        mainly so that we can use custom-initialize-delay.
 
index 367d9d0a9effd26cf2660bde332092ef1f887486..93523c4c16fe5c59ab482932c3494b09a75b1890 100644 (file)
@@ -618,7 +618,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
+          (featurep 'ns)
+          (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)
index 4d7e3718be266b4ddbc2d86665b12e75bc78be8c..a0d5cc7775d344735804a1446595032c9cfd00f1 100644 (file)
 ;; call custom-initialize-delay on it.
 (defcustom 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 (featurep 'ns)
+                   (let ((dir (expand-file-name "../info" data-directory)))
+                     (if (file-directory-p dir) dir)))
+              configure-info-directory)))
         (prefixes
          ;; Directory trees in which to look for info subdirectories
          (prune-directory-list '("/usr/local/" "/usr/" "/opt/" "/")))
index c71ea45ddedb5721138024f02e2a99aaccbb2c7a..bea9b4fbc476f7b0c22e7a5f8b0fccc970ac976c 100644 (file)
@@ -1,3 +1,7 @@
+2012-05-26  Glenn Morris  <rgm@gnu.org>
+
+       * nsterm.m (ns_init_paths): Don't mess with INFOPATH.  (Bug#2791)
+
 2012-05-26  Eli Zaretskii  <eliz@gnu.org>
 
        Extend mouse support on W32 text-mode console.
index 4b8b2bb48201b7e6bf7cdbfcb56dba448c56fed7..8bd2bb283b29b08482afc47f6eaa809382a76a82 100644 (file)
@@ -379,16 +379,6 @@ ns_init_paths (void)
             setenv ("EMACSDOC", [resourcePath UTF8String], 1);
         }
     }
-
-  if (!getenv ("INFOPATH"))
-    {
-      resourcePath = [resourceDir stringByAppendingPathComponent: @"info"];
-      if ([fileManager fileExistsAtPath: resourcePath isDirectory: &isDir])
-        if (isDir)
-          setenv ("INFOPATH", [[resourcePath stringByAppendingString: @":"]
-                                             UTF8String], 1);
-      /* Note, extra colon needed to cause merge w/later user additions. */
-    }
 }