comparison src/event-stream.c @ 5691:b490ddbd42aa

Back out 7371081ce8f7, I have a better approach.
author Aidan Kehoe <kehoea@parhasard.net>
date Tue, 06 Nov 2012 21:34:15 +0000
parents 7371081ce8f7
children fffa15138019
comparison
equal deleted inserted replaced
5690:7b5f88e5b456 5691:b490ddbd42aa
4548 else /* key sequence is bound to a command */ 4548 else /* key sequence is bound to a command */
4549 { 4549 {
4550 int magic_undo = 0; 4550 int magic_undo = 0;
4551 Elemcount magic_undo_count = 20; 4551 Elemcount magic_undo_count = 20;
4552 4552
4553 Vthis_command = leaf;
4554
4553 /* Don't push an undo boundary if the command set the prefix arg, 4555 /* Don't push an undo boundary if the command set the prefix arg,
4554 or if we are executing a keyboard macro, or if in the 4556 or if we are executing a keyboard macro, or if in the
4555 minibuffer. If the command we are about to execute is 4557 minibuffer. If the command we are about to execute is
4556 self-insert, it's tricky: up to 20 consecutive self-inserts may 4558 self-insert, it's tricky: up to 20 consecutive self-inserts may
4557 be done without an undo boundary. This counter is reset as 4559 be done without an undo boundary. This counter is reset as
4563 number 20 to something else. #### DOCUMENT THIS! */ 4565 number 20 to something else. #### DOCUMENT THIS! */
4564 4566
4565 if (SYMBOLP (leaf)) 4567 if (SYMBOLP (leaf))
4566 { 4568 {
4567 Lisp_Object prop = Fget (leaf, Qself_insert_defer_undo, Qnil); 4569 Lisp_Object prop = Fget (leaf, Qself_insert_defer_undo, Qnil);
4568 Lisp_Object remap = Qnil;
4569
4570 if (NATNUMP (prop)) 4570 if (NATNUMP (prop))
4571 { 4571 {
4572 magic_undo = 1; 4572 magic_undo = 1;
4573 if (FIXNUMP (prop)) 4573 if (FIXNUMP (prop))
4574 { 4574 {
4585 } 4585 }
4586 else if (!NILP (prop)) 4586 else if (!NILP (prop))
4587 magic_undo = 1; 4587 magic_undo = 1;
4588 else if (EQ (leaf, Qself_insert_command)) 4588 else if (EQ (leaf, Qself_insert_command))
4589 magic_undo = 1; 4589 magic_undo = 1;
4590
4591 remap = command_remapping_for_event (leaf, event);
4592 if (!NILP (remap))
4593 {
4594 leaf = remap;
4595 }
4596 } 4590 }
4597
4598 Vthis_command = leaf;
4599 4591
4600 if (!magic_undo) 4592 if (!magic_undo)
4601 command_builder->self_insert_countdown = 0; 4593 command_builder->self_insert_countdown = 0;
4602 if (NILP (XCONSOLE (console)->prefix_arg) 4594 if (NILP (XCONSOLE (console)->prefix_arg)
4603 && NILP (Vexecuting_macro) 4595 && NILP (Vexecuting_macro)