#ifdef MSDOS
#include "msdos.h"
-/* These are redefined (correctly, but differently) in values.h. */
-#undef INTBITS
-#undef LONGBITS
-#undef SHORTBITS
#endif
#include <math.h>
Lisp_Object Qread_char, Qget_file_char, Qstandard_input, Qcurrent_load_list;
Lisp_Object Qvariable_documentation, Vvalues, Vstandard_input, Vafter_load_alist;
Lisp_Object Qascii_character, Qload, Qload_file_name;
-Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot;
+Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction;
extern Lisp_Object Qevent_symbol_element_mask;
/* non-zero if inside `load' */
int load_in_progress;
+/* Directory in which the sources were found. */
+Lisp_Object Vsource_directory;
+
/* Search path for files to be loaded. */
Lisp_Object Vload_path;
goto retry;
/* switch-frame events are put off until after the next ASCII
- character. This is better than signalling an error just because
+ character. This is better than signaling an error just because
the last characters were typed to a separate minibuffer frame,
for example. Eventually, some code which can deal with
switch-frame events will read it and process it. */
if (c == '"')
{
Lisp_Object tmp, val;
- int bits_per_char = INTBITS / sizeof (int);
- int size_in_chars = ((XFASTINT (length) + bits_per_char)
- / bits_per_char);
+ int size_in_chars = ((XFASTINT (length) + BITS_PER_CHAR)
+ / BITS_PER_CHAR);
UNREAD (c);
tmp = read1 (readcharfun, pch, first_in_list);
}
if (c == '$')
return Vload_file_name;
+ if (c == '\'')
+ return Fcons (Qfunction, Fcons (read0 (readcharfun), Qnil));
+
UNREAD (c);
Fsignal (Qinvalid_read_syntax, Fcons (make_string ("#", 1), Qnil));
obarray = check_obarray (obarray);
obsize = XVECTOR (obarray)->size;
}
+ /* This is sometimes needed in the middle of GC. */
+ obsize &= ~ARRAY_MARK_FLAG;
/* Combining next two lines breaks VMS C 2.3. */
hash = hash_string (ptr, size);
hash %= obsize;
Lisp_Object dump_path;
dump_path = decode_env_path (0, PATH_DUMPLOADSEARCH);
+
+ Vsource_directory = Fexpand_file_name (build_string ("../"),
+ Fcar (dump_path));
+
if (! NILP (Fequal (dump_path, Vload_path)))
{
Vload_path = decode_env_path (0, normal);
}
}
else
- Vload_path = decode_env_path (0, normal);
+ /* ../lisp refers to the build directory.
+ NORMAL refers to the lisp dir in the source directory. */
+ Vload_path = Fcons (build_string ("../lisp"),
+ decode_env_path (0, normal));
#endif
#ifndef WINDOWSNT
/* When Emacs is invoked over network shares on NT, PATH_LOADSEARCH is
almost never correct, thereby causing a warning to be printed out that
- confuses users. Since PATH_LOADSEARCH is always overriden by the
+ confuses users. Since PATH_LOADSEARCH is always overridden by the
EMACSLOADPATH environment variable below, disable the warning on NT. */
/* Warn if dirs in the *standard* path don't exist. */
This is useful when the file being loaded is a temporary copy.");
load_force_doc_strings = 0;
+ DEFVAR_LISP ("source-directory", &Vsource_directory,
+ "Directory in which Emacs sources were found when Emacs was built.\n\
+You cannot count on them to still be there!");
+ Vsource_directory = Qnil;
load_descriptor_list = Qnil;
staticpro (&load_descriptor_list);
Qascii_character = intern ("ascii-character");
staticpro (&Qascii_character);
+ Qfunction = intern ("function");
+ staticpro (&Qfunction);
+
Qload = intern ("load");
staticpro (&Qload);