return val;
}
-DEFUN ("read-char", Fread_char, Sread_char, 0, 3, 0,
+DEFUE ("read-char", Fread_char, Sread_char, 0, 3, 0,
doc: /* Read a character from the command input (keyboard or macro).
It is returned as a number.
If the character has modifiers, they are resolved and reflected to the
: make_number (char_resolve_modifier_mask (XINT (val))));
}
-DEFUN ("read-event", Fread_event, Sread_event, 0, 3, 0,
+DEFUE ("read-event", Fread_event, Sread_event, 0, 3, 0,
doc: /* Read an event object from the input stream.
If the optional argument PROMPT is non-nil, display that as a prompt.
If the optional argument INHERIT-INPUT-METHOD is non-nil and some
} beg_end_state = NOMINAL;
int in_file_vars = 0;
-#define UPDATE_BEG_END_STATE(ch) \
- if (beg_end_state == NOMINAL) \
- beg_end_state = (ch == '-' ? AFTER_FIRST_DASH : NOMINAL); \
- else if (beg_end_state == AFTER_FIRST_DASH) \
- beg_end_state = (ch == '*' ? AFTER_ASTERIX : NOMINAL); \
- else if (beg_end_state == AFTER_ASTERIX) \
- { \
- if (ch == '-') \
- in_file_vars = !in_file_vars; \
- beg_end_state = NOMINAL; \
+#define UPDATE_BEG_END_STATE(ch) \
+ if (beg_end_state == NOMINAL) \
+ beg_end_state = (ch == '-' ? AFTER_FIRST_DASH : NOMINAL); \
+ else if (beg_end_state == AFTER_FIRST_DASH) \
+ beg_end_state = (ch == '*' ? AFTER_ASTERIX : NOMINAL); \
+ else if (beg_end_state == AFTER_ASTERIX) \
+ { \
+ if (ch == '-') \
+ in_file_vars = !in_file_vars; \
+ beg_end_state = NOMINAL; \
}
/* Skip until we get to the file vars, if any. */
while (in_file_vars)
{
- char var[100], *var_end, val[100], *val_end;
+ char var[100], val[100];
+ unsigned i;
ch = READCHAR;
while (ch == ' ' || ch == '\t')
ch = READCHAR;
- var_end = var;
+ i = 0;
while (ch != ':' && ch != '\n' && ch != EOF)
{
- if (var_end < var + sizeof var - 1)
- *var_end++ = ch;
+ if (i < sizeof var - 1)
+ var[i++] = ch;
UPDATE_BEG_END_STATE (ch);
ch = READCHAR;
}
-
- while (var_end > var
- && (var_end[-1] == ' ' || var_end[-1] == '\t'))
- var_end--;
- *var_end = '\0';
+
+ while (i > 0 && (var[i - 1] == ' ' || var[i - 1] == '\t'))
+ i--;
+ var[i] = '\0';
if (ch == ':')
{
while (ch == ' ' || ch == '\t')
ch = READCHAR;
- val_end = val;
+ i = 0;
while (ch != ';' && ch != '\n' && ch != EOF && in_file_vars)
{
- if (val_end < val + sizeof val - 1)
- *val_end++ = ch;
+ if (i < sizeof val - 1)
+ val[i++] = ch;
UPDATE_BEG_END_STATE (ch);
ch = READCHAR;
}
if (! in_file_vars)
/* The value was terminated by an end-marker, which
remove. */
- val_end -= 3;
- while (val_end > val
- && (val_end[-1] == ' ' || val_end[-1] == '\t'))
- val_end--;
- *val_end = '\0';
+ i -= 3;
+ while (i > 0 && (val[i - 1] == ' ' || val[i - 1] == '\t'))
+ i--;
+ val[i] = '\0';
if (strcmp (var, "lexical-binding") == 0)
/* This is it... */
return rv;
}
}
-
\f
/* Value is a version number of byte compiled code if the file
associated with file descriptor FD is a compiled Lisp file that's
if (i == 4)
version = buf[i];
- if (i == nbytes
+ if (i >= nbytes
|| fast_c_string_match_ignore_case (Vbytecomp_version_regexp,
buf + i) < 0)
safe_p = 0;
return Qnil;
}
-DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0,
+DEFUE ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0,
doc: /* Return the suffixes that `load' should try if a suffix is \
required.
This uses the variables `load-suffixes' and `load-file-rep-suffixes'. */)
return Fnreverse (lst);
}
-DEFUN ("load", Fload, Sload, 1, 5, 0,
+DEFUE ("load", Fload, Sload, 1, 5, 0,
doc: /* Execute a file of Lisp code named FILE.
First try FILE with `.elc' appended, then try with `.el',
then try FILE unmodified (the exact suffixes in the exact order are
specbind (Qinhibit_file_name_operation, Qnil);
load_descriptor_list
= Fcons (make_number (fileno (stream)), load_descriptor_list);
-
specbind (Qload_in_progress, Qt);
instream = stream;
specbind (Qeval_buffer_list, Fcons (buf, Veval_buffer_list));
specbind (Qstandard_output, tem);
- specbind (Qlexical_binding, Qnil);
record_unwind_protect (save_excursion_restore, save_excursion_save ());
BUF_TEMP_SET_PT (XBUFFER (buf), BUF_BEGV (XBUFFER (buf)));
- if (lisp_file_lexically_bound_p (buf))
- Fset (Qlexical_binding, Qt);
+ specbind (Qlexical_binding, lisp_file_lexically_bound_p (buf) ? Qt : Qnil);
readevalloop (buf, 0, filename,
!NILP (printflag), unibyte, Qnil, Qnil, Qnil);
unbind_to (count, Qnil);
This function does not move point. */)
(Lisp_Object start, Lisp_Object end, Lisp_Object printflag, Lisp_Object read_function)
{
+ /* FIXME: Do the eval-sexp-add-defvars danse! */
int count = SPECPDL_INDEX ();
Lisp_Object tem, cbuf;
}
\f
-DEFUN ("read", Fread, Sread, 0, 1, 0,
+DEFUE ("read", Fread, Sread, 0, 1, 0,
doc: /* Read one Lisp expression as text from STREAM, return as Lisp object.
If STREAM is nil, use the value of `standard-input' (which see).
STREAM or the value of `standard-input' may be:
return read_internal_start (stream, Qnil, Qnil);
}
-DEFUN ("read-from-string", Fread_from_string, Sread_from_string, 1, 3, 0,
+DEFUE ("read-from-string", Fread_from_string, Sread_from_string, 1, 3, 0,
doc: /* Read one Lisp expression which is represented as text by STRING.
Returns a cons: (OBJECT-READ . FINAL-STRING-INDEX).
START and END optionally delimit a substring of STRING from which to read;
read1 (register Lisp_Object readcharfun, int *pch, int first_in_list)
{
register int c;
- int uninterned_symbol = 0;
+ unsigned uninterned_symbol = 0;
int multibyte;
*pch = 0;
for (i = 0; i < size; i++)
{
item = Fcar (tem);
-
/* If `load-force-doc-strings' is t when reading a lazily-loaded
bytecode object, the docstring containing the bytecode and
constants values must be treated as unibyte and passed to
tem = Fcdr (tem);
free_cons (otem);
}
-
return vector;
}
: make_string (str, len));
}
\f
-DEFUN ("intern", Fintern, Sintern, 1, 2, 0,
+DEFUE ("intern", Fintern, Sintern, 1, 2, 0,
doc: /* Return the canonical symbol whose name is STRING.
If there is none, one is created by this function and returned.
A second optional argument specifies the obarray to use;
return sym;
}
-DEFUN ("intern-soft", Fintern_soft, Sintern_soft, 1, 2, 0,
+DEFUE ("intern-soft", Fintern_soft, Sintern_soft, 1, 2, 0,
doc: /* Return the canonical symbol named NAME, or nil if none exists.
NAME may be a string or a symbol. If it is a symbol, that exact
symbol is searched for.
return tem;
}
\f
-DEFUN ("unintern", Funintern, Sunintern, 1, 2, 0,
+DEFUE ("unintern", Funintern, Sunintern, 1, 2, 0,
doc: /* Delete the symbol named NAME, if any, from OBARRAY.
The value is t if a symbol was found and deleted, nil otherwise.
NAME may be a string or a symbol. If it is a symbol, that symbol
staticpro (address);
}
-
/* Similar but define a variable whose value is the Lisp Object stored
at a particular offset in the current kboard object. */
doc: /* If non-nil, use lexical binding when evaluating code.
This only applies to code evaluated by `eval-buffer' and `eval-region'.
This variable is automatically set from the file variables of an interpreted
- lisp file read using `load'. */);
+ Lisp file read using `load'. */);
Fmake_variable_buffer_local (Qlexical_binding);
DEFVAR_LISP ("eval-buffer-list", Veval_buffer_list,