aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2008-03-05 04:28:59 +0000
committerKenichi Handa2008-03-05 04:28:59 +0000
commitfb26c2afce8201277010c833e466585869cd9a5c (patch)
tree2d2293f7a84b2f102a36dc0644f03ae3118e821c /src
parentc571ad7c4394cab5ae7d0f6e2c1bacb4d5826409 (diff)
downloademacs-fb26c2afce8201277010c833e466585869cd9a5c.tar.gz
emacs-fb26c2afce8201277010c833e466585869cd9a5c.zip
(Fread_char): Resolve modifiers.
(Fread_char_exclusive): Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/lread.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/lread.c b/src/lread.c
index dc8684eb05c..c1ee53056ac 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -771,10 +771,13 @@ read_filtered_event (no_switch_frame, ascii_required, error_nonascii,
771DEFUN ("read-char", Fread_char, Sread_char, 0, 3, 0, 771DEFUN ("read-char", Fread_char, Sread_char, 0, 3, 0,
772 doc: /* Read a character from the command input (keyboard or macro). 772 doc: /* Read a character from the command input (keyboard or macro).
773It is returned as a number. 773It is returned as a number.
774If the character has modifiers, they are resolved and reflected to the
775character code if possible (e.g. C-SPC -> 0).
776
774If the user generates an event which is not a character (i.e. a mouse 777If the user generates an event which is not a character (i.e. a mouse
775click or function key event), `read-char' signals an error. As an 778click or function key event), `read-char' signals an error. As an
776exception, switch-frame events are put off until non-ASCII events can 779exception, switch-frame events are put off until non-character events
777be read. 780can be read.
778If you want to read non-character events, or ignore them, call 781If you want to read non-character events, or ignore them, call
779`read-event' or `read-char-exclusive' instead. 782`read-event' or `read-char-exclusive' instead.
780 783
@@ -789,9 +792,14 @@ floating-point value. */)
789 (prompt, inherit_input_method, seconds) 792 (prompt, inherit_input_method, seconds)
790 Lisp_Object prompt, inherit_input_method, seconds; 793 Lisp_Object prompt, inherit_input_method, seconds;
791{ 794{
795 Lisp_Object val;
796 int c;
797
792 if (! NILP (prompt)) 798 if (! NILP (prompt))
793 message_with_string ("%s", prompt, 0); 799 message_with_string ("%s", prompt, 0);
794 return read_filtered_event (1, 1, 1, ! NILP (inherit_input_method), seconds); 800 val = read_filtered_event (1, 1, 1, ! NILP (inherit_input_method), seconds);
801 c = XINT (val);
802 return make_number (char_resolve_modifier_mask (c));
795} 803}
796 804
797DEFUN ("read-event", Fread_event, Sread_event, 0, 3, 0, 805DEFUN ("read-event", Fread_event, Sread_event, 0, 3, 0,
@@ -815,6 +823,8 @@ floating-point value. */)
815DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 3, 0, 823DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 3, 0,
816 doc: /* Read a character from the command input (keyboard or macro). 824 doc: /* Read a character from the command input (keyboard or macro).
817It is returned as a number. Non-character events are ignored. 825It is returned as a number. Non-character events are ignored.
826If the character has modifiers, they are resolved and reflected to the
827character code if possible (e.g. C-SPC -> 0).
818 828
819If the optional argument PROMPT is non-nil, display that as a prompt. 829If the optional argument PROMPT is non-nil, display that as a prompt.
820If the optional argument INHERIT-INPUT-METHOD is non-nil and some 830If the optional argument INHERIT-INPUT-METHOD is non-nil and some
@@ -827,9 +837,14 @@ floating-point value. */)
827 (prompt, inherit_input_method, seconds) 837 (prompt, inherit_input_method, seconds)
828 Lisp_Object prompt, inherit_input_method, seconds; 838 Lisp_Object prompt, inherit_input_method, seconds;
829{ 839{
840 Lisp_Object val;
841 int c;
842
830 if (! NILP (prompt)) 843 if (! NILP (prompt))
831 message_with_string ("%s", prompt, 0); 844 message_with_string ("%s", prompt, 0);
832 return read_filtered_event (1, 1, 0, ! NILP (inherit_input_method), seconds); 845 val = read_filtered_event (1, 1, 0, ! NILP (inherit_input_method), seconds);
846 c = XINT (val);
847 return make_number (char_resolve_modifier_mask (c));
833} 848}
834 849
835DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0, 850DEFUN ("get-file-char", Fget_file_char, Sget_file_char, 0, 0, 0,