#include "buffer.h"
#include "bytecode.h"
-#include "elhash.h"
+#include "commands.h"
+#include "insdel.h"
#include "lstream.h"
#include "opaque.h"
+#include <paths.h>
#ifdef FILE_CODING
#include "file-coding.h"
#endif
/* Whether Fload_internal() should ignore .elc files when no suffix is given */
int load_ignore_elc_files;
+/* Directory in which the sources were found. */
+Lisp_Object Vsource_directory;
+
/* Search path for files to be loaded. */
Lisp_Object Vload_path;
something to `funcall', but who would really do that? As
they say in law, we've made a "good-faith effort" to
unfuckify ourselves. And doing it this way avoids screwing
- up args to `make-hash-table' and such. As it is, we have to
+ up args to `make-hashtable' and such. As it is, we have to
add an extra Ebola check in decode_weak_list_type(). --ben */
- if (EQ (el, Qassoc)) el = Qold_assoc;
- else if (EQ (el, Qdelq)) el = Qold_delq;
+ if (EQ (el, Qassoc))
+ el = Qold_assoc;
+ if (EQ (el, Qdelq))
+ el = Qold_delq;
#if 0
/* I think this is a bad idea because it will probably mess
with keymap code. */
- else if (EQ (el, Qdelete)) el = Qold_delete;
+ if (EQ (el, Qdelete))
+ el = Qold_delete;
#endif
- else if (EQ (el, Qrassq)) el = Qold_rassq;
- else if (EQ (el, Qrassoc)) el = Qold_rassoc;
-
+ if (EQ (el, Qrassq))
+ el = Qold_rassq;
+ if (EQ (el, Qrassoc))
+ el = Qold_rassoc;
XVECTOR_DATA (vector)[i] = el;
}
}
Lisp_Object doc;
assert (COMPILED_FUNCTIONP (john));
- if (CONSP (XCOMPILED_FUNCTION (john)->instructions))
+ if (CONSP (XCOMPILED_FUNCTION (john)->bytecodes))
{
struct gcpro ngcpro1;
Lisp_Object juan = (pas_de_lache_ici
- (fd, XCOMPILED_FUNCTION (john)->instructions));
+ (fd, XCOMPILED_FUNCTION (john)->bytecodes));
Lisp_Object ivan;
NGCPRO1 (juan);
if (!CONSP (ivan))
signal_simple_error ("invalid lazy-loaded byte code", ivan);
/* Remember to purecopy; see above. */
- XCOMPILED_FUNCTION (john)->instructions = Fpurecopy (XCAR (ivan));
+ XCOMPILED_FUNCTION (john)->bytecodes = Fpurecopy (XCAR (ivan));
/* v18 or v19 bytecode file. Need to Ebolify. */
if (XCOMPILED_FUNCTION (john)->flags.ebolified
&& VECTORP (XCDR (ivan)))
if (purify_flag && noninteractive)
{
if (EQ (last_file_loaded, file))
- message_append (" (%ld)",
- (unsigned long) (purespace_usage() - pure_usage));
+ message_append (" (%d)", purespace_usage() - pure_usage);
else
- message ("Loading %s ...done (%ld)", XSTRING_DATA (file),
- (unsigned long) (purespace_usage() - pure_usage));
+ message ("Loading %s ...done (%d)", XSTRING_DATA (file),
+ purespace_usage() - pure_usage);
}
/*#endif / * DEBUG_XEMACS */
if (!NILP (mode))
CHECK_NATNUM (mode);
- locate_file (path_list,
- filename,
- NILP (suffixes) ? "" : (char *) XSTRING_DATA (suffixes),
- &tp,
- NILP (mode) ? R_OK : XINT (mode));
+ locate_file (path_list, filename,
+ ((NILP (suffixes)) ? "" :
+ (char *) (XSTRING_DATA (suffixes))),
+ &tp, (NILP (mode) ? R_OK : XINT (mode)));
return tp;
}
static Lisp_Object
locate_file_refresh_hashing (Lisp_Object str)
{
- Lisp_Object hash = make_directory_hash_table ((char *) XSTRING_DATA (str));
+ Lisp_Object hash =
+ make_directory_hash_table ((char *) XSTRING_DATA (str));
Fput (str, Qlocate_file_hash_table, hash);
return hash;
}
locate_file_find_directory_hash_table (Lisp_Object str)
{
Lisp_Object hash = Fget (str, Qlocate_file_hash_table, Qnil);
- if (! HASH_TABLEP (hash))
+ if (NILP (Fhashtablep (hash)))
return locate_file_refresh_hashing (str);
return hash;
}
default-directory to be something non-absolute ... */
{
if (NILP (filename))
- /* NIL means current directory */
+ /* NIL means current dirctory */
filename = current_buffer->directory;
else
filename = Fexpand_file_name (filename,
for (pathtail = path; !NILP (pathtail); pathtail = Fcdr (pathtail))
{
Lisp_Object pathel = Fcar (pathtail);
- Lisp_Object hash_table;
+ Lisp_Object hashtab;
Lisp_Object tail;
int found;
continue;
}
- hash_table = locate_file_find_directory_hash_table (pathel);
+ hashtab = locate_file_find_directory_hash_table (pathel);
/* Loop over suffixes. */
for (tail = suffixtab, found = 0; !found && CONSP (tail);
tail = XCDR (tail))
{
- if (!NILP (Fgethash (XCAR (tail), hash_table, Qnil)))
+ if (!NILP (Fgethash (XCAR (tail), hashtab, Qnil)))
found = 1;
}
{
/* This function can GC */
REGISTER Emchar c;
- REGISTER Lisp_Object val = Qnil;
+ REGISTER Lisp_Object val;
int speccount = specpdl_depth ();
- struct gcpro gcpro1, gcpro2;
+ struct gcpro gcpro1;
struct buffer *b = 0;
if (BUFFERP (readcharfun))
#ifdef COMPILED_FUNCTION_ANNOTATION_HACK
Vcurrent_compiled_function_annotation = Qnil;
#endif
- GCPRO2 (val, sourcename);
+ GCPRO1 (sourcename);
LOADHIST_ATTACH (sourcename);
obj = read0(readcharfun);
/* the call to `featurep' may GC. */
- GCPRO2 (fexp, obj);
- tem = call1 (Qfeaturep, fexp);
+ GCPRO2(fexp, obj);
+ tem = call1(Qfeaturep, fexp);
UNGCPRO;
- if (c == '+' && NILP(tem)) goto retry;
+ if (c == '+' && NILP(tem)) goto retry;
if (c == '-' && !NILP(tem)) goto retry;
return obj;
}
Vvalues = Qnil;
load_in_progress = 0;
-
+
Vload_descriptor_list = Qnil;
/* kludge: locate-file does not work for a null load-path, even if
*/ );
load_force_doc_strings = 0;
+ DEFVAR_LISP ("source-directory", &Vsource_directory /*
+Directory in which XEmacs sources were found when XEmacs was built.
+You cannot count on them to still be there!
+*/ );
+ Vsource_directory = Qnil;
+
/* See read_escape(). */
#if 0
/* Used to be named `puke-on-fsf-keys' */