aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2008-08-14 19:24:54 +0000
committerChong Yidong2008-08-14 19:24:54 +0000
commit66c410cec5064a6b2164b7e90c215efcb520b65d (patch)
treee87237009af6fce7b2115c9405110ca118ee85db /src
parentf581fad699b4ec6766b1b69e36bf1a36a89ed63b (diff)
downloademacs-66c410cec5064a6b2164b7e90c215efcb520b65d.tar.gz
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.c13
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. */)
791 Lisp_Object prompt, inherit_input_method, seconds; 791 Lisp_Object prompt, inherit_input_method, seconds;
792{ 792{
793 Lisp_Object val; 793 Lisp_Object val;
794 int c;
795 794
796 if (! NILP (prompt)) 795 if (! NILP (prompt))
797 message_with_string ("%s", prompt, 0); 796 message_with_string ("%s", prompt, 0);
798 val = read_filtered_event (1, 1, 1, ! NILP (inherit_input_method), seconds); 797 val = read_filtered_event (1, 1, 1, ! NILP (inherit_input_method), seconds);
799 c = XINT (val); 798
800 return make_number (char_resolve_modifier_mask (c)); 799 return (NILP (val) ? Qnil
800 : make_number (char_resolve_modifier_mask (XINT (val))));
801} 801}
802 802
803DEFUN ("read-event", Fread_event, Sread_event, 0, 3, 0, 803DEFUN ("read-event", Fread_event, Sread_event, 0, 3, 0,
@@ -836,13 +836,14 @@ floating-point value. */)
836 Lisp_Object prompt, inherit_input_method, seconds; 836 Lisp_Object prompt, inherit_input_method, seconds;
837{ 837{
838 Lisp_Object val; 838 Lisp_Object val;
839 int c;
840 839
841 if (! NILP (prompt)) 840 if (! NILP (prompt))
842 message_with_string ("%s", prompt, 0); 841 message_with_string ("%s", prompt, 0);
842
843 val = read_filtered_event (1, 1, 0, ! NILP (inherit_input_method), seconds); 843 val = read_filtered_event (1, 1, 0, ! NILP (inherit_input_method), seconds);
844 c = XINT (val); 844
845 return make_number (char_resolve_modifier_mask (c)); 845 return (NILP (val) ? Qnil
846 : make_number (char_resolve_modifier_mask (XINT (val))));
846} 847}
847 848
848DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0, 849DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0,