emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NS do not set INFOPATH


From: Felix Mueller
Subject: NS do not set INFOPATH
Date: Sun, 03 May 2009 15:47:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (darwin)

Hi,

I would find it less intrusive, if Emacs.app did not set INFOPATH upon
start up if it was not set before. This would enable users to make
changes to Info-default-directory-list in their initialization files. I
am attaching changes that imitate w32's behavior in this regard, albeit
adding the info directory in the bundle at the beginning of the list. It
might be prudent to change that if Emacs is built non self-contained. I
am a complete newcomer to changing Emacs "internals", so please forgive
me if this does not conform to emacs dev conventions.

If you decide against changing the behavior, I would find it helpful if
you included a hint in the documentation. This would spare users from
searching through Emacs.app/Contents/Info.plist,
~/.MacOSX/environment.plist or launchd.conf files, looking for the
definition of the INFOPATH.

Thanks!

-- 
Felix Mueller

Index: src/nsterm.m
===================================================================
RCS file: /sources/emacs/emacs/src/nsterm.m,v
retrieving revision 1.69
diff -u -r1.69 nsterm.m
--- src/nsterm.m        30 Apr 2009 16:52:19 -0000      1.69
+++ src/nsterm.m        3 May 2009 13:34:08 -0000
@@ -409,14 +409,6 @@
             setenv ("EMACSDOC", [resourcePath UTF8String], 1);
         }
     }
-
-  if (!getenv ("INFOPATH"))
-    {
-      resourcePath = [resourceDir stringByAppendingPathComponent: @"info"];
-      if ([fileManager fileExistsAtPath: resourcePath isDirectory: &isDir])
-        if (isDir)
-          setenv ("INFOPATH", [resourcePath UTF8String], 1);
-    }
 }
 
 
Index: lisp/term/ns-win.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/term/ns-win.el,v
retrieving revision 1.42
diff -u -r1.42 ns-win.el
--- lisp/term/ns-win.el 30 Apr 2009 18:01:40 -0000      1.42
+++ lisp/term/ns-win.el 3 May 2009 13:34:58 -0000
@@ -1266,6 +1266,20 @@
 (add-to-list 'frame-creation-function-alist '(ns . x-create-frame-with-faces))
 (add-to-list 'window-system-initialization-alist '(ns . 
ns-initialize-window-system))
 
+;;; 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.
+;;; (copied from w32-fns.el)
+(defun ns-init-info ()
+  (let* ((instdir (file-name-directory invocation-directory))
+        (dir1 (expand-file-name "../Resources/info/" instdir)))
+    (if (file-exists-p dir1)
+       (setq Info-default-directory-list
+             (append (list dir1) Info-default-directory-list)))))
+
+(add-hook 'before-init-hook 'ns-init-info)
 
 (provide 'ns-win)
 
Index: doc/emacs/macos.texi
===================================================================
RCS file: /sources/emacs/emacs/doc/emacs/macos.texi,v
retrieving revision 1.12
diff -u -r1.12 macos.texi
--- doc/emacs/macos.texi        2 May 2009 19:28:41 -0000       1.12
+++ doc/emacs/macos.texi        3 May 2009 13:32:33 -0000
@@ -31,7 +31,6 @@
 * Mac / GNUstep Customization:: Customizations under GNUstep or Mac OS.
 * Mac / GNUstep Events::        How window system events are handled.
 * GNUstep Support::             Details on status of GNUstep support
-* 
 @end menu
 
 @node Mac / GNUstep Basics, Mac / GNUstep Customization, , Mac OS / GNUstep
@@ -99,6 +98,10 @@
 of setting PATH is recommended on Mac OS X 10.5 and later, using the
 @file{/etc/paths} files and the @file{/etc/paths.d} directory.
 
+If the INFOPATH environment variable is not set during startup, Emacs
+sets it to @address@hidden/Resources/info}, thus
+rendering any changes to @code{Info-default-directory-list} in the
+initialization files ineffective.
 
 @node Mac / GNUstep Customization, Mac / GNUstep Events, Mac / GNUstep Basics, 
Mac OS / GNUstep
 @section Mac / GNUstep Customization

reply via email to

[Prev in Thread] Current Thread [Next in Thread]