aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2002-04-12 05:50:15 +0000
committerStefan Monnier2002-04-12 05:50:15 +0000
commit2e1a49ad096d8b08aa6b373341c9a27be994f9b8 (patch)
tree13ba7bf7042456fd9fa81545447238febecfa682 /src
parent5626cdef22440a18235691e9f138169a0257f6a5 (diff)
downloademacs-2e1a49ad096d8b08aa6b373341c9a27be994f9b8.tar.gz
emacs-2e1a49ad096d8b08aa6b373341c9a27be994f9b8.zip
(command_loop_1): Turn off transient-mark-mode rather
than deactivating the mark if tmm is set to `lambda'. (gen_help_event, kbd_buffer_store_help_event, kbd_buffer_get_event): Use a single event for HELP_EVENT. (Fexecute_extended_command): Save last_point_position.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c68
1 files changed, 28 insertions, 40 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index f3ff23e70a9..0ea0bcaef25 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1718,8 +1718,14 @@ command_loop_1 ()
1718 { 1718 {
1719 if (!NILP (Vdeactivate_mark) && !NILP (Vtransient_mark_mode)) 1719 if (!NILP (Vdeactivate_mark) && !NILP (Vtransient_mark_mode))
1720 { 1720 {
1721 current_buffer->mark_active = Qnil; 1721 /* We could also call `deactivate'mark'. */
1722 call1 (Vrun_hooks, intern ("deactivate-mark-hook")); 1722 if (EQ (Vtransient_mark_mode, Qlambda))
1723 Vtransient_mark_mode = Qnil;
1724 else
1725 {
1726 current_buffer->mark_active = Qnil;
1727 call1 (Vrun_hooks, intern ("deactivate-mark-hook"));
1728 }
1723 } 1729 }
1724 else if (current_buffer != prev_buffer || MODIFF != prev_modiff) 1730 else if (current_buffer != prev_buffer || MODIFF != prev_modiff)
1725 call1 (Vrun_hooks, intern ("activate-mark-hook")); 1731 call1 (Vrun_hooks, intern ("activate-mark-hook"));
@@ -3444,25 +3450,17 @@ gen_help_event (bufp, size, help, frame, window, object, pos)
3444 Lisp_Object help, frame, object, window; 3450 Lisp_Object help, frame, object, window;
3445 int pos; 3451 int pos;
3446{ 3452{
3447 int nevents_stored = 0; 3453 if (size >= 1)
3448
3449 if (size >= 2)
3450 { 3454 {
3451 bufp->kind = HELP_EVENT; 3455 bufp->kind = HELP_EVENT;
3452 bufp->frame_or_window = frame; 3456 bufp->frame_or_window = frame;
3453 bufp->arg = object; 3457 bufp->arg = object;
3454 bufp->x = make_number (pos); 3458 bufp->x = WINDOWP (window) ? window : frame;
3455 bufp->code = 0; 3459 bufp->y = help;
3456 3460 bufp->code = make_number (pos);
3457 ++bufp; 3461 return 1;
3458 bufp->kind = HELP_EVENT;
3459 bufp->frame_or_window = WINDOWP (window) ? window : frame;
3460 bufp->arg = help;
3461 bufp->code = 1;
3462 nevents_stored = 2;
3463 } 3462 }
3464 3463 return 0;
3465 return nevents_stored;
3466} 3464}
3467 3465
3468 3466
@@ -3477,16 +3475,10 @@ kbd_buffer_store_help_event (frame, help)
3477 event.kind = HELP_EVENT; 3475 event.kind = HELP_EVENT;
3478 event.frame_or_window = frame; 3476 event.frame_or_window = frame;
3479 event.arg = Qnil; 3477 event.arg = Qnil;
3480 event.x = make_number (0); 3478 event.x = Qnil;
3479 event.y = help;
3481 event.code = 0; 3480 event.code = 0;
3482 kbd_buffer_store_event (&event); 3481 kbd_buffer_store_event (&event);
3483
3484 event.kind = HELP_EVENT;
3485 event.frame_or_window = frame;
3486 event.arg = help;
3487 event.x = make_number (0);
3488 event.code = 1;
3489 kbd_buffer_store_event (&event);
3490} 3482}
3491 3483
3492 3484
@@ -3758,28 +3750,20 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
3758 kbd_fetch_ptr = event + 1; 3750 kbd_fetch_ptr = event + 1;
3759 else if (event->kind == HELP_EVENT) 3751 else if (event->kind == HELP_EVENT)
3760 { 3752 {
3761 /* There are always two HELP_EVENTs in the input queue. */
3762 Lisp_Object object, position, help, frame, window; 3753 Lisp_Object object, position, help, frame, window;
3763 3754
3764 xassert (event->code == 0);
3765 frame = event->frame_or_window; 3755 frame = event->frame_or_window;
3766 object = event->arg; 3756 object = event->arg;
3767 position = event->x; 3757 position = make_number (event->code);
3758 window = event->x;
3759 help = event->y;
3768 clear_event (event); 3760 clear_event (event);
3769 3761
3770 kbd_fetch_ptr = event + 1; 3762 kbd_fetch_ptr = event + 1;
3771 event = ((kbd_fetch_ptr < kbd_buffer + KBD_BUFFER_SIZE)
3772 ? kbd_fetch_ptr
3773 : kbd_buffer);
3774 xassert (event->code == 1);
3775 help = event->arg;
3776 window = event->frame_or_window;
3777 if (!WINDOWP (window)) 3763 if (!WINDOWP (window))
3778 window = Qnil; 3764 window = Qnil;
3779 obj = Fcons (Qhelp_echo, 3765 obj = Fcons (Qhelp_echo,
3780 list5 (frame, help, window, object, position)); 3766 list5 (frame, help, window, object, position));
3781 clear_event (event);
3782 kbd_fetch_ptr = event + 1;
3783 } 3767 }
3784 else if (event->kind == FOCUS_IN_EVENT) 3768 else if (event->kind == FOCUS_IN_EVENT)
3785 { 3769 {
@@ -7129,8 +7113,6 @@ tool_bar_items (reuse, nitems)
7129 int nmaps, i; 7113 int nmaps, i;
7130 Lisp_Object oquit; 7114 Lisp_Object oquit;
7131 Lisp_Object *tmaps; 7115 Lisp_Object *tmaps;
7132 extern Lisp_Object Voverriding_local_map_menu_flag;
7133 extern Lisp_Object Voverriding_local_map;
7134 7116
7135 *nitems = 0; 7117 *nitems = 0;
7136 7118
@@ -9355,14 +9337,17 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_
9355{ 9337{
9356 Lisp_Object function; 9338 Lisp_Object function;
9357 char buf[40]; 9339 char buf[40];
9358 Lisp_Object saved_keys; 9340 int saved_last_point_position;
9341 Lisp_Object saved_keys, saved_last_point_position_buffer;
9359 Lisp_Object bindings, value; 9342 Lisp_Object bindings, value;
9360 struct gcpro gcpro1, gcpro2; 9343 struct gcpro gcpro1, gcpro2, gcpro3;
9361 9344
9362 saved_keys = Fvector (this_command_key_count, 9345 saved_keys = Fvector (this_command_key_count,
9363 XVECTOR (this_command_keys)->contents); 9346 XVECTOR (this_command_keys)->contents);
9347 saved_last_point_position_buffer = last_point_position_buffer;
9348 saved_last_point_position = last_point_position;
9364 buf[0] = 0; 9349 buf[0] = 0;
9365 GCPRO2 (saved_keys, prefixarg); 9350 GCPRO3 (saved_keys, prefixarg, saved_last_point_position_buffer);
9366 9351
9367 if (EQ (prefixarg, Qminus)) 9352 if (EQ (prefixarg, Qminus))
9368 strcpy (buf, "- "); 9353 strcpy (buf, "- ");
@@ -9425,6 +9410,9 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_
9425 add_command_key (make_number ('\015')); 9410 add_command_key (make_number ('\015'));
9426 } 9411 }
9427 9412
9413 last_point_position = saved_last_point_position;
9414 last_point_position_buffer = saved_last_point_position_buffer;
9415
9428 UNGCPRO; 9416 UNGCPRO;
9429 9417
9430 function = Fintern (function, Qnil); 9418 function = Fintern (function, Qnil);