tem = call0 (readcharfun);
- if (NILP (tem))
+ if (!FIXNUMP (tem))
return -1;
return XFIXNUM (tem);
tem1 = Fget (Fcar (tem), Qascii_character);
/* Merge this symbol's modifier bits
with the ASCII equivalent of its basic code. */
- if (!NILP (tem1))
+ if (FIXNUMP (tem1) && FIXNUMP (Fcar (Fcdr (tem))))
XSETFASTINT (val, XFIXNUM (tem1) | XFIXNUM (Fcar (Fcdr (tem))));
}
}
}
val = read_filtered_event (1, 1, 1, ! NILP (inherit_input_method), seconds);
- return (NILP (val) ? Qnil
+ return (!FIXNUMP (val) ? Qnil
: make_fixnum (char_resolve_modifier_mask (XFIXNUM (val))));
}
val = read_filtered_event (1, 1, 0, ! NILP (inherit_input_method), seconds);
- return (NILP (val) ? Qnil
+ return (!FIXNUMP (val) ? Qnil
: make_fixnum (char_resolve_modifier_mask (XFIXNUM (val))));
}
invalid_syntax_lisp (CALLN (Fformat, format, namestr), readcharfun);
}
- return XFIXNUM (code);
+ return FIXNUMP (code) ? XFIXNUM (code) : -1;
}
/* Bound on the length of a Unicode character name. As of
break;
}
eassert (chr >= 0 && chr < (1 << CHARACTERBITS));
+ if (chr < 0 || chr >= (1 << CHARACTERBITS))
+ invalid_syntax ("Invalid character", readcharfun);
/* Apply Control modifiers, using the rules:
\C-X = ascii_ctrl(nomod(X)) | mods(X) if nomod(X) is one of: