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 d5ba48a170d..2e5cba510c5 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -735,10 +735,14 @@ read_filtered_event (bool no_switch_frame, bool ascii_required, | |||
| 735 | } | 735 | } |
| 736 | 736 | ||
| 737 | DEFUN ("read-char", Fread_char, Sread_char, 0, 3, 0, | 737 | DEFUN ("read-char", Fread_char, Sread_char, 0, 3, 0, |
| 738 | doc: /* Read a character from the command input (keyboard or macro). | 738 | doc: /* Read a character event from the command input (keyboard or macro). |
| 739 | It is returned as a number. | 739 | It is returned as a number. |
| 740 | If the character has modifiers, they are resolved and reflected to the | 740 | If the event has modifiers, they are resolved and reflected in the |
| 741 | character code if possible (e.g. C-SPC -> 0). | 741 | returned character code if possible (e.g. C-SPC yields 0 and C-a yields 97). |
| 742 | If some of the modifiers cannot be reflected in the character code, the | ||
| 743 | returned value will include those modifiers, and will not be a valid | ||
| 744 | character code: it will fail the `characterp' test. Use `event-basic-type' | ||
| 745 | to recover the character code with the modifiers removed. | ||
| 742 | 746 | ||
| 743 | If the user generates an event which is not a character (i.e. a mouse | 747 | If the user generates an event which is not a character (i.e. a mouse |
| 744 | click or function key event), `read-char' signals an error. As an | 748 | click or function key event), `read-char' signals an error. As an |
| @@ -785,10 +789,14 @@ floating-point value. */) | |||
| 785 | } | 789 | } |
| 786 | 790 | ||
| 787 | DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 3, 0, | 791 | DEFUN ("read-char-exclusive", Fread_char_exclusive, Sread_char_exclusive, 0, 3, 0, |
| 788 | doc: /* Read a character from the command input (keyboard or macro). | 792 | doc: /* Read a character event from the command input (keyboard or macro). |
| 789 | It is returned as a number. Non-character events are ignored. | 793 | It is returned as a number. Non-character events are ignored. |
| 790 | If the character has modifiers, they are resolved and reflected to the | 794 | If the event has modifiers, they are resolved and reflected in the |
| 791 | character code if possible (e.g. C-SPC -> 0). | 795 | returned character code if possible (e.g. C-SPC yields 0 and C-a yields 97). |
| 796 | If some of the modifiers cannot be reflected in the character code, the | ||
| 797 | returned value will include those modifiers, and will not be a valid | ||
| 798 | character code: it will fail the `characterp' test. Use `event-basic-type' | ||
| 799 | to recover the character code with the modifiers removed. | ||
| 792 | 800 | ||
| 793 | If the optional argument PROMPT is non-nil, display that as a prompt. | 801 | If the optional argument PROMPT is non-nil, display that as a prompt. |
| 794 | If the optional argument INHERIT-INPUT-METHOD is non-nil and some | 802 | If the optional argument INHERIT-INPUT-METHOD is non-nil and some |