#include "frame.h"
#include "termhooks.h"
#include "blockinput.h"
+#include "guile.h"
#ifdef MSDOS
#include "msdos.h"
bool whole_buffer = 0;
/* True on the first time around. */
bool first_sexp = 1;
- Lisp_Object macroexpand = intern ("internal-macroexpand-for-load");
-
- if (NILP (Ffboundp (macroexpand))
- /* Don't macroexpand in .elc files, since it should have been done
- already. We actually don't know whether we're in a .elc file or not,
- so we use circumstantial evidence: .el files normally go through
- Vload_source_file_function -> load-with-code-conversion
- -> eval-buffer. */
- || EQ (readcharfun, Qget_file_char)
- || EQ (readcharfun, Qget_emacs_mule_file_char))
- macroexpand = Qnil;
+ Lisp_Object compile_fn = 0;
if (MARKERP (readcharfun))
{
/* Restore saved point and BEGV. */
dynwind_end ();
- //scm_display (val, SCM_UNDEFINED);
- //scm_newline (SCM_UNDEFINED);
-
- /* Now eval what we just read. */
- if (!NILP (macroexpand))
- val = readevalloop_eager_expand_eval (val, macroexpand);
- else
- val = eval_sub (val);
+ val = eval_sub (val);
if (printflag)
{
return (scm_is_true (scm_unintern (name, obhash (obarray))) ? Qt : Qnil);
}
\f
+struct map_obarray_data
+{
+ Lisp_Object obarray;
+ void (*fn) (Lisp_Object, Lisp_Object);
+ Lisp_Object arg;
+};
+
+static Lisp_Object
+map_obarray_inner (void *data, Lisp_Object sym)
+{
+ struct map_obarray_data *modata = data;
+
+ Lisp_Object tem = Ffind_symbol (SYMBOL_NAME (sym), modata->obarray);
+ if (scm_is_true (scm_c_value_ref (tem, 1))
+ && EQ (sym, scm_c_value_ref (tem, 0)))
+ modata->fn (sym, modata->arg);
+ return SCM_UNSPECIFIED;
+}
+
void
map_obarray (Lisp_Object obarray, void (*fn) (Lisp_Object, Lisp_Object), Lisp_Object arg)
{
- Lisp_Object proc (Lisp_Object sym)
- {
- Lisp_Object tem = Ffind_symbol (SYMBOL_NAME (sym), obarray);
- if (scm_is_true (scm_c_value_ref (tem, 1))
- && EQ (sym, scm_c_value_ref (tem, 0)))
- fn (sym, arg);
- return SCM_UNSPECIFIED;
- }
+ struct map_obarray_data data = { .obarray = obarray,
+ .fn = fn,
+ .arg = arg };
+
CHECK_VECTOR (obarray);
- scm_obarray_for_each (scm_c_make_gsubr ("proc", 1, 0, 0, proc),
+ scm_obarray_for_each (make_c_closure (map_obarray_inner, &data, 1, 0),
obhash (obarray));
}
{
Lisp_Object lpath = Qnil;
const char *normal;
+ bool initialized_or_cannot_dump;
#ifdef CANNOT_DUMP
-#ifdef HAVE_NS
- const char *loadpath = ns_load_path ();
-#endif
-
+ initialized_or_cannot_dump = true;
normal = PATH_LOADSEARCH;
-#ifdef HAVE_NS
- lpath = decode_env_path (0, loadpath ? loadpath : normal, 0);
#else
- lpath = decode_env_path (0, normal, 0);
-#endif
-
-#else /* !CANNOT_DUMP */
-
+ initialized_or_cannot_dump = initialized;
normal = NILP (Vpurify_flag) ? PATH_LOADSEARCH : PATH_DUMPLOADSEARCH;
+#endif
- if (initialized)
+ if (initialized_or_cannot_dump)
{
#ifdef HAVE_NS
const char *loadpath = ns_load_path ();
} /* if Vinstallation_directory */
}
- else /* !initialized */
+ else /* !initialized_or_cannot_dump */
{
/* NORMAL refers to PATH_DUMPLOADSEARCH, ie the lisp dir in the
source directory. We used to add ../lisp (ie the lisp dir in
for Makefile. */
lpath = decode_env_path (0, normal, 0);
}
-#endif /* !CANNOT_DUMP */
return lpath;
}
void
init_lread (void)
{
- /* First, set Vload_path. */
+ /* Set Vsource_directory before calling load_path_default. */
+ Vsource_directory
+ = Fexpand_file_name (build_string ("../"),
+ Fcar (decode_env_path (0, PATH_DUMPLOADSEARCH, 0)));
+
+ /* Set Vload_path. */
/* Ignore EMACSLOADPATH when dumping. */
#ifdef CANNOT_DUMP
This list should not include the empty string.
`load' and related functions try to append these suffixes, in order,
to the specified file name if a Lisp suffix is allowed or required. */);
- Vload_suffixes = list2 (build_pure_c_string (".elc"),
- build_pure_c_string (".el"));
+ Vload_suffixes = list1 (build_pure_c_string (".el"));
DEFVAR_LISP ("load-file-rep-suffixes", Vload_file_rep_suffixes,
doc: /* List of suffixes that indicate representations of \
the same file.
DEFVAR_LISP ("source-directory", Vsource_directory,
doc: /* Directory in which Emacs sources were found when Emacs was built.
You cannot count on them to still be there! */);
- Vsource_directory
- = Fexpand_file_name (build_string ("../"),
- 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). */);