comparison src/keyboard.c @ 83008:040dd41ed7d0

Hookified termcap devices, added bootstrap display device, plus many bugfixes. lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells. lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells. src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations. (get_named_tty_display): New prototype. (tty_clear_end_of_line, term_init): Updated to new prototype. (initial_term_init): Renamed to init_initial_display. src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call. (update_frame): Don't flush the tty of there is no tty. (init_display): Set up a termcap display on the controlling tty and change the initial frame to use that. Delete the initial display. src/frame.c (Fframep): Return t for the initial frame. (make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init. (make_terminal_frame): Removed special cases for creating the initial frame. src/frame.h (enum output_method): New entry: output_initial for the bootstrap display. (FRAME_INITIAL_P): New macro. (make_initial_frame): New prototype. src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment. (init_keyboard): Added comment about exiting on SIGINT. (Fset_input_mode): A termcap frame is never the initial frame anymore. src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype. (reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call. src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes. src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook. src/term.c (initial_display): New variable. (tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to) (tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line) (tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions. (ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to) (clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs) (delete_glyphs, ins_del_lines): Removed special casing of termcap displays. (get_tty_display): New function. (Ftty_display_color_p, Ftty_display_color_cells): Use it. (get_named_tty_display): Removed static. (tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter instead of tty_display_info for hook compatibility. (set_terminal_modes, reset_terminal_modes): Removed. (initial_term_init): Renamed to init_initial_display. Set up an output_initial device, not a termcap display. (delete_initial_display): New function. (maybe_fatal): New function, for private use of term_init. (term_init): New parameter for choosing between fatal and simple errors. Removed incomprehensible special casing for the second initialization of the controlling tty. Use maybe_fatal for error handling. Initialize termcap display hooks in the new device. Initialize the display pointer in the tty_display_info structure. (delete_tty): Replace order of reset_sys_modes and delete_display. src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame. src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device. src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
author Karoly Lorentey <lorentey@elte.hu>
date Fri, 09 Jan 2004 18:57:53 +0000
parents c0cb35d94ea7
children b2b37c85b00a
comparison
equal deleted inserted replaced
83007:c0cb35d94ea7 83008:040dd41ed7d0
10279 must reestablish each time */ 10279 must reestablish each time */
10280 signal (SIGINT, interrupt_signal); 10280 signal (SIGINT, interrupt_signal);
10281 signal (SIGQUIT, interrupt_signal); 10281 signal (SIGQUIT, interrupt_signal);
10282 #endif /* USG */ 10282 #endif /* USG */
10283 10283
10284 if (! tty_list)
10285 {
10286 /* If there are no tty frames, exit Emacs.
10287
10288 Emacs should exit on SIGINT if and only if there are no
10289 frames on its controlling tty and the signal came from there.
10290 We can check for the first condition, but (alas) not for the
10291 second. The best we can do is that we only exit if we are
10292 sure that the SIGINT was from the controlling tty, i.e., if
10293 there are no termcap frames.
10294 */
10295 Fkill_emacs (Qnil);
10296
10297 errno = old_errno;
10298 return;
10299 }
10300
10284 cancel_echoing (); 10301 cancel_echoing ();
10285 10302
10303 /* XXX This code needs to be revised for multi-tty support. */
10286 if (!NILP (Vquit_flag) 10304 if (!NILP (Vquit_flag)
10287 && (FRAME_TERMCAP_P (sf) || FRAME_MSDOS_P (sf))) 10305 && (FRAME_TERMCAP_P (sf) || FRAME_MSDOS_P (sf)))
10288 { 10306 {
10289 /* If SIGINT isn't blocked, don't let us be interrupted by 10307 /* If SIGINT isn't blocked, don't let us be interrupted by
10290 another SIGINT, it might be harmful due to non-reentrancy 10308 another SIGINT, it might be harmful due to non-reentrancy
10461 stop_polling (); 10479 stop_polling ();
10462 #endif 10480 #endif
10463 10481
10464 #ifndef DOS_NT 10482 #ifndef DOS_NT
10465 /* this causes startup screen to be restored and messes with the mouse */ 10483 /* this causes startup screen to be restored and messes with the mouse */
10466 if (FRAME_TERMCAP_P (SELECTED_FRAME ()) && CURTTY ()->type) 10484 if (FRAME_TERMCAP_P (SELECTED_FRAME ()))
10467 reset_sys_modes (CURTTY ()); 10485 reset_sys_modes (CURTTY ());
10468 #endif 10486 #endif
10469 10487
10470 #ifdef SIGIO 10488 #ifdef SIGIO
10471 /* Note SIGIO has been undef'd if FIONREAD is missing. */ 10489 /* Note SIGIO has been undef'd if FIONREAD is missing. */
10500 tty->meta_key = 1; 10518 tty->meta_key = 1;
10501 else 10519 else
10502 tty->meta_key = 2; 10520 tty->meta_key = 2;
10503 } 10521 }
10504 10522
10505 if (!NILP (quit)) 10523 if (FRAME_TERMCAP_P (XFRAME (selected_frame)) && !NILP (quit))
10506 /* Don't let this value be out of range. */ 10524 /* Don't let this value be out of range. */
10507 quit_char = XINT (quit) & (CURTTY ()->meta_key ? 0377 : 0177); 10525 quit_char = XINT (quit) & (CURTTY ()->meta_key ? 0377 : 0177);
10508 10526
10509 #ifndef DOS_NT 10527 #ifndef DOS_NT
10510 if (FRAME_TERMCAP_P (XFRAME (selected_frame)) && CURTTY ()->type) 10528 if (FRAME_TERMCAP_P (XFRAME (selected_frame)) && CURTTY ()->type)
10658 wipe_kboard (current_kboard); 10676 wipe_kboard (current_kboard);
10659 init_kboard (current_kboard); 10677 init_kboard (current_kboard);
10660 10678
10661 if (!noninteractive) 10679 if (!noninteractive)
10662 { 10680 {
10681 /* Before multi-tty support, these handlers used to be installed
10682 only if the current session was a tty session. Now an Emacs
10683 session may have multiple display types, so we always handle
10684 SIGINT. There is special code in interrupt_signal to exit
10685 Emacs on SIGINT when there are no termcap frames. */
10663 signal (SIGINT, interrupt_signal); 10686 signal (SIGINT, interrupt_signal);
10664 #if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS) 10687 #if defined (HAVE_TERMIO) || defined (HAVE_TERMIOS)
10665 /* For systems with SysV TERMIO, C-g is set up for both SIGINT and 10688 /* For systems with SysV TERMIO, C-g is set up for both SIGINT and
10666 SIGQUIT and we can't tell which one it will give us. */ 10689 SIGQUIT and we can't tell which one it will give us. */
10667 signal (SIGQUIT, interrupt_signal); 10690 signal (SIGQUIT, interrupt_signal);