diff options
| author | Karl Heuer | 1995-03-03 01:50:42 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-03-03 01:50:42 +0000 |
| commit | ce98e6086f7083634445f3aaefcbea3b1dcd4fa4 (patch) | |
| tree | 59c3dfdc293b50a5a53a75b34cfa914e17f8e3e3 /src | |
| parent | 9f232a5df07f53dd8fedf680359815dfc5d7d818 (diff) | |
| download | emacs-ce98e6086f7083634445f3aaefcbea3b1dcd4fa4.tar.gz emacs-ce98e6086f7083634445f3aaefcbea3b1dcd4fa4.zip | |
(read_key_sequence): New arg can_return_switch_frame. All callers changed.
(Fread_key_sequence): Likewise.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index fd524fe5105..78f42ce5c7b 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1098,7 +1098,8 @@ command_loop_1 () | |||
| 1098 | call0 (Qrecompute_lucid_menubar); | 1098 | call0 (Qrecompute_lucid_menubar); |
| 1099 | 1099 | ||
| 1100 | /* Read next key sequence; i gets its length. */ | 1100 | /* Read next key sequence; i gets its length. */ |
| 1101 | i = read_key_sequence (keybuf, sizeof keybuf / sizeof keybuf[0], Qnil, 0); | 1101 | i = read_key_sequence (keybuf, sizeof keybuf / sizeof keybuf[0], |
| 1102 | Qnil, 0, 1); | ||
| 1102 | 1103 | ||
| 1103 | ++num_input_keys; | 1104 | ++num_input_keys; |
| 1104 | 1105 | ||
| @@ -4798,11 +4799,13 @@ follow_key (key, nmaps, current, defs, next) | |||
| 4798 | read_char will return it. */ | 4799 | read_char will return it. */ |
| 4799 | 4800 | ||
| 4800 | static int | 4801 | static int |
| 4801 | read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last) | 4802 | read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, |
| 4803 | can_return_switch_frame) | ||
| 4802 | Lisp_Object *keybuf; | 4804 | Lisp_Object *keybuf; |
| 4803 | int bufsize; | 4805 | int bufsize; |
| 4804 | Lisp_Object prompt; | 4806 | Lisp_Object prompt; |
| 4805 | int dont_downcase_last; | 4807 | int dont_downcase_last; |
| 4808 | int can_return_switch_frame; | ||
| 4806 | { | 4809 | { |
| 4807 | int count = specpdl_ptr - specpdl; | 4810 | int count = specpdl_ptr - specpdl; |
| 4808 | 4811 | ||
| @@ -5228,10 +5231,10 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last) | |||
| 5228 | } | 5231 | } |
| 5229 | else if (EQ (kind, Qswitch_frame)) | 5232 | else if (EQ (kind, Qswitch_frame)) |
| 5230 | { | 5233 | { |
| 5231 | /* If we're at the beginning of a key sequence, go | 5234 | /* If we're at the beginning of a key sequence, and the caller |
| 5232 | ahead and return this event. If we're in the | 5235 | says it's okay, go ahead and return this event. If we're |
| 5233 | midst of a key sequence, delay it until the end. */ | 5236 | in the midst of a key sequence, delay it until the end. */ |
| 5234 | if (t > 0) | 5237 | if (t > 0 || !can_return_switch_frame) |
| 5235 | { | 5238 | { |
| 5236 | delayed_switch_frame = key; | 5239 | delayed_switch_frame = key; |
| 5237 | goto replay_key; | 5240 | goto replay_key; |
| @@ -5717,7 +5720,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last) | |||
| 5717 | 5720 | ||
| 5718 | #if 0 /* This doc string is too long for some compilers. | 5721 | #if 0 /* This doc string is too long for some compilers. |
| 5719 | This commented-out definition serves for DOC. */ | 5722 | This commented-out definition serves for DOC. */ |
| 5720 | DEFUN ("read-key-sequence", Fread_key_sequence, Sread_key_sequence, 1, 2, 0, | 5723 | DEFUN ("read-key-sequence", Fread_key_sequence, Sread_key_sequence, 1, 4, 0, |
| 5721 | "Read a sequence of keystrokes and return as a string or vector.\n\ | 5724 | "Read a sequence of keystrokes and return as a string or vector.\n\ |
| 5722 | The sequence is sufficient to specify a non-prefix command in the\n\ | 5725 | The sequence is sufficient to specify a non-prefix command in the\n\ |
| 5723 | current local and global maps.\n\ | 5726 | current local and global maps.\n\ |
| @@ -5750,8 +5753,11 @@ between click and drag, double, or triple events unless you want to.\n\ | |||
| 5750 | lines separating windows, and scroll bars with imaginary keys\n\ | 5753 | lines separating windows, and scroll bars with imaginary keys\n\ |
| 5751 | `mode-line', `vertical-line', and `vertical-scroll-bar'.\n\ | 5754 | `mode-line', `vertical-line', and `vertical-scroll-bar'.\n\ |
| 5752 | \n\ | 5755 | \n\ |
| 5753 | If the user switches frames in the middle of a key sequence, the\n\ | 5756 | Optional fourth argument CAN-RETURN-SWITCH-FRAME non-nil means that this\n\ |
| 5754 | frame-switch event is put off until after the current key sequence.\n\ | 5757 | function will process a switch-frame event if the user switches frames\n\ |
| 5758 | before typing anything. If the user switches frames in the middle of a\n\ | ||
| 5759 | key sequence, or at the start of the sequence but CAN-RETURN-SWITCH-FRAME\n\ | ||
| 5760 | is nil, then the event will be put off until after the current key sequence.\n\ | ||
| 5755 | \n\ | 5761 | \n\ |
| 5756 | `read-key-sequence' checks `function-key-map' for function key\n\ | 5762 | `read-key-sequence' checks `function-key-map' for function key\n\ |
| 5757 | sequences, where they wouldn't conflict with ordinary bindings. See\n\ | 5763 | sequences, where they wouldn't conflict with ordinary bindings. See\n\ |
| @@ -5759,10 +5765,11 @@ sequences, where they wouldn't conflict with ordinary bindings. See\n\ | |||
| 5759 | (prompt, continue_echo) | 5765 | (prompt, continue_echo) |
| 5760 | #endif | 5766 | #endif |
| 5761 | 5767 | ||
| 5762 | DEFUN ("read-key-sequence", Fread_key_sequence, Sread_key_sequence, 1, 3, 0, | 5768 | DEFUN ("read-key-sequence", Fread_key_sequence, Sread_key_sequence, 1, 4, 0, |
| 5763 | 0) | 5769 | 0) |
| 5764 | (prompt, continue_echo, dont_downcase_last) | 5770 | (prompt, continue_echo, dont_downcase_last, can_return_switch_frame) |
| 5765 | Lisp_Object prompt, continue_echo, dont_downcase_last; | 5771 | Lisp_Object prompt, continue_echo, dont_downcase_last; |
| 5772 | Lisp_Object can_return_switch_frame; | ||
| 5766 | { | 5773 | { |
| 5767 | Lisp_Object keybuf[30]; | 5774 | Lisp_Object keybuf[30]; |
| 5768 | register int i; | 5775 | register int i; |
| @@ -5780,7 +5787,8 @@ DEFUN ("read-key-sequence", Fread_key_sequence, Sread_key_sequence, 1, 3, 0, | |||
| 5780 | this_command_key_count = 0; | 5787 | this_command_key_count = 0; |
| 5781 | 5788 | ||
| 5782 | i = read_key_sequence (keybuf, (sizeof keybuf/sizeof (keybuf[0])), | 5789 | i = read_key_sequence (keybuf, (sizeof keybuf/sizeof (keybuf[0])), |
| 5783 | prompt, ! NILP (dont_downcase_last)); | 5790 | prompt, ! NILP (dont_downcase_last), |
| 5791 | ! NILP (can_return_switch_frame)); | ||
| 5784 | 5792 | ||
| 5785 | if (i == -1) | 5793 | if (i == -1) |
| 5786 | { | 5794 | { |