diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2008-08-14 19:24:54 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2008-08-14 19:24:54 +0000 |
commit | 66c410cec5064a6b2164b7e90c215efcb520b65d (patch) | |
tree | e87237009af6fce7b2115c9405110ca118ee85db /src | |
parent | f581fad699b4ec6766b1b69e36bf1a36a89ed63b (diff) | |
download | emacs-66c410cec5064a6b2164b7e90c215efcb520b65d.tar.gz emacs-66c410cec5064a6b2164b7e90c215efcb520b65d.tar.bz2 emacs-66c410cec5064a6b2164b7e90c215efcb520b65d.zip |
(Fread_char, Fread_char_exclusive): If no character event is read
before timeout is reached, return nil, rather than converting to a
number.
Diffstat (limited to 'src')
-rw-r--r-- | src/lread.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lread.c b/src/lread.c index f36162b1a85..58faf747d1f 100644 --- a/src/lread.c +++ b/src/lread.c @@ -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, |