summaryrefslogtreecommitdiff
path: root/src/lread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lread.c')
-rw-r--r--src/lread.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/lread.c b/src/lread.c
index e43929a8c6a..73e38d89954 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -741,10 +741,14 @@ read_filtered_event (bool no_switch_frame, bool ascii_required,
}
DEFUN ("read-char", Fread_char, Sread_char, 0, 3, 0,
- doc: /* Read a character from the command input (keyboard or macro).
+ doc: /* Read a character event from the command input (keyboard or macro).
It is returned as a number.
-If the character has modifiers, they are resolved and reflected to the
-character code if possible (e.g. C-SPC -> 0).
+If the event has modifiers, they are resolved and reflected in the
+returned character code if possible (e.g. C-SPC yields 0 and C-a yields 97).
+If some of the modifiers cannot be reflected in the character code, the
+returned value will include those modifiers, and will not be a valid
+character code: it will fail the `characterp' test. Use `event-basic-type'
+to recover the character code with the modifiers removed.
If the user generates an event which is not a character (i.e. a mouse
click or function key event), `read-char' signals an error. As an
@@ -791,10 +795,14 @@ floating-point value. */)
}
DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 3, 0,
- doc: /* Read a character from the command input (keyboard or macro).
+ doc: /* Read a character event from the command input (keyboard or macro).
It is returned as a number. Non-character events are ignored.
-If the character has modifiers, they are resolved and reflected to the
-character code if possible (e.g. C-SPC -> 0).
+If the event has modifiers, they are resolved and reflected in the
+returned character code if possible (e.g. C-SPC yields 0 and C-a yields 97).
+If some of the modifiers cannot be reflected in the character code, the
+returned value will include those modifiers, and will not be a valid
+character code: it will fail the `characterp' test. Use `event-basic-type'
+to recover the character code with the modifiers removed.
If the optional argument PROMPT is non-nil, display that as a prompt.
If the optional argument INHERIT-INPUT-METHOD is non-nil and some