1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00

(Fread_char, Fread_char_exclusive): If no character event is read

before timeout is reached, return nil, rather than converting to a
number.
This commit is contained in:
Chong Yidong 2008-08-14 19:24:54 +00:00
parent f581fad699
commit 66c410cec5

View File

@ -791,13 +791,13 @@ floating-point value. */)
Lisp_Object prompt, inherit_input_method, seconds;
{
Lisp_Object val;
int c;
if (! NILP (prompt))
message_with_string ("%s", prompt, 0);
val = read_filtered_event (1, 1, 1, ! NILP (inherit_input_method), seconds);
c = XINT (val);
return make_number (char_resolve_modifier_mask (c));
return (NILP (val) ? Qnil
: make_number (char_resolve_modifier_mask (XINT (val))));
}
DEFUN ("read-event", Fread_event, Sread_event, 0, 3, 0,
@ -836,13 +836,14 @@ floating-point value. */)
Lisp_Object prompt, inherit_input_method, seconds;
{
Lisp_Object val;
int c;
if (! NILP (prompt))
message_with_string ("%s", prompt, 0);
val = read_filtered_event (1, 1, 0, ! NILP (inherit_input_method), seconds);
c = XINT (val);
return make_number (char_resolve_modifier_mask (c));
return (NILP (val) ? Qnil
: make_number (char_resolve_modifier_mask (XINT (val))));
}
DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0,