comparison src/keyboard.c @ 10827:4dfd3634b155

(unlock_display): New function. (cmd_error, command_loop_1): Call it when appropriate. (read_char): If no current display, don't try to echo.
author Karl Heuer <kwzh@gnu.org>
date Sat, 25 Feb 1995 07:13:09 +0000
parents 5bef43a53c01
children 06d6b2e17987
comparison
equal deleted inserted replaced
10826:bd0ab0601489 10827:4dfd3634b155
731 command_loop_level--; 731 command_loop_level--;
732 update_mode_lines = 1; 732 update_mode_lines = 1;
733 return Qnil; 733 return Qnil;
734 } 734 }
735 735
736 #ifdef MULTI_PERDISPLAY
737 static void
738 unlock_display ()
739 {
740 if (CONSP (Vunread_command_events))
741 current_perdisplay->kbd_queue
742 = nconc2 (Vunread_command_events, current_perdisplay->kbd_queue);
743 Vunread_command_events = Qnil;
744 current_perdisplay = 0;
745 display_locked = 0;
746 }
747 #endif
748
736 Lisp_Object 749 Lisp_Object
737 cmd_error (data) 750 cmd_error (data)
738 Lisp_Object data; 751 Lisp_Object data;
739 { 752 {
740 Vstandard_output = Qt; 753 Vstandard_output = Qt;
748 761
749 Vquit_flag = Qnil; 762 Vquit_flag = Qnil;
750 763
751 Vinhibit_quit = Qnil; 764 Vinhibit_quit = Qnil;
752 #ifdef MULTI_PERDISPLAY 765 #ifdef MULTI_PERDISPLAY
753 current_perdisplay = 0; 766 unlock_display ();
754 display_locked = 0;
755 #endif 767 #endif
756 768
757 return make_number (0); 769 return make_number (0);
758 } 770 }
759 771
949 int no_redisplay; 961 int no_redisplay;
950 int no_direct; 962 int no_direct;
951 int prev_modiff; 963 int prev_modiff;
952 struct buffer *prev_buffer; 964 struct buffer *prev_buffer;
953 #ifdef MULTI_PERDISPLAY 965 #ifdef MULTI_PERDISPLAY
954 PERDISPLAY *outer_perdisplay = current_perdisplay; 966 int was_locked = display_locked;
955 #endif 967 #endif
956 968
957 Vdeactivate_mark = Qnil; 969 Vdeactivate_mark = Qnil;
958 waiting_for_input = 0; 970 waiting_for_input = 0;
959 if (current_perdisplay) 971 if (current_perdisplay)
1273 1285
1274 if (defining_kbd_macro && NILP (current_perdisplay->Vprefix_arg)) 1286 if (defining_kbd_macro && NILP (current_perdisplay->Vprefix_arg))
1275 finalize_kbd_macro_chars (); 1287 finalize_kbd_macro_chars ();
1276 1288
1277 #ifdef MULTI_PERDISPLAY 1289 #ifdef MULTI_PERDISPLAY
1278 current_perdisplay = outer_perdisplay; 1290 if (!was_locked)
1279 display_locked = (current_perdisplay != 0); 1291 unlock_display ();
1280 #endif 1292 #endif
1281 } 1293 }
1282 } 1294 }
1283 1295
1284 /* If we get an error while running the hook, cause the hook variable 1296 /* If we get an error while running the hook, cause the hook variable
1598 Vquit_flag = Qnil; 1610 Vquit_flag = Qnil;
1599 1611
1600 goto non_reread; 1612 goto non_reread;
1601 } 1613 }
1602 1614
1603 /* Message turns off echoing unless more keystrokes turn it on again. */ 1615 if (current_perdisplay)
1604 if (echo_area_glyphs && *echo_area_glyphs 1616 {
1605 && echo_area_glyphs != current_perdisplay->echobuf) 1617 /* Message turns off echoing unless more keystrokes turn it on again. */
1606 cancel_echoing (); 1618 if (echo_area_glyphs && *echo_area_glyphs
1607 else 1619 && echo_area_glyphs != current_perdisplay->echobuf)
1608 /* If already echoing, continue. */ 1620 cancel_echoing ();
1609 echo_dash (); 1621 else
1622 /* If already echoing, continue. */
1623 echo_dash ();
1624 }
1610 1625
1611 /* Try reading a character via menu prompting in the minibuf. 1626 /* Try reading a character via menu prompting in the minibuf.
1612 Try this before the sit-for, because the sit-for 1627 Try this before the sit-for, because the sit-for
1613 would do the wrong thing if we are supposed to do 1628 would do the wrong thing if we are supposed to do
1614 menu prompting. If EVENT_HAS_PARAMETERS then we are reading 1629 menu prompting. If EVENT_HAS_PARAMETERS then we are reading
1629 } 1644 }
1630 } 1645 }
1631 1646
1632 /* If in middle of key sequence and minibuffer not active, 1647 /* If in middle of key sequence and minibuffer not active,
1633 start echoing if enough time elapses. */ 1648 start echoing if enough time elapses. */
1634 if (minibuf_level == 0 && !current_perdisplay->immediate_echo 1649 if (current_perdisplay
1650 && minibuf_level == 0
1651 && !current_perdisplay->immediate_echo
1635 && this_command_key_count > 0 1652 && this_command_key_count > 0
1636 && ! noninteractive 1653 && ! noninteractive
1637 && echo_keystrokes > 0 1654 && echo_keystrokes > 0
1638 && (echo_area_glyphs == 0 || *echo_area_glyphs == 0)) 1655 && (echo_area_glyphs == 0 || *echo_area_glyphs == 0))
1639 { 1656 {