215 |
The READCHAR and UNREAD macros are meant for reading/unreading a |
The READCHAR and UNREAD macros are meant for reading/unreading a |
216 |
byte code; they do not handle multibyte characters. The caller |
byte code; they do not handle multibyte characters. The caller |
217 |
should manage them if necessary. |
should manage them if necessary. |
218 |
|
|
219 |
[ Actually that seems to be a lie; READCHAR will definitely read |
[ Actually that seems to be a lie; READCHAR will definitely read |
220 |
multibyte characters from buffer sources, at least. Is the |
multibyte characters from buffer sources, at least. Is the |
221 |
comment just out of date? |
comment just out of date? |
233 |
register int c; |
register int c; |
234 |
|
|
235 |
readchar_count++; |
readchar_count++; |
236 |
|
|
237 |
if (BUFFERP (readcharfun)) |
if (BUFFERP (readcharfun)) |
238 |
{ |
{ |
239 |
register struct buffer *inbuffer = XBUFFER (readcharfun); |
register struct buffer *inbuffer = XBUFFER (readcharfun); |
411 |
static Lisp_Object read_internal_start P_ ((Lisp_Object, Lisp_Object, |
static Lisp_Object read_internal_start P_ ((Lisp_Object, Lisp_Object, |
412 |
Lisp_Object)); |
Lisp_Object)); |
413 |
static Lisp_Object read0 P_ ((Lisp_Object)); |
static Lisp_Object read0 P_ ((Lisp_Object)); |
414 |
static Lisp_Object read1 P_ ((Lisp_Object, int *, int)); |
static Lisp_Object read1 P_ ((Lisp_Object, int *, int)); |
415 |
|
|
416 |
static Lisp_Object read_list P_ ((int, Lisp_Object)); |
static Lisp_Object read_list P_ ((int, Lisp_Object)); |
417 |
static Lisp_Object read_vector P_ ((Lisp_Object, int)); |
static Lisp_Object read_vector P_ ((Lisp_Object, int)); |
457 |
if (display_hourglass_p) |
if (display_hourglass_p) |
458 |
cancel_hourglass (); |
cancel_hourglass (); |
459 |
#endif |
#endif |
460 |
|
|
461 |
delayed_switch_frame = Qnil; |
delayed_switch_frame = Qnil; |
462 |
|
|
463 |
/* Read until we get an acceptable event. */ |
/* Read until we get an acceptable event. */ |
498 |
XSETFASTINT (val, XINT (tem1) | XINT (Fcar (Fcdr (tem)))); |
XSETFASTINT (val, XINT (tem1) | XINT (Fcar (Fcdr (tem)))); |
499 |
} |
} |
500 |
} |
} |
501 |
|
|
502 |
/* If we don't have a character now, deal with it appropriately. */ |
/* If we don't have a character now, deal with it appropriately. */ |
503 |
if (!INTEGERP (val)) |
if (!INTEGERP (val)) |
504 |
{ |
{ |
709 |
} |
} |
710 |
else |
else |
711 |
file = Fsubstitute_in_file_name (file); |
file = Fsubstitute_in_file_name (file); |
712 |
|
|
713 |
|
|
714 |
/* Avoid weird lossage with null string as arg, |
/* Avoid weird lossage with null string as arg, |
715 |
since it would try to load a directory as a Lisp file */ |
since it would try to load a directory as a Lisp file */ |
1550 |
read_from_string_index_byte = string_char_to_byte (stream, startval); |
read_from_string_index_byte = string_char_to_byte (stream, startval); |
1551 |
read_from_string_limit = endval; |
read_from_string_limit = endval; |
1552 |
} |
} |
1553 |
|
|
1554 |
retval = read0 (stream); |
retval = read0 (stream); |
1555 |
if (EQ (Vread_with_symbol_positions, Qt) |
if (EQ (Vread_with_symbol_positions, Qt) |
1556 |
|| EQ (Vread_with_symbol_positions, stream)) |
|| EQ (Vread_with_symbol_positions, stream)) |
1751 |
break; |
break; |
1752 |
} |
} |
1753 |
} |
} |
1754 |
|
|
1755 |
*byterep = 1; |
*byterep = 1; |
1756 |
return i; |
return i; |
1757 |
} |
} |
1825 |
} |
} |
1826 |
else if (c == '+') |
else if (c == '+') |
1827 |
c = READCHAR; |
c = READCHAR; |
1828 |
|
|
1829 |
while (c >= 0) |
while (c >= 0) |
1830 |
{ |
{ |
1831 |
int digit; |
int digit; |
1832 |
|
|
1833 |
if (c >= '0' && c <= '9') |
if (c >= '0' && c <= '9') |
1834 |
digit = c - '0'; |
digit = c - '0'; |
1835 |
else if (c >= 'a' && c <= 'z') |
else if (c >= 'a' && c <= 'z') |
1894 |
if (nbytes != *nchars) |
if (nbytes != *nchars) |
1895 |
nbytes = str_as_multibyte (read_buffer, read_buffer_size, |
nbytes = str_as_multibyte (read_buffer, read_buffer_size, |
1896 |
*p - read_buffer, nchars); |
*p - read_buffer, nchars); |
1897 |
|
|
1898 |
*p = read_buffer + nbytes; |
*p = read_buffer + nbytes; |
1899 |
} |
} |
1900 |
|
|
1992 |
== (SCHARS (tmp) - 1) * BITS_PER_CHAR)) |
== (SCHARS (tmp) - 1) * BITS_PER_CHAR)) |
1993 |
Fsignal (Qinvalid_read_syntax, |
Fsignal (Qinvalid_read_syntax, |
1994 |
Fcons (make_string ("#&...", 5), Qnil)); |
Fcons (make_string ("#&...", 5), Qnil)); |
1995 |
|
|
1996 |
val = Fmake_bool_vector (length, Qnil); |
val = Fmake_bool_vector (length, Qnil); |
1997 |
bcopy (SDATA (tmp), XBOOL_VECTOR (val)->data, |
bcopy (SDATA (tmp), XBOOL_VECTOR (val)->data, |
1998 |
size_in_chars); |
size_in_chars); |
2047 |
UNGCPRO; |
UNGCPRO; |
2048 |
return tmp; |
return tmp; |
2049 |
} |
} |
2050 |
|
|
2051 |
/* #@NUMBER is used to skip NUMBER following characters. |
/* #@NUMBER is used to skip NUMBER following characters. |
2052 |
That's used in .elc files to skip over doc strings |
That's used in .elc files to skip over doc strings |
2053 |
and function definitions. */ |
and function definitions. */ |
2064 |
} |
} |
2065 |
if (c >= 0) |
if (c >= 0) |
2066 |
UNREAD (c); |
UNREAD (c); |
2067 |
|
|
2068 |
if (load_force_doc_strings && EQ (readcharfun, Qget_file_char)) |
if (load_force_doc_strings && EQ (readcharfun, Qget_file_char)) |
2069 |
{ |
{ |
2070 |
/* If we are supposed to force doc strings into core right now, |
/* If we are supposed to force doc strings into core right now, |
2170 |
|
|
2171 |
/* ...and #n# will use the real value from now on. */ |
/* ...and #n# will use the real value from now on. */ |
2172 |
Fsetcdr (cell, tem); |
Fsetcdr (cell, tem); |
2173 |
|
|
2174 |
return tem; |
return tem; |
2175 |
} |
} |
2176 |
/* #n# returns a previously read object. */ |
/* #n# returns a previously read object. */ |
2183 |
} |
} |
2184 |
else if (c == 'r' || c == 'R') |
else if (c == 'r' || c == 'R') |
2185 |
return read_integer (readcharfun, n); |
return read_integer (readcharfun, n); |
2186 |
|
|
2187 |
/* Fall through to error message. */ |
/* Fall through to error message. */ |
2188 |
} |
} |
2189 |
else if (c == 'x' || c == 'X') |
else if (c == 'x' || c == 'X') |
2442 |
p = read_buffer + offset; |
p = read_buffer + offset; |
2443 |
end = read_buffer + read_buffer_size; |
end = read_buffer + read_buffer_size; |
2444 |
} |
} |
2445 |
|
|
2446 |
if (c == '\\') |
if (c == '\\') |
2447 |
{ |
{ |
2448 |
c = READCHAR; |
c = READCHAR; |
2536 |
: intern (read_buffer); |
: intern (read_buffer); |
2537 |
if (EQ (Vread_with_symbol_positions, Qt) |
if (EQ (Vread_with_symbol_positions, Qt) |
2538 |
|| EQ (Vread_with_symbol_positions, readcharfun)) |
|| EQ (Vread_with_symbol_positions, readcharfun)) |
2539 |
Vread_symbol_positions_list = |
Vread_symbol_positions_list = |
2540 |
/* Kind of a hack; this will probably fail if characters |
/* Kind of a hack; this will probably fail if characters |
2541 |
in the symbol name were escaped. Not really a big |
in the symbol name were escaped. Not really a big |
2542 |
deal, though. */ |
deal, though. */ |
2567 |
/* Make all the substitutions. */ |
/* Make all the substitutions. */ |
2568 |
check_object |
check_object |
2569 |
= substitute_object_recurse (object, placeholder, object); |
= substitute_object_recurse (object, placeholder, object); |
2570 |
|
|
2571 |
/* Clear seen_list because we're done with it. */ |
/* Clear seen_list because we're done with it. */ |
2572 |
seen_list = Qnil; |
seen_list = Qnil; |
2573 |
|
|
2611 |
read_objects. */ |
read_objects. */ |
2612 |
if (!EQ (Qnil, Frassq (subtree, read_objects))) |
if (!EQ (Qnil, Frassq (subtree, read_objects))) |
2613 |
seen_list = Fcons (subtree, seen_list); |
seen_list = Fcons (subtree, seen_list); |
2614 |
|
|
2615 |
/* Recurse according to subtree's type. |
/* Recurse according to subtree's type. |
2616 |
Every branch must return a Lisp_Object. */ |
Every branch must return a Lisp_Object. */ |
2617 |
switch (XTYPE (subtree)) |
switch (XTYPE (subtree)) |
2624 |
{ |
{ |
2625 |
Lisp_Object idx = make_number (i); |
Lisp_Object idx = make_number (i); |
2626 |
SUBSTITUTE (Faref (subtree, idx), |
SUBSTITUTE (Faref (subtree, idx), |
2627 |
Faset (subtree, idx, true_value)); |
Faset (subtree, idx, true_value)); |
2628 |
} |
} |
2629 |
return subtree; |
return subtree; |
2630 |
} |
} |
2645 |
|
|
2646 |
INTERVAL root_interval = STRING_INTERVALS (subtree); |
INTERVAL root_interval = STRING_INTERVALS (subtree); |
2647 |
Lisp_Object arg = Fcons (object, placeholder); |
Lisp_Object arg = Fcons (object, placeholder); |
2648 |
|
|
2649 |
traverse_intervals_noorder (root_interval, |
traverse_intervals_noorder (root_interval, |
2650 |
&substitute_in_interval, arg); |
&substitute_in_interval, arg); |
2651 |
|
|
2682 |
register char *cp; |
register char *cp; |
2683 |
{ |
{ |
2684 |
register int state; |
register int state; |
2685 |
|
|
2686 |
char *start = cp; |
char *start = cp; |
2687 |
|
|
2688 |
state = 0; |
state = 0; |
2813 |
} |
} |
2814 |
return vector; |
return vector; |
2815 |
} |
} |
2816 |
|
|
2817 |
/* FLAG = 1 means check for ] to terminate rather than ) and . |
/* FLAG = 1 means check for ] to terminate rather than ) and . |
2818 |
FLAG = -1 means check for starting with defun |
FLAG = -1 means check for starting with defun |
2819 |
and make structure pure. */ |
and make structure pure. */ |
2832 |
struct gcpro gcpro1, gcpro2; |
struct gcpro gcpro1, gcpro2; |
2833 |
/* 0 is the normal case. |
/* 0 is the normal case. |
2834 |
1 means this list is a doc reference; replace it with the number 0. |
1 means this list is a doc reference; replace it with the number 0. |
2835 |
2 means this list is a doc reference; replace it with the doc string. */ |
2 means this list is a doc reference; replace it with the doc string. */ |
2836 |
int doc_reference = 0; |
int doc_reference = 0; |
2837 |
|
|
2838 |
/* Initialize this to 1 if we are reading a list. */ |
/* Initialize this to 1 if we are reading a list. */ |
3321 |
/* Intern nil in the obarray */ |
/* Intern nil in the obarray */ |
3322 |
XSYMBOL (Qnil)->interned = SYMBOL_INTERNED_IN_INITIAL_OBARRAY; |
XSYMBOL (Qnil)->interned = SYMBOL_INTERNED_IN_INITIAL_OBARRAY; |
3323 |
XSYMBOL (Qnil)->constant = 1; |
XSYMBOL (Qnil)->constant = 1; |
3324 |
|
|
3325 |
/* These locals are to kludge around a pyramid compiler bug. */ |
/* These locals are to kludge around a pyramid compiler bug. */ |
3326 |
hash = hash_string ("nil", 3); |
hash = hash_string ("nil", 3); |
3327 |
/* Separate statement here to avoid VAXC bug. */ |
/* Separate statement here to avoid VAXC bug. */ |
3454 |
SET_SYMBOL_VALUE (sym, val); |
SET_SYMBOL_VALUE (sym, val); |
3455 |
PER_BUFFER_SYMBOL (offset) = sym; |
PER_BUFFER_SYMBOL (offset) = sym; |
3456 |
PER_BUFFER_TYPE (offset) = type; |
PER_BUFFER_TYPE (offset) = type; |
3457 |
|
|
3458 |
if (PER_BUFFER_IDX (offset) == 0) |
if (PER_BUFFER_IDX (offset) == 0) |
3459 |
/* Did a DEFVAR_PER_BUFFER without initializing the corresponding |
/* Did a DEFVAR_PER_BUFFER without initializing the corresponding |
3460 |
slot of buffer_local_flags */ |
slot of buffer_local_flags */ |
3626 |
#endif |
#endif |
3627 |
|
|
3628 |
#ifndef WINDOWSNT |
#ifndef WINDOWSNT |
3629 |
/* When Emacs is invoked over network shares on NT, PATH_LOADSEARCH is |
/* When Emacs is invoked over network shares on NT, PATH_LOADSEARCH is |
3630 |
almost never correct, thereby causing a warning to be printed out that |
almost never correct, thereby causing a warning to be printed out that |
3631 |
confuses users. Since PATH_LOADSEARCH is always overridden by the |
confuses users. Since PATH_LOADSEARCH is always overridden by the |
3632 |
EMACSLOADPATH environment variable below, disable the warning on NT. */ |
EMACSLOADPATH environment variable below, disable the warning on NT. */ |
3633 |
|
|
3750 |
Note that a symbol will appear multiple times in this list, if it was |
Note that a symbol will appear multiple times in this list, if it was |
3751 |
read multiple times. The list is in the same order as the symbols |
read multiple times. The list is in the same order as the symbols |
3752 |
were read in. */); |
were read in. */); |
3753 |
Vread_symbol_positions_list = Qnil; |
Vread_symbol_positions_list = Qnil; |
3754 |
|
|
3755 |
DEFVAR_LISP ("load-path", &Vload_path, |
DEFVAR_LISP ("load-path", &Vload_path, |
3756 |
doc: /* *List of directories to search for files to load. |
doc: /* *List of directories to search for files to load. |
3914 |
staticpro (&read_objects); |
staticpro (&read_objects); |
3915 |
read_objects = Qnil; |
read_objects = Qnil; |
3916 |
staticpro (&seen_list); |
staticpro (&seen_list); |
3917 |
|
|
3918 |
Vloads_in_progress = Qnil; |
Vloads_in_progress = Qnil; |
3919 |
staticpro (&Vloads_in_progress); |
staticpro (&Vloads_in_progress); |
3920 |
} |
} |