diff options
Diffstat (limited to 'src/lread.c')
| -rw-r--r-- | src/lread.c | 20 |
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, | |||
| 741 | } | 741 | } |
| 742 | 742 | ||
| 743 | DEFUN ("read-char", Fread_char, Sread_char, 0, 3, 0, | 743 | DEFUN ("read-char", Fread_char, Sread_char, 0, 3, 0, |
| 744 | doc: /* Read a character from the command input (keyboard or macro). | 744 | doc: /* Read a character event from the command input (keyboard or macro). |
| 745 | It is returned as a number. | 745 | It is returned as a number. |
| 746 | If the character has modifiers, they are resolved and reflected to the | 746 | If the event has modifiers, they are resolved and reflected in the |
| 747 | character code if possible (e.g. C-SPC -> 0). | 747 | returned character code if possible (e.g. C-SPC yields 0 and C-a yields 97). |
| 748 | If some of the modifiers cannot be reflected in the character code, the | ||
| 749 | returned value will include those modifiers, and will not be a valid | ||
| 750 | character code: it will fail the `characterp' test. Use `event-basic-type' | ||
| 751 | to recover the character code with the modifiers removed. | ||
| 748 | 752 | ||
| 749 | If the user generates an event which is not a character (i.e. a mouse | 753 | If the user generates an event which is not a character (i.e. a mouse |
| 750 | click or function key event), `read-char' signals an error. As an | 754 | click or function key event), `read-char' signals an error. As an |
| @@ -791,10 +795,14 @@ floating-point value. */) | |||
| 791 | } | 795 | } |
| 792 | 796 | ||
| 793 | DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 3, 0, | 797 | DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 3, 0, |
| 794 | doc: /* Read a character from the command input (keyboard or macro). | 798 | doc: /* Read a character event from the command input (keyboard or macro). |
| 795 | It is returned as a number. Non-character events are ignored. | 799 | It is returned as a number. Non-character events are ignored. |
| 796 | If the character has modifiers, they are resolved and reflected to the | 800 | If the event has modifiers, they are resolved and reflected in the |
| 797 | character code if possible (e.g. C-SPC -> 0). | 801 | returned character code if possible (e.g. C-SPC yields 0 and C-a yields 97). |
| 802 | If some of the modifiers cannot be reflected in the character code, the | ||
| 803 | returned value will include those modifiers, and will not be a valid | ||
| 804 | character code: it will fail the `characterp' test. Use `event-basic-type' | ||
| 805 | to recover the character code with the modifiers removed. | ||
| 798 | 806 | ||
| 799 | If the optional argument PROMPT is non-nil, display that as a prompt. | 807 | If the optional argument PROMPT is non-nil, display that as a prompt. |
| 800 | If the optional argument INHERIT-INPUT-METHOD is non-nil and some | 808 | If the optional argument INHERIT-INPUT-METHOD is non-nil and some |