# HG changeset patch # User Chong Yidong # Date 1218741894 0 # Node ID 9a4bddae759e3a172118f893e64c33c687a65828 # Parent 0a5d1005eed632ec1ad71d6a940b1b4d5331b774 (Fread_char, Fread_char_exclusive): If no character event is read before timeout is reached, return nil, rather than converting to a number. diff -r 0a5d1005eed6 -r 9a4bddae759e src/lread.c --- a/src/lread.c Thu Aug 14 19:24:36 2008 +0000 +++ b/src/lread.c Thu Aug 14 19:24:54 2008 +0000 @@ -791,13 +791,13 @@ 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 @@ 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,