diff options
| author | Richard M. Stallman | 1993-08-13 06:19:21 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-08-13 06:19:21 +0000 |
| commit | 27203ead54e37dce47f3bb280525f49fd1261d93 (patch) | |
| tree | 04866b4b540222200390858e269afa7fee883cb1 /src | |
| parent | b7444d3195a7f68affb020814b3410822c10346e (diff) | |
| download | emacs-27203ead54e37dce47f3bb280525f49fd1261d93.tar.gz emacs-27203ead54e37dce47f3bb280525f49fd1261d93.zip | |
(kbd_buffer_store_event): Use bcopy to copy
a selection request event.
(read_char): Never start echoing if -batch.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 53 |
1 files changed, 32 insertions, 21 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index b256e904729..e0466553e0f 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1454,6 +1454,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 1454 | /* If in middle of key sequence and minibuffer not active, | 1454 | /* If in middle of key sequence and minibuffer not active, |
| 1455 | start echoing if enough time elapses. */ | 1455 | start echoing if enough time elapses. */ |
| 1456 | if (minibuf_level == 0 && !immediate_echo && this_command_key_count > 0 | 1456 | if (minibuf_level == 0 && !immediate_echo && this_command_key_count > 0 |
| 1457 | && ! noninteractive | ||
| 1457 | && echo_keystrokes > 0 | 1458 | && echo_keystrokes > 0 |
| 1458 | && (echo_area_glyphs == 0 || *echo_area_glyphs == 0)) | 1459 | && (echo_area_glyphs == 0 || *echo_area_glyphs == 0)) |
| 1459 | { | 1460 | { |
| @@ -1783,8 +1784,8 @@ kbd_buffer_store_event (event) | |||
| 1783 | get returned to Emacs as an event, the next event read | 1784 | get returned to Emacs as an event, the next event read |
| 1784 | will set Vlast_event_frame again, so this is safe to do. */ | 1785 | will set Vlast_event_frame again, so this is safe to do. */ |
| 1785 | { | 1786 | { |
| 1786 | Lisp_Object focus = | 1787 | Lisp_Object focus |
| 1787 | FRAME_FOCUS_FRAME (XFRAME (event->frame_or_window)); | 1788 | = FRAME_FOCUS_FRAME (XFRAME (event->frame_or_window)); |
| 1788 | 1789 | ||
| 1789 | if (NILP (focus)) | 1790 | if (NILP (focus)) |
| 1790 | internal_last_event_frame = event->frame_or_window; | 1791 | internal_last_event_frame = event->frame_or_window; |
| @@ -1816,13 +1817,23 @@ kbd_buffer_store_event (event) | |||
| 1816 | if (kbd_fetch_ptr - 1 != kbd_store_ptr) | 1817 | if (kbd_fetch_ptr - 1 != kbd_store_ptr) |
| 1817 | { | 1818 | { |
| 1818 | kbd_store_ptr->kind = event->kind; | 1819 | kbd_store_ptr->kind = event->kind; |
| 1819 | kbd_store_ptr->code = event->code; | 1820 | if (event->kind == selection_request_event) |
| 1820 | kbd_store_ptr->part = event->part; | 1821 | { |
| 1821 | kbd_store_ptr->frame_or_window = event->frame_or_window; | 1822 | /* We must not use the ordinary copying code for this case, |
| 1822 | kbd_store_ptr->modifiers = event->modifiers; | 1823 | since `part' is an enum and copying it might not copy enough |
| 1823 | kbd_store_ptr->x = event->x; | 1824 | in this case. */ |
| 1824 | kbd_store_ptr->y = event->y; | 1825 | bcopy (event, kbd_store_ptr, sizeof (*event)); |
| 1825 | kbd_store_ptr->timestamp = event->timestamp; | 1826 | } |
| 1827 | else | ||
| 1828 | { | ||
| 1829 | kbd_store_ptr->code = event->code; | ||
| 1830 | kbd_store_ptr->part = event->part; | ||
| 1831 | kbd_store_ptr->frame_or_window = event->frame_or_window; | ||
| 1832 | kbd_store_ptr->modifiers = event->modifiers; | ||
| 1833 | kbd_store_ptr->x = event->x; | ||
| 1834 | kbd_store_ptr->y = event->y; | ||
| 1835 | kbd_store_ptr->timestamp = event->timestamp; | ||
| 1836 | } | ||
| 1826 | (XVECTOR (kbd_buffer_frame_or_window)->contents[kbd_store_ptr | 1837 | (XVECTOR (kbd_buffer_frame_or_window)->contents[kbd_store_ptr |
| 1827 | - kbd_buffer] | 1838 | - kbd_buffer] |
| 1828 | = event->frame_or_window); | 1839 | = event->frame_or_window); |
| @@ -4156,21 +4167,21 @@ read_key_sequence (keybuf, bufsize, prompt) | |||
| 4156 | } | 4167 | } |
| 4157 | } | 4168 | } |
| 4158 | 4169 | ||
| 4159 | new_head = | 4170 | new_head |
| 4160 | apply_modifiers (modifiers, XCONS (breakdown)->car); | 4171 | = apply_modifiers (modifiers, XCONS (breakdown)->car); |
| 4161 | new_click = | 4172 | new_click |
| 4162 | Fcons (new_head, Fcons (EVENT_START (key), Qnil)); | 4173 | = Fcons (new_head, Fcons (EVENT_START (key), Qnil)); |
| 4163 | 4174 | ||
| 4164 | /* Look for a binding for this new key. follow_key | 4175 | /* Look for a binding for this new key. follow_key |
| 4165 | promises that it didn't munge submaps the | 4176 | promises that it didn't munge submaps the |
| 4166 | last time we called it, since key was unbound. */ | 4177 | last time we called it, since key was unbound. */ |
| 4167 | first_binding = | 4178 | first_binding |
| 4168 | (follow_key (new_click, | 4179 | = (follow_key (new_click, |
| 4169 | nmaps - local_first_binding, | 4180 | nmaps - local_first_binding, |
| 4170 | submaps + local_first_binding, | 4181 | submaps + local_first_binding, |
| 4171 | defs + local_first_binding, | 4182 | defs + local_first_binding, |
| 4172 | submaps + local_first_binding) | 4183 | submaps + local_first_binding) |
| 4173 | + local_first_binding); | 4184 | + local_first_binding); |
| 4174 | 4185 | ||
| 4175 | /* If that click is bound, go for it. */ | 4186 | /* If that click is bound, go for it. */ |
| 4176 | if (first_binding < nmaps) | 4187 | if (first_binding < nmaps) |
| @@ -5375,7 +5386,7 @@ all input characters will have the control modifier applied to them.\n\ | |||
| 5375 | \n\ | 5386 | \n\ |
| 5376 | Note that the character ?\C-@, equivalent to the integer zero, does\n\ | 5387 | Note that the character ?\C-@, equivalent to the integer zero, does\n\ |
| 5377 | not count as a control character; rather, it counts as a character\n\ | 5388 | not count as a control character; rather, it counts as a character\n\ |
| 5378 | with no modifiers; thus, setting extra_keyboard_modifiers to zero\n\ | 5389 | with no modifiers; thus, setting `extra-keyboard-modifiers' to zero\n\ |
| 5379 | cancels any modification."); | 5390 | cancels any modification."); |
| 5380 | extra_keyboard_modifiers = 0; | 5391 | extra_keyboard_modifiers = 0; |
| 5381 | 5392 | ||