always load from source directory
[bpt/emacs.git] / src / lread.c
index 6ecc733..fe285ad 100644 (file)
@@ -1813,17 +1813,12 @@ readevalloop (Lisp_Object readcharfun,
   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 form = Fcons (Qprogn, Qnil);
+  Lisp_Object tail = form;
+  Lisp_Object compile_fn = 0;
+
+  if (SCM_UNLIKELY (! compile_fn))
+    compile_fn = scm_c_public_ref ("language elisp runtime", "compile-elisp");
 
   if (MARKERP (readcharfun))
     {
@@ -1952,25 +1947,17 @@ readevalloop (Lisp_Object readcharfun,
       /* Restore saved point and BEGV.  */
       dynwind_end ();
 
-      //scm_display (val, SCM_UNDEFINED);
-      //scm_newline (SCM_UNDEFINED);
+      tail = Fsetcdr (tail, Fcons (val, Qnil));
 
-      /* Now eval what we just read.  */
-      if (!NILP (macroexpand))
-        val = readevalloop_eager_expand_eval (val, macroexpand);
-      else
-        val = eval_sub (val);
+      first_sexp = 0;
+    }
 
-      if (printflag)
-       {
-         Vvalues = Fcons (val, Vvalues);
-         if (EQ (Vstandard_output, Qt))
-           Fprin1 (val, Qnil);
-         else
-           Fprint (val, Qnil);
-       }
+  val = eval_sub (form);
 
-      first_sexp = 0;
+  if (SCM_UNLIKELY (printflag))
+    {
+      Vvalues = Fcons (val, Vvalues);
+      Fprin1 (val, Qnil);
     }
 
   build_load_history (sourcename,
@@ -4146,7 +4133,7 @@ load_path_default (void)
   const char *loadpath = ns_load_path ();
 #endif
 
-  normal = PATH_LOADSEARCH;
+  normal = PATH_DUMPLOADSEARCH;
 #ifdef HAVE_NS
   lpath = decode_env_path (0, loadpath ? loadpath : normal, 0);
 #else