Empty elements in EMACSLOADPATH now stand for the default
* src/lread.c (load_path_check): Take path to check as argument. (load_path_default): New, split from init_lread. (init_lread): Move calc of default load-path to load_path_default. Empty elements in EMACSLOADPATH now stand for the default. (load-path): Doc fix. * src/emacs.c (decode_env_path): Add option to treat empty elements as nil rather than ".". * src/callproc.c (init_callproc_1, init_callproc): * src/image.c (Vx_bitmap_file_path): * src/lisp.h (decode_env_path): * lread.c (Vsource_directory): Update for new argument spec of decode_env_path. * leim/Makefile.in (RUN_EMACS): Empty EMACSLOADPATH rather than unsetting. * lisp/Makefile.in (emacs): Empty EMACSLOADPATH rather than unsetting. * test/automated/Makefile.in (emacs): Empty EMACSLOADPATH rather than unsetting. * doc/emacs/cmdargs.texi (General Variables): Empty elements in EMACSLOADPATH now mean the default load-path. * doc/lispref/loading.texi (Library Search): Empty elements in EMACSLOADPATH now mean the default load-path. * etc/NEWS: Mention this. Fixes: debbugs:12100
This commit is contained in:
parent
72648ef260
commit
17e0445be4
17 changed files with 250 additions and 153 deletions
|
@ -1,3 +1,8 @@
|
|||
2013-11-23 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* cmdargs.texi (General Variables):
|
||||
Empty elements in EMACSLOADPATH now mean the default load-path.
|
||||
|
||||
2013-11-21 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* cmdargs.texi (Action Arguments): Use path-separator with -L.
|
||||
|
|
|
@ -455,13 +455,16 @@ This is used to initialize the variable @code{data-directory}.
|
|||
Directory for the documentation string file, which is used to
|
||||
initialize the Lisp variable @code{doc-directory}.
|
||||
@item EMACSLOADPATH
|
||||
A colon-separated list of directories@footnote{ Here and below,
|
||||
A colon-separated list of directories@footnote{Here and below,
|
||||
whenever we say ``colon-separated list of directories'', it pertains
|
||||
to Unix and GNU/Linux systems. On MS-DOS and MS-Windows, the
|
||||
directories are separated by semi-colons instead, since DOS/Windows
|
||||
file names might include a colon after a drive letter.} to search for
|
||||
Emacs Lisp files. If set, it overrides the usual initial value of the
|
||||
@code{load-path} variable (@pxref{Lisp Libraries}).
|
||||
file names might include a colon after a drive letter.} to search for
|
||||
Emacs Lisp files. If set, it modifies the usual initial value of the
|
||||
@code{load-path} variable (@pxref{Lisp Libraries}). An empty element
|
||||
stands for the default value of @code{load-path}; e.g., using
|
||||
@samp{EMACSLOADPATH="/tmp:"} adds @file{/tmp} to the front of
|
||||
the default @code{load-path}.
|
||||
@item EMACSPATH
|
||||
A colon-separated list of directories to search for executable files.
|
||||
If set, Emacs uses this in addition to @env{PATH} (see below) when
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2013-11-23 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* loading.texi (Library Search):
|
||||
Empty elements in EMACSLOADPATH now mean the default load-path.
|
||||
|
||||
2013-11-22 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* loading.texi (Library Search): Minor clarification.
|
||||
|
|
|
@ -310,25 +310,34 @@ directories, if they exist. Normally these directories do not contain
|
|||
@file{site-lisp} directories.)
|
||||
|
||||
@cindex @env{EMACSLOADPATH} environment variable
|
||||
If the environment variable @env{EMACSLOADPATH} is set, it overrides
|
||||
the above initialization procedure. That is, Emacs initializes
|
||||
@code{load-path} based solely on the value of the environment
|
||||
variable. You must therefore include the directory containing the
|
||||
standard Lisp files, else Emacs will not function. In most
|
||||
situations, it is better to use the @option{-L} command-line option
|
||||
(see below) to add elements to @code{load-path}.
|
||||
If the environment variable @env{EMACSLOADPATH} is set, it modifies
|
||||
the above initialization procedure. Emacs initializes
|
||||
@code{load-path} based on the value of the environment variable.
|
||||
|
||||
The syntax of @env{EMACSLOADPATH} is the same as used for @code{PATH};
|
||||
directory names are separated by @samp{:} (or @samp{;}, on some
|
||||
operating systems), and @samp{.} stands for the current default
|
||||
directory. Here is an example of how to set @env{EMACSLOADPATH}
|
||||
variable (from a @command{sh}-style shell):
|
||||
operating systems).
|
||||
@ignore
|
||||
@c AFAICS, does not (yet) work right to specify non-absolute elements.
|
||||
and @samp{.} stands for the current default directory.
|
||||
@end ignore
|
||||
Here is an example of how to set @env{EMACSLOADPATH} variable (from a
|
||||
@command{sh}-style shell):
|
||||
|
||||
@example
|
||||
export EMACSLOADPATH
|
||||
EMACSLOADPATH=/home/foo/.emacs.d/lisp:/usr/local/emacs/24.3/lisp
|
||||
export EMACSLOADPATH=/home/foo/.emacs.d/lisp:
|
||||
@end example
|
||||
|
||||
An empty element in the value of the environment variable, whether
|
||||
trailing (as in the above example), leading, or embedded, is replaced
|
||||
by the default value of @code{load-path} as determined by the standard
|
||||
initialization procedure. If there are no such empty elements, then
|
||||
@env{EMACSLOADPATH} specifies the entire @code{load-path}. You must
|
||||
include either an empty element, or the explicit path to the directory
|
||||
containing the standard Lisp files, else Emacs will not function.
|
||||
(Another way to modify @code{load-path} is to use the @option{-L}
|
||||
command-line option when starting Emacs; see below.)
|
||||
|
||||
For each directory in @code{load-path}, Emacs then checks to see if
|
||||
it contains a file @file{subdirs.el}, and if so, loads it. The
|
||||
@file{subdirs.el} file is created when Emacs is built/installed,
|
||||
|
|
10
etc/NEWS
10
etc/NEWS
|
@ -62,6 +62,16 @@ To use the old backend by default, do on the command line:
|
|||
|
||||
* Startup Changes in Emacs 24.4
|
||||
|
||||
+++
|
||||
** When initializing `load-path', an empty element in the EMACSLOADPATH
|
||||
environment variable (either leading, e.g., ":/foo"; trailing, e.g.,
|
||||
"/foo:"; or embedded, e.g., "/foo::/bar") is replaced with the default
|
||||
load-path (the one that would have been used if EMACSLOADPATH was unset).
|
||||
This makes it easier to _extend_ the load-path via EMACSLOADPATH
|
||||
(previously, EMACSLOADPATH had to specify the complete load-path,
|
||||
including the defaults). (In older versions of Emacs, an empty element
|
||||
was replaced by ".", so use an explicit "." now if that is what you want.)
|
||||
|
||||
+++
|
||||
** The -L option, which normally prepends its argument to load-path,
|
||||
will instead append, if the argument begins with `:' (or `;' on MS Windows;
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2013-11-23 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* Makefile.in (RUN_EMACS): Empty EMACSLOADPATH rather than unsetting.
|
||||
|
||||
2013-11-04 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* Makefile.in (RUN_EMACS): Don't set LC_ALL=C. (Bug#15260)
|
||||
|
|
|
@ -32,8 +32,7 @@ EMACS = ../src/emacs
|
|||
|
||||
# How to run Emacs.
|
||||
# Prevent any setting of EMACSLOADPATH in user environment causing problems.
|
||||
RUN_EMACS = unset EMACSLOADPATH; "${EMACS}" -batch \
|
||||
--no-site-file --no-site-lisp
|
||||
RUN_EMACS = EMACSLOADPATH= "${EMACS}" -batch --no-site-file --no-site-lisp
|
||||
|
||||
MKDIR_P = @MKDIR_P@
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2013-11-23 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* Makefile.in (emacs): Empty EMACSLOADPATH rather than unsetting.
|
||||
|
||||
2013-11-22 Leo Liu <sdl.web@gmail.com>
|
||||
|
||||
* progmodes/octave.el (inferior-octave-startup): Spit out error
|
||||
|
|
|
@ -106,7 +106,7 @@ COMPILE_FIRST = \
|
|||
|
||||
# The actual Emacs command run in the targets below.
|
||||
# Prevent any setting of EMACSLOADPATH in user environment causing problems.
|
||||
emacs = unset EMACSLOADPATH; "$(EMACS)" $(EMACSOPT)
|
||||
emacs = EMACSLOADPATH= "$(EMACS)" $(EMACSOPT)
|
||||
|
||||
# Common command to find subdirectories
|
||||
setwins=for file in `find . -type d -print`; do \
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
2013-11-23 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
Empty elements in EMACSLOADPATH stand for the default. (Bug#12100)
|
||||
* lread.c (load_path_check): Take path to check as argument.
|
||||
(load_path_default): New, split from init_lread.
|
||||
(init_lread): Move calc of default load-path to load_path_default.
|
||||
Empty elements in EMACSLOADPATH now stand for the default.
|
||||
(load-path): Doc fix.
|
||||
* emacs.c (decode_env_path): Add option to treat empty elements
|
||||
as nil rather than ".".
|
||||
* callproc.c (init_callproc_1, init_callproc):
|
||||
* image.c (Vx_bitmap_file_path):
|
||||
* lisp.h (decode_env_path):
|
||||
* lread.c (Vsource_directory):
|
||||
Update for new argument spec of decode_env_path.
|
||||
|
||||
2013-11-22 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* bidi.c (bidi_find_paragraph_start): Limit the returned positions
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Synchronous subprocess invocation for GNU Emacs.
|
||||
Copyright (C) 1985-1988, 1993-1995, 1999-2013
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 1985-1988, 1993-1995, 1999-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Emacs.
|
||||
|
||||
|
@ -1520,14 +1520,14 @@ init_callproc_1 (void)
|
|||
#ifdef HAVE_NS
|
||||
etc_dir ? etc_dir :
|
||||
#endif
|
||||
PATH_DATA);
|
||||
PATH_DATA, 0);
|
||||
Vdata_directory = Ffile_name_as_directory (Fcar (Vdata_directory));
|
||||
|
||||
Vdoc_directory = decode_env_path ("EMACSDOC",
|
||||
#ifdef HAVE_NS
|
||||
etc_dir ? etc_dir :
|
||||
#endif
|
||||
PATH_DOC);
|
||||
PATH_DOC, 0);
|
||||
Vdoc_directory = Ffile_name_as_directory (Fcar (Vdoc_directory));
|
||||
|
||||
/* Check the EMACSPATH environment variable, defaulting to the
|
||||
|
@ -1536,10 +1536,10 @@ init_callproc_1 (void)
|
|||
#ifdef HAVE_NS
|
||||
path_exec ? path_exec :
|
||||
#endif
|
||||
PATH_EXEC);
|
||||
PATH_EXEC, 0);
|
||||
Vexec_directory = Ffile_name_as_directory (Fcar (Vexec_path));
|
||||
/* FIXME? For ns, path_exec should go at the front? */
|
||||
Vexec_path = nconc2 (decode_env_path ("PATH", ""), Vexec_path);
|
||||
Vexec_path = nconc2 (decode_env_path ("PATH", "", 0), Vexec_path);
|
||||
}
|
||||
|
||||
/* This is run after init_cmdargs, when Vinstallation_directory is valid. */
|
||||
|
@ -1580,9 +1580,9 @@ init_callproc (void)
|
|||
#ifdef HAVE_NS
|
||||
path_exec ? path_exec :
|
||||
#endif
|
||||
PATH_EXEC);
|
||||
PATH_EXEC, 0);
|
||||
Vexec_path = Fcons (tem, Vexec_path);
|
||||
Vexec_path = nconc2 (decode_env_path ("PATH", ""), Vexec_path);
|
||||
Vexec_path = nconc2 (decode_env_path ("PATH", "", 0), Vexec_path);
|
||||
}
|
||||
|
||||
Vexec_directory = Ffile_name_as_directory (tem);
|
||||
|
|
55
src/emacs.c
55
src/emacs.c
|
@ -2167,10 +2167,13 @@ synchronize_system_messages_locale (void)
|
|||
|
||||
|
||||
Lisp_Object
|
||||
decode_env_path (const char *evarname, const char *defalt)
|
||||
decode_env_path (const char *evarname, const char *defalt, bool empty)
|
||||
{
|
||||
const char *path, *p;
|
||||
Lisp_Object lpath, element, tem;
|
||||
/* Default is to use "." for empty path elements.
|
||||
But if argument EMPTY is true, use nil instead. */
|
||||
Lisp_Object empty_element = empty ? Qnil : build_string (".");
|
||||
#ifdef WINDOWSNT
|
||||
bool defaulted = 0;
|
||||
const char *emacs_dir = egetenv ("emacs_dir");
|
||||
|
@ -2209,34 +2212,38 @@ decode_env_path (const char *evarname, const char *defalt)
|
|||
if (!p)
|
||||
p = path + strlen (path);
|
||||
element = (p - path ? make_unibyte_string (path, p - path)
|
||||
: build_string ("."));
|
||||
: empty_element);
|
||||
if (! NILP (element))
|
||||
{
|
||||
#ifdef WINDOWSNT
|
||||
/* Relative file names in the default path are interpreted as
|
||||
being relative to $emacs_dir. */
|
||||
if (emacs_dir && defaulted
|
||||
&& strncmp (path, emacs_dir_env, emacs_dir_len) == 0)
|
||||
element = Fexpand_file_name (Fsubstring (element,
|
||||
make_number (emacs_dir_len),
|
||||
Qnil),
|
||||
build_unibyte_string (emacs_dir));
|
||||
/* Relative file names in the default path are interpreted as
|
||||
being relative to $emacs_dir. */
|
||||
if (emacs_dir && defaulted
|
||||
&& strncmp (path, emacs_dir_env, emacs_dir_len) == 0)
|
||||
element = Fexpand_file_name (Fsubstring
|
||||
(element,
|
||||
make_number (emacs_dir_len),
|
||||
Qnil),
|
||||
build_unibyte_string (emacs_dir));
|
||||
#endif
|
||||
|
||||
/* Add /: to the front of the name
|
||||
if it would otherwise be treated as magic. */
|
||||
tem = Ffind_file_name_handler (element, Qt);
|
||||
/* Add /: to the front of the name
|
||||
if it would otherwise be treated as magic. */
|
||||
tem = Ffind_file_name_handler (element, Qt);
|
||||
|
||||
/* However, if the handler says "I'm safe",
|
||||
don't bother adding /:. */
|
||||
if (SYMBOLP (tem))
|
||||
{
|
||||
Lisp_Object prop;
|
||||
prop = Fget (tem, intern ("safe-magic"));
|
||||
if (! NILP (prop))
|
||||
tem = Qnil;
|
||||
}
|
||||
/* However, if the handler says "I'm safe",
|
||||
don't bother adding /:. */
|
||||
if (SYMBOLP (tem))
|
||||
{
|
||||
Lisp_Object prop;
|
||||
prop = Fget (tem, intern ("safe-magic"));
|
||||
if (! NILP (prop))
|
||||
tem = Qnil;
|
||||
}
|
||||
|
||||
if (! NILP (tem))
|
||||
element = concat2 (build_string ("/:"), element);
|
||||
if (! NILP (tem))
|
||||
element = concat2 (build_string ("/:"), element);
|
||||
} /* !NILP (element) */
|
||||
|
||||
lpath = Fcons (element, lpath);
|
||||
if (*p)
|
||||
|
|
|
@ -9502,7 +9502,7 @@ A cross is always drawn on black & white displays. */);
|
|||
|
||||
DEFVAR_LISP ("x-bitmap-file-path", Vx_bitmap_file_path,
|
||||
doc: /* List of directories to search for window system bitmap files. */);
|
||||
Vx_bitmap_file_path = decode_env_path (0, PATH_BITMAPS);
|
||||
Vx_bitmap_file_path = decode_env_path (0, PATH_BITMAPS, 0);
|
||||
|
||||
DEFVAR_LISP ("image-cache-eviction-delay", Vimage_cache_eviction_delay,
|
||||
doc: /* Maximum time after which images are removed from the cache.
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
/* Fundamental definitions for GNU Emacs Lisp interpreter.
|
||||
|
||||
Copyright (C) 1985-1987, 1993-1995, 1997-2013 Free Software Foundation,
|
||||
Inc.
|
||||
Copyright (C) 1985-1987, 1993-1995, 1997-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Emacs.
|
||||
|
||||
|
@ -4058,7 +4057,7 @@ extern int initial_argc;
|
|||
#if defined (HAVE_X_WINDOWS) || defined (HAVE_NS)
|
||||
extern bool display_arg;
|
||||
#endif
|
||||
extern Lisp_Object decode_env_path (const char *, const char *);
|
||||
extern Lisp_Object decode_env_path (const char *, const char *, bool);
|
||||
extern Lisp_Object empty_unibyte_string, empty_multibyte_string;
|
||||
extern Lisp_Object Qfile_name_handler_alist;
|
||||
extern _Noreturn void terminate_due_to_signal (int, int);
|
||||
|
|
224
src/lread.c
224
src/lread.c
|
@ -1,7 +1,6 @@
|
|||
/* Lisp parsing and input streams.
|
||||
|
||||
Copyright (C) 1985-1989, 1993-1995, 1997-2013 Free Software Foundation,
|
||||
Inc.
|
||||
Copyright (C) 1985-1989, 1993-1995, 1997-2013 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Emacs.
|
||||
|
||||
|
@ -4106,17 +4105,17 @@ defvar_kboard (struct Lisp_Kboard_Objfwd *ko_fwd,
|
|||
SET_SYMBOL_FWD (XSYMBOL (sym), (union Lisp_Fwd *)ko_fwd);
|
||||
}
|
||||
|
||||
/* Check that the elements of Vload_path exist. */
|
||||
/* Check that the elements of lpath exist. */
|
||||
|
||||
static void
|
||||
load_path_check (void)
|
||||
load_path_check (Lisp_Object lpath)
|
||||
{
|
||||
Lisp_Object path_tail;
|
||||
|
||||
/* The only elements that might not exist are those from
|
||||
PATH_LOADSEARCH, EMACSLOADPATH. Anything else is only added if
|
||||
it exists. */
|
||||
for (path_tail = Vload_path; !NILP (path_tail); path_tail = XCDR (path_tail))
|
||||
for (path_tail = lpath; !NILP (path_tail); path_tail = XCDR (path_tail))
|
||||
{
|
||||
Lisp_Object dirfile;
|
||||
dirfile = Fcar (path_tail);
|
||||
|
@ -4133,19 +4132,23 @@ load_path_check (void)
|
|||
so we can see if the site changed it later during dumping. */
|
||||
static Lisp_Object dump_path;
|
||||
|
||||
/* Compute the default Vload_path, with the following logic:
|
||||
If CANNOT_DUMP:
|
||||
use EMACSLOADPATH env-var if set; otherwise use PATH_LOADSEARCH,
|
||||
prepending PATH_SITELOADSEARCH unless --no-site-lisp.
|
||||
/* Return the default load-path, to be used if EMACSLOADPATH is unset.
|
||||
This does not include the standard site-lisp directories
|
||||
under the installation prefix (i.e., PATH_SITELOADSEARCH),
|
||||
but it does (unless no_site_lisp is set) include site-lisp
|
||||
directories in the source/build directories if those exist and we
|
||||
are running uninstalled.
|
||||
|
||||
Uses the following logic:
|
||||
If CANNOT_DUMP: Use PATH_LOADSEARCH.
|
||||
The remainder is what happens when dumping works:
|
||||
If purify-flag (ie dumping) just use PATH_DUMPLOADSEARCH.
|
||||
Otherwise use EMACSLOADPATH if set, else PATH_LOADSEARCH.
|
||||
Otherwise use PATH_LOADSEARCH.
|
||||
|
||||
If !initialized, then just set both Vload_path and dump_path.
|
||||
If initialized, then if Vload_path != dump_path, do nothing.
|
||||
If !initialized, then just set dump_path and return PATH_DUMPLOADSEARCH.
|
||||
If initialized, then if Vload_path != dump_path, return just Vload_path.
|
||||
(Presumably the load-path has already been changed by something.
|
||||
This can only be from a site-load file during dumping,
|
||||
or because EMACSLOADPATH is set.)
|
||||
This can only be from a site-load file during dumping.)
|
||||
If Vinstallation_directory is not nil (ie, running uninstalled):
|
||||
If installation-dir/lisp exists and not already a member,
|
||||
we must be running uninstalled. Reset the load-path
|
||||
|
@ -4162,12 +4165,11 @@ static Lisp_Object dump_path;
|
|||
install-dir/src/Makefile.in does NOT exist (this is a sanity
|
||||
check), then repeat the above steps for source-dir/lisp,
|
||||
leim and site-lisp.
|
||||
Finally, add the site-lisp directories at the front (if !no_site_lisp).
|
||||
*/
|
||||
|
||||
void
|
||||
init_lread (void)
|
||||
Lisp_Object
|
||||
load_path_default (bool ignore_existing)
|
||||
{
|
||||
Lisp_Object lpath = Qnil;
|
||||
const char *normal;
|
||||
|
||||
#ifdef CANNOT_DUMP
|
||||
|
@ -4177,35 +4179,14 @@ init_lread (void)
|
|||
|
||||
normal = PATH_LOADSEARCH;
|
||||
#ifdef HAVE_NS
|
||||
Vload_path = decode_env_path ("EMACSLOADPATH", loadpath ? loadpath : normal);
|
||||
lpath = decode_env_path (0, loadpath ? loadpath : normal, 0);
|
||||
#else
|
||||
Vload_path = decode_env_path ("EMACSLOADPATH", normal);
|
||||
lpath = decode_env_path (0, normal, 0);
|
||||
#endif
|
||||
|
||||
load_path_check ();
|
||||
|
||||
/* FIXME CANNOT_DUMP platforms should get source-dir/lisp etc added
|
||||
to their load-path too, AFAICS. I don't think we can tell the
|
||||
difference between initialized and !initialized in this case,
|
||||
so we'll have to do it unconditionally when Vinstallation_directory
|
||||
is non-nil. */
|
||||
if (!no_site_lisp && !egetenv ("EMACSLOADPATH"))
|
||||
{
|
||||
Lisp_Object sitelisp;
|
||||
sitelisp = decode_env_path (0, PATH_SITELOADSEARCH);
|
||||
if (! NILP (sitelisp)) Vload_path = nconc2 (sitelisp, Vload_path);
|
||||
}
|
||||
#else /* !CANNOT_DUMP */
|
||||
if (NILP (Vpurify_flag))
|
||||
{
|
||||
normal = PATH_LOADSEARCH;
|
||||
/* If the EMACSLOADPATH environment variable is set, use its value.
|
||||
This doesn't apply if we're dumping. */
|
||||
if (egetenv ("EMACSLOADPATH"))
|
||||
Vload_path = decode_env_path ("EMACSLOADPATH", normal);
|
||||
}
|
||||
else
|
||||
normal = PATH_DUMPLOADSEARCH;
|
||||
|
||||
normal = NILP (Vpurify_flag) ? PATH_LOADSEARCH : PATH_DUMPLOADSEARCH;
|
||||
|
||||
/* In a dumped Emacs, we normally reset the value of Vload_path using
|
||||
PATH_LOADSEARCH, since the value that was dumped uses lisp/ in
|
||||
|
@ -4216,24 +4197,22 @@ init_lread (void)
|
|||
site-lisp files that were processed during dumping. */
|
||||
if (initialized)
|
||||
{
|
||||
if (NILP (Fequal (dump_path, Vload_path)))
|
||||
if (!ignore_existing && NILP (Fequal (dump_path, Vload_path)))
|
||||
{
|
||||
/* Do not make any changes, just check the elements exist. */
|
||||
/* Note: --no-site-lisp is ignored.
|
||||
I don't know what to do about this. */
|
||||
load_path_check ();
|
||||
/* Do not make any changes. */
|
||||
return Vload_path;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
#ifdef HAVE_NS
|
||||
const char *loadpath = ns_load_path ();
|
||||
Vload_path = decode_env_path (0, loadpath ? loadpath : normal);
|
||||
const char *loadpath = ns_load_path ();
|
||||
lpath = decode_env_path (0, loadpath ? loadpath : normal, 0);
|
||||
#else
|
||||
Vload_path = decode_env_path (0, normal);
|
||||
lpath = decode_env_path (0, normal, 0);
|
||||
#endif
|
||||
if (!NILP (Vinstallation_directory))
|
||||
{
|
||||
Lisp_Object tem, tem1;
|
||||
if (!NILP (Vinstallation_directory))
|
||||
{
|
||||
Lisp_Object tem, tem1;
|
||||
|
||||
/* Add to the path the lisp subdir of the installation
|
||||
dir, if it is accessible. Note: in out-of-tree builds,
|
||||
|
@ -4243,19 +4222,19 @@ init_lread (void)
|
|||
tem1 = Ffile_accessible_directory_p (tem);
|
||||
if (!NILP (tem1))
|
||||
{
|
||||
if (NILP (Fmember (tem, Vload_path)))
|
||||
if (NILP (Fmember (tem, lpath)))
|
||||
{
|
||||
/* We are running uninstalled. The default load-path
|
||||
points to the eventual installed lisp, leim
|
||||
directories. We should not use those now, even
|
||||
if they exist, so start over from a clean slate. */
|
||||
Vload_path = list1 (tem);
|
||||
lpath = list1 (tem);
|
||||
}
|
||||
}
|
||||
else
|
||||
/* That dir doesn't exist, so add the build-time
|
||||
Lisp dirs instead. */
|
||||
Vload_path = nconc2 (Vload_path, dump_path);
|
||||
lpath = nconc2 (lpath, dump_path);
|
||||
|
||||
/* Add leim under the installation dir, if it is accessible. */
|
||||
tem = Fexpand_file_name (build_string ("leim"),
|
||||
|
@ -4263,8 +4242,8 @@ init_lread (void)
|
|||
tem1 = Ffile_accessible_directory_p (tem);
|
||||
if (!NILP (tem1))
|
||||
{
|
||||
if (NILP (Fmember (tem, Vload_path)))
|
||||
Vload_path = Fcons (tem, Vload_path);
|
||||
if (NILP (Fmember (tem, lpath)))
|
||||
lpath = Fcons (tem, lpath);
|
||||
}
|
||||
|
||||
/* Add site-lisp under the installation dir, if it exists. */
|
||||
|
@ -4275,8 +4254,8 @@ init_lread (void)
|
|||
tem1 = Ffile_accessible_directory_p (tem);
|
||||
if (!NILP (tem1))
|
||||
{
|
||||
if (NILP (Fmember (tem, Vload_path)))
|
||||
Vload_path = Fcons (tem, Vload_path);
|
||||
if (NILP (Fmember (tem, lpath)))
|
||||
lpath = Fcons (tem, lpath);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4304,14 +4283,14 @@ init_lread (void)
|
|||
tem = Fexpand_file_name (build_string ("lisp"),
|
||||
Vsource_directory);
|
||||
|
||||
if (NILP (Fmember (tem, Vload_path)))
|
||||
Vload_path = Fcons (tem, Vload_path);
|
||||
if (NILP (Fmember (tem, lpath)))
|
||||
lpath = Fcons (tem, lpath);
|
||||
|
||||
tem = Fexpand_file_name (build_string ("leim"),
|
||||
Vsource_directory);
|
||||
|
||||
if (NILP (Fmember (tem, Vload_path)))
|
||||
Vload_path = Fcons (tem, Vload_path);
|
||||
if (NILP (Fmember (tem, lpath)))
|
||||
lpath = Fcons (tem, lpath);
|
||||
|
||||
if (!no_site_lisp)
|
||||
{
|
||||
|
@ -4320,47 +4299,101 @@ init_lread (void)
|
|||
tem1 = Ffile_accessible_directory_p (tem);
|
||||
if (!NILP (tem1))
|
||||
{
|
||||
if (NILP (Fmember (tem, Vload_path)))
|
||||
Vload_path = Fcons (tem, Vload_path);
|
||||
if (NILP (Fmember (tem, lpath)))
|
||||
lpath = Fcons (tem, lpath);
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* Vinstallation_directory != Vsource_directory */
|
||||
|
||||
} /* if Vinstallation_directory */
|
||||
} /* if Vinstallation_directory */
|
||||
|
||||
/* Check before adding the site-lisp directories.
|
||||
The install should have created them, but they are not
|
||||
required, so no need to warn if they are absent.
|
||||
Or we might be running before installation. */
|
||||
load_path_check ();
|
||||
|
||||
/* Add the site-lisp directories at the front. */
|
||||
if (!no_site_lisp)
|
||||
{
|
||||
Lisp_Object sitelisp;
|
||||
sitelisp = decode_env_path (0, PATH_SITELOADSEARCH);
|
||||
if (! NILP (sitelisp)) Vload_path = nconc2 (sitelisp, Vload_path);
|
||||
}
|
||||
} /* if dump_path == Vload_path */
|
||||
} /* if dump_path == Vload_path */
|
||||
}
|
||||
else /* !initialized */
|
||||
{
|
||||
/* NORMAL refers to PATH_DUMPLOADSEARCH, ie the lisp dir in the
|
||||
source directory. We used to add ../lisp (ie the lisp dir in
|
||||
the build directory) at the front here, but that caused trouble
|
||||
because it was copied from dump_path into Vload_path, above,
|
||||
when Vinstallation_directory was non-nil. It should not be
|
||||
because it was copied from dump_path into Vload_path, above,
|
||||
when Vinstallation_directory was non-nil. It should not be
|
||||
necessary, since in out of tree builds lisp/ is empty, save
|
||||
for Makefile. */
|
||||
Vload_path = decode_env_path (0, normal);
|
||||
dump_path = Vload_path;
|
||||
/* No point calling load_path_check; load-path only contains essential
|
||||
elements from the source directory at this point. They cannot
|
||||
be missing unless something went extremely (and improbably)
|
||||
wrong, in which case the build will fail in obvious ways. */
|
||||
lpath = decode_env_path (0, normal, 0);
|
||||
dump_path = lpath;
|
||||
}
|
||||
#endif /* !CANNOT_DUMP */
|
||||
#endif /* !CANNOT_DUMP */
|
||||
|
||||
return lpath;
|
||||
}
|
||||
|
||||
void
|
||||
init_lread (void)
|
||||
{
|
||||
/* First, set Vload_path. */
|
||||
|
||||
/* We explicitly ignore EMACSLOADPATH when dumping. */
|
||||
if (NILP (Vpurify_flag) && egetenv ("EMACSLOADPATH"))
|
||||
{
|
||||
Vload_path = decode_env_path ("EMACSLOADPATH", 0, 1);
|
||||
|
||||
/* Check (non-nil) user-supplied elements. */
|
||||
load_path_check (Vload_path);
|
||||
|
||||
/* Replace any nil elements from the environment with the default. */
|
||||
if (Fmemq (Qnil, Vload_path))
|
||||
{
|
||||
Lisp_Object lpath = Vload_path;
|
||||
Lisp_Object elem, default_lpath = load_path_default (1);
|
||||
|
||||
/* Check defaults, before adding site-lisp. */
|
||||
load_path_check (default_lpath);
|
||||
|
||||
/* Add the site-lisp directories to the front of the default. */
|
||||
if (!no_site_lisp)
|
||||
{
|
||||
Lisp_Object sitelisp;
|
||||
sitelisp = decode_env_path (0, PATH_SITELOADSEARCH, 0);
|
||||
if (! NILP (sitelisp))
|
||||
default_lpath = nconc2 (sitelisp, default_lpath);
|
||||
}
|
||||
|
||||
Vload_path = Qnil;
|
||||
|
||||
/* Replace nils from EMACSLOADPATH by default. */
|
||||
while (CONSP (lpath))
|
||||
{
|
||||
Lisp_Object arg[2];
|
||||
elem = XCAR (lpath);
|
||||
lpath = XCDR (lpath);
|
||||
arg[0] = Vload_path;
|
||||
arg[1] = NILP (elem) ? default_lpath : Fcons (elem, Qnil);
|
||||
Vload_path = Fappend (2, arg);
|
||||
}
|
||||
} /* Fmemq (Qnil, Vload_path) */
|
||||
}
|
||||
else /* Vpurify_flag || !EMACSLOADPATH */
|
||||
{
|
||||
Vload_path = load_path_default (0);
|
||||
|
||||
/* Check before adding site-lisp directories.
|
||||
The install should have created them, but they are not
|
||||
required, so no need to warn if they are absent.
|
||||
Or we might be running before installation. */
|
||||
load_path_check (Vload_path);
|
||||
|
||||
/* Add the site-lisp directories at the front, unless the
|
||||
load-path has somehow already been changed (this can only be
|
||||
from a site-load file during dumping?) from the dumped value.
|
||||
FIXME? Should we ignore any dump_path changes? */
|
||||
if (initialized && !no_site_lisp &&
|
||||
! NILP (Fequal (dump_path, Vload_path)))
|
||||
{
|
||||
Lisp_Object sitelisp;
|
||||
sitelisp = decode_env_path (0, PATH_SITELOADSEARCH, 0);
|
||||
if (! NILP (sitelisp)) Vload_path = nconc2 (sitelisp, Vload_path);
|
||||
}
|
||||
} /* !Vpurify_flag && EMACSLOADPATH */
|
||||
|
||||
Vvalues = Qnil;
|
||||
|
||||
|
@ -4467,9 +4500,8 @@ were read in. */);
|
|||
|
||||
DEFVAR_LISP ("load-path", Vload_path,
|
||||
doc: /* List of directories to search for files to load.
|
||||
Each element is a string (directory name) or nil (try default directory).
|
||||
Initialized based on EMACSLOADPATH environment variable, if any,
|
||||
otherwise to default specified by file `epaths.h' when Emacs was built. */);
|
||||
Each element is a string (directory name) or nil (meaning `default-directory').
|
||||
Initialized during startup as described in Info node `(elisp)Library Search'. */);
|
||||
|
||||
DEFVAR_LISP ("load-suffixes", Vload_suffixes,
|
||||
doc: /* List of suffixes for (compiled or source) Emacs Lisp files.
|
||||
|
@ -4585,7 +4617,7 @@ and is not meant for users to change. */);
|
|||
You cannot count on them to still be there! */);
|
||||
Vsource_directory
|
||||
= Fexpand_file_name (build_string ("../"),
|
||||
Fcar (decode_env_path (0, PATH_DUMPLOADSEARCH)));
|
||||
Fcar (decode_env_path (0, PATH_DUMPLOADSEARCH, 0)));
|
||||
|
||||
DEFVAR_LISP ("preloaded-file-list", Vpreloaded_file_list,
|
||||
doc: /* List of files that were preloaded (when dumping Emacs). */);
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2013-11-23 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* automated/Makefile.in (emacs):
|
||||
Empty EMACSLOADPATH rather than unsetting.
|
||||
|
||||
2013-11-22 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* automated/ruby-mode-tests.el (ruby-exit!-font-lock):
|
||||
|
|
|
@ -43,8 +43,7 @@ BYTE_COMPILE_EXTRA_FLAGS =
|
|||
|
||||
# The actual Emacs command run in the targets below.
|
||||
# Prevent any setting of EMACSLOADPATH in user environment causing problems.
|
||||
emacs = unset EMACSLOADPATH; \
|
||||
LC_ALL=C EMACS_TEST_DIRECTORY=$(srcdir) "$(EMACS)" $(EMACSOPT)
|
||||
emacs = EMACSLOADPATH= LC_ALL=C EMACS_TEST_DIRECTORY=$(srcdir) "$(EMACS)" $(EMACSOPT)
|
||||
|
||||
# Common command to find subdirectories
|
||||
setwins=for file in `find $(srcdir) -type d -print`; do \
|
||||
|
|
Loading…
Add table
Reference in a new issue