Mercurial > emacs
comparison src/keyboard.c @ 4600:a4d11a20b724
(kbd_buffer_store_event): Use bcopy to copy
a selection request event.
(read_char): Never start echoing if -batch.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 13 Aug 1993 06:19:21 +0000 |
parents | bd83da57b726 |
children | 1fc792473491 |
comparison
equal
deleted
inserted
replaced
4599:e1d54ee1deea | 4600:a4d11a20b724 |
---|---|
1452 echo_dash (); | 1452 echo_dash (); |
1453 | 1453 |
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 { |
1460 Lisp_Object tem0; | 1461 Lisp_Object tem0; |
1461 | 1462 |
1781 /* If this results in a quit_char being returned to Emacs as | 1782 /* If this results in a quit_char being returned to Emacs as |
1782 input, set Vlast_event_frame properly. If this doesn't | 1783 input, set Vlast_event_frame properly. If this doesn't |
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; |
1791 else | 1792 else |
1792 internal_last_event_frame = focus; | 1793 internal_last_event_frame = focus; |
1814 and that is indistinguishable from an empty buffer. | 1815 and that is indistinguishable from an empty buffer. |
1815 Discard the event if it would fill the last slot. */ | 1816 Discard the event if it would fill the last slot. */ |
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); |
1829 | 1840 |
1830 kbd_store_ptr++; | 1841 kbd_store_ptr++; |
4154 mock_input = last_real_key_start; | 4165 mock_input = last_real_key_start; |
4155 goto replay_sequence; | 4166 goto replay_sequence; |
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) |
4177 { | 4188 { |
4178 key = new_click; | 4189 key = new_click; |
5373 (setq extra-keyboard-modifiers ?\C-x)\n\ | 5384 (setq extra-keyboard-modifiers ?\C-x)\n\ |
5374 all input characters will have the control modifier applied to them.\n\ | 5385 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 |
5382 DEFVAR_LISP ("deactivate-mark", &Vdeactivate_mark, | 5393 DEFVAR_LISP ("deactivate-mark", &Vdeactivate_mark, |
5383 "If an editing command sets this to t, deactivate the mark afterward.\n\ | 5394 "If an editing command sets this to t, deactivate the mark afterward.\n\ |