aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2007-03-10 04:57:18 +0000
committerChong Yidong2007-03-10 04:57:18 +0000
commit638d3da04b05fdf289f4dbb37d327a1f1c8b0645 (patch)
tree4fa77a18063d680bf4c3f56c322e5a0b2c07a1bd /src
parent7469c0f90344fa4ae19da982b8d1a32afad0c062 (diff)
downloademacs-638d3da04b05fdf289f4dbb37d327a1f1c8b0645.tar.gz
emacs-638d3da04b05fdf289f4dbb37d327a1f1c8b0645.zip
(help_form_saved_window_configs): New var.
(read_char_help_form_unwind): New function. (read_char): Don't restore window configuration if a mouse click arrives while the help form is being displayed.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index bf7948868ae..2e94c3cd2fb 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -2450,6 +2450,17 @@ Lisp_Object print_help ();
2450static Lisp_Object kbd_buffer_get_event (); 2450static Lisp_Object kbd_buffer_get_event ();
2451static void record_char (); 2451static void record_char ();
2452 2452
2453static Lisp_Object help_form_saved_window_configs;
2454static Lisp_Object
2455read_char_help_form_unwind (arg)
2456{
2457 Lisp_Object window_config = XCAR (help_form_saved_window_configs);
2458 help_form_saved_window_configs = XCDR (help_form_saved_window_configs);
2459 if (!NILP (window_config))
2460 Fset_window_configuration (window_config);
2461 return Qnil;
2462}
2463
2453#ifdef MULTI_KBOARD 2464#ifdef MULTI_KBOARD
2454static jmp_buf wrong_kboard_jmpbuf; 2465static jmp_buf wrong_kboard_jmpbuf;
2455#endif 2466#endif
@@ -3319,8 +3330,10 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
3319 Lisp_Object tem0; 3330 Lisp_Object tem0;
3320 count = SPECPDL_INDEX (); 3331 count = SPECPDL_INDEX ();
3321 3332
3322 record_unwind_protect (Fset_window_configuration, 3333 help_form_saved_window_configs
3323 Fcurrent_window_configuration (Qnil)); 3334 = Fcons (Fcurrent_window_configuration (Qnil),
3335 help_form_saved_window_configs);
3336 record_unwind_protect (read_char_help_form_unwind, Qnil);
3324 3337
3325 tem0 = Feval (Vhelp_form); 3338 tem0 = Feval (Vhelp_form);
3326 if (STRINGP (tem0)) 3339 if (STRINGP (tem0))
@@ -3328,7 +3341,12 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
3328 3341
3329 cancel_echoing (); 3342 cancel_echoing ();
3330 do 3343 do
3331 c = read_char (0, 0, 0, Qnil, 0, NULL); 3344 {
3345 c = read_char (0, 0, 0, Qnil, 0, NULL);
3346 if (EVENT_HAS_PARAMETERS (c)
3347 && EQ (EVENT_HEAD_KIND (EVENT_HEAD (c)), Qmouse_click))
3348 XSETCAR (help_form_saved_window_configs, Qnil);
3349 }
3332 while (BUFFERP (c)); 3350 while (BUFFERP (c));
3333 /* Remove the help from the frame */ 3351 /* Remove the help from the frame */
3334 unbind_to (count, Qnil); 3352 unbind_to (count, Qnil);
@@ -11335,6 +11353,9 @@ syms_of_keyboard ()
11335 menu_bar_items_vector = Qnil; 11353 menu_bar_items_vector = Qnil;
11336 staticpro (&menu_bar_items_vector); 11354 staticpro (&menu_bar_items_vector);
11337 11355
11356 help_form_saved_window_configs = Qnil;
11357 staticpro (&help_form_saved_window_configs);
11358
11338 defsubr (&Scurrent_idle_time); 11359 defsubr (&Scurrent_idle_time);
11339 defsubr (&Sevent_convert_list); 11360 defsubr (&Sevent_convert_list);
11340 defsubr (&Sread_key_sequence); 11361 defsubr (&Sread_key_sequence);