aboutsummaryrefslogtreecommitdiffstats
path: root/src/lread.c
diff options
context:
space:
mode:
authorGlenn Morris2012-07-09 21:04:28 -0400
committerGlenn Morris2012-07-09 21:04:28 -0400
commit9e059e3fde0f95b0b06ebce10f2985201e54c11c (patch)
treee52878b1f1fff02dee5b327ab042c35de9ac3f87 /src/lread.c
parent4107c81e8926223bc8f2c50f4436d8a36d6d5914 (diff)
downloademacs-9e059e3fde0f95b0b06ebce10f2985201e54c11c.tar.gz
emacs-9e059e3fde0f95b0b06ebce10f2985201e54c11c.zip
Stop ns builds setting the EMACSLOADPATH environment variable
Ref bugs 4309, 6401, etc. This is the last environment variable (ab)used by the ns port in this way. * src/nsterm.m (ns_load_path): Rename from ns_init_paths. Now it does not set EMACSLOADPATH, just returns the load-path string. * src/nsterm.h: Update accordingly. * src/lread.c [HAVE_NS]: Include nsterm.h. (init_lread) [HAVE_NS]: Use ns_load_path. * src/emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/lread.c b/src/lread.c
index 6b6231a8f11..c69190c37b6 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -45,6 +45,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
45#include "msdos.h" 45#include "msdos.h"
46#endif 46#endif
47 47
48#ifdef HAVE_NS
49#include "nsterm.h"
50#endif
51
48#include <unistd.h> 52#include <unistd.h>
49#include <math.h> 53#include <math.h>
50 54
@@ -4125,8 +4129,16 @@ init_lread (void)
4125 const char *normal; 4129 const char *normal;
4126 4130
4127#ifdef CANNOT_DUMP 4131#ifdef CANNOT_DUMP
4132#ifdef HAVE_NS
4133 const char *loadpath = ns_load_path ();
4134#endif
4135
4128 normal = PATH_LOADSEARCH; 4136 normal = PATH_LOADSEARCH;
4137#ifdef HAVE_NS
4138 Vload_path = decode_env_path ("EMACSLOADPATH", loadpath ? loadpath : normal);
4139#else
4129 Vload_path = decode_env_path ("EMACSLOADPATH", normal); 4140 Vload_path = decode_env_path ("EMACSLOADPATH", normal);
4141#endif
4130 4142
4131 load_path_check (); 4143 load_path_check ();
4132 4144
@@ -4135,7 +4147,12 @@ init_lread (void)
4135 difference between initialized and !initialized in this case, 4147 difference between initialized and !initialized in this case,
4136 so we'll have to do it unconditionally when Vinstallation_directory 4148 so we'll have to do it unconditionally when Vinstallation_directory
4137 is non-nil. */ 4149 is non-nil. */
4150#ifdef HAVE_NS
4151 /* loadpath already includes the app-bundle's site-lisp. */
4152 if (!no_site_lisp && !egetenv ("EMACSLOADPATH") && !loadpath)
4153#else
4138 if (!no_site_lisp && !egetenv ("EMACSLOADPATH")) 4154 if (!no_site_lisp && !egetenv ("EMACSLOADPATH"))
4155#endif
4139 { 4156 {
4140 Lisp_Object sitelisp; 4157 Lisp_Object sitelisp;
4141 sitelisp = decode_env_path (0, PATH_SITELOADSEARCH); 4158 sitelisp = decode_env_path (0, PATH_SITELOADSEARCH);
@@ -4171,7 +4188,12 @@ init_lread (void)
4171 } 4188 }
4172 else 4189 else
4173 { 4190 {
4191#ifdef HAVE_NS
4192 const char *loadpath = ns_load_path ();
4193 Vload_path = decode_env_path (0, loadpath ? loadpath : normal);
4194#else
4174 Vload_path = decode_env_path (0, normal); 4195 Vload_path = decode_env_path (0, normal);
4196#endif
4175 if (!NILP (Vinstallation_directory)) 4197 if (!NILP (Vinstallation_directory))
4176 { 4198 {
4177 Lisp_Object tem, tem1; 4199 Lisp_Object tem, tem1;
@@ -4274,7 +4296,12 @@ init_lread (void)
4274 load_path_check (); 4296 load_path_check ();
4275 4297
4276 /* Add the site-lisp directories at the front. */ 4298 /* Add the site-lisp directories at the front. */
4299#ifdef HAVE_NS
4300 /* loadpath already includes the app-bundle's site-lisp. */
4301 if (!no_site_lisp && !loadpath)
4302#else
4277 if (!no_site_lisp) 4303 if (!no_site_lisp)
4304#endif
4278 { 4305 {
4279 Lisp_Object sitelisp; 4306 Lisp_Object sitelisp;
4280 sitelisp = decode_env_path (0, PATH_SITELOADSEARCH); 4307 sitelisp = decode_env_path (0, PATH_SITELOADSEARCH);