Mercurial > emacs
comparison src/emacs.c @ 83566:ddc474387d53
Import arch branch emacs@sv.gnu.org/emacs--multi-tty--0
author | Miles Bader <miles@gnu.org> |
---|---|
date | Sun, 13 May 2007 13:26:57 +0000 |
parents | dc002877ce12 |
children | 85ebbe91c285 |
comparison
equal
deleted
inserted
replaced
80895:776cb0a1bb24 | 83566:ddc474387d53 |
---|---|
55 | 55 |
56 #include "systty.h" | 56 #include "systty.h" |
57 #include "blockinput.h" | 57 #include "blockinput.h" |
58 #include "syssignal.h" | 58 #include "syssignal.h" |
59 #include "process.h" | 59 #include "process.h" |
60 #include "frame.h" | |
60 #include "termhooks.h" | 61 #include "termhooks.h" |
61 #include "keyboard.h" | 62 #include "keyboard.h" |
62 #include "keymap.h" | 63 #include "keymap.h" |
63 | 64 |
64 #ifdef HAVE_SETLOCALE | 65 #ifdef HAVE_SETLOCALE |
212 work around it, and if that fails, output a warning in dump-emacs. */ | 213 work around it, and if that fails, output a warning in dump-emacs. */ |
213 #define MAX_HEAP_BSS_DIFF (1024*1024) | 214 #define MAX_HEAP_BSS_DIFF (1024*1024) |
214 | 215 |
215 | 216 |
216 #ifdef HAVE_WINDOW_SYSTEM | 217 #ifdef HAVE_WINDOW_SYSTEM |
217 extern Lisp_Object Vwindow_system; | 218 extern Lisp_Object Vinitial_window_system; |
218 #endif /* HAVE_WINDOW_SYSTEM */ | 219 #endif /* HAVE_WINDOW_SYSTEM */ |
219 | 220 |
220 extern Lisp_Object Vauto_save_list_file_name; | 221 extern Lisp_Object Vauto_save_list_file_name; |
221 | 222 |
222 extern Lisp_Object Vinhibit_redisplay; | 223 extern Lisp_Object Vinhibit_redisplay; |
753 | 754 |
754 #endif /* DOUG_LEA_MALLOC */ | 755 #endif /* DOUG_LEA_MALLOC */ |
755 | 756 |
756 | 757 |
757 #define REPORT_EMACS_BUG_ADDRESS "bug-gnu-emacs@gnu.org" | 758 #define REPORT_EMACS_BUG_ADDRESS "bug-gnu-emacs@gnu.org" |
758 #define REPORT_EMACS_BUG_PRETEST_ADDRESS "emacs-pretest-bug@gnu.org" | 759 #define REPORT_EMACS_BUG_PRETEST_ADDRESS "multi-tty@lists.fnord.hu" |
759 | 760 |
760 /* This function is used to determine an address to which bug report should | 761 /* This function is used to determine an address to which bug report should |
761 be sent. */ | 762 be sent. */ |
762 | 763 |
763 char * | 764 char * |
1282 /* Call syms_of_xfaces before init_window_once because that | 1283 /* Call syms_of_xfaces before init_window_once because that |
1283 function creates Vterminal_frame. Termcap frames now use | 1284 function creates Vterminal_frame. Termcap frames now use |
1284 faces, and the face implementation uses some symbols as | 1285 faces, and the face implementation uses some symbols as |
1285 face names. */ | 1286 face names. */ |
1286 syms_of_xfaces (); | 1287 syms_of_xfaces (); |
1288 /* XXX syms_of_keyboard uses some symbols in keymap.c. It would | |
1289 be better to arrange things not to have this dependency. */ | |
1290 syms_of_keymap (); | |
1287 /* Call syms_of_keyboard before init_window_once because | 1291 /* Call syms_of_keyboard before init_window_once because |
1288 keyboard sets up symbols that include some face names that | 1292 keyboard sets up symbols that include some face names that |
1289 the X support will want to use. This can happen when | 1293 the X support will want to use. This can happen when |
1290 CANNOT_DUMP is defined. */ | 1294 CANNOT_DUMP is defined. */ |
1291 syms_of_keyboard (); | 1295 syms_of_keyboard (); |
1479 #endif | 1483 #endif |
1480 | 1484 |
1481 /* egetenv is a pretty low-level facility, which may get called in | 1485 /* egetenv is a pretty low-level facility, which may get called in |
1482 many circumstances; it seems flimsy to put off initializing it | 1486 many circumstances; it seems flimsy to put off initializing it |
1483 until calling init_callproc. */ | 1487 until calling init_callproc. */ |
1484 set_process_environment (); | 1488 set_initial_environment (); |
1485 /* AIX crashes are reported in system versions 3.2.3 and 3.2.4 | 1489 /* AIX crashes are reported in system versions 3.2.3 and 3.2.4 |
1486 if this is not done. Do it after set_process_environment so that we | 1490 if this is not done. Do it after set_global_environment so that we |
1487 don't pollute Vprocess_environment. */ | 1491 don't pollute Vglobal_environment. */ |
1488 /* Setting LANG here will defeat the startup locale processing... */ | 1492 /* Setting LANG here will defeat the startup locale processing... */ |
1489 #ifdef AIX3_2 | 1493 #ifdef AIX3_2 |
1490 putenv ("LANG=C"); | 1494 putenv ("LANG=C"); |
1491 #endif | 1495 #endif |
1492 | 1496 |
1553 #ifdef CLASH_DETECTION | 1557 #ifdef CLASH_DETECTION |
1554 syms_of_filelock (); | 1558 syms_of_filelock (); |
1555 #endif /* CLASH_DETECTION */ | 1559 #endif /* CLASH_DETECTION */ |
1556 syms_of_indent (); | 1560 syms_of_indent (); |
1557 syms_of_insdel (); | 1561 syms_of_insdel (); |
1558 syms_of_keymap (); | 1562 /* syms_of_keymap (); */ |
1559 syms_of_macros (); | 1563 syms_of_macros (); |
1560 syms_of_marker (); | 1564 syms_of_marker (); |
1561 syms_of_minibuf (); | 1565 syms_of_minibuf (); |
1562 syms_of_process (); | 1566 syms_of_process (); |
1563 #ifndef MAC_OS8 | 1567 #ifndef MAC_OS8 |
1564 /* Called before init_window_once for Mac OS Classic. */ | 1568 /* Called before init_window_once for Mac OS Classic. */ |
1565 syms_of_search (); | 1569 syms_of_search (); |
1566 syms_of_frame (); | 1570 syms_of_frame (); |
1567 #endif | 1571 #endif |
1568 syms_of_syntax (); | 1572 syms_of_syntax (); |
1573 syms_of_terminal (); | |
1569 syms_of_term (); | 1574 syms_of_term (); |
1570 syms_of_undo (); | 1575 syms_of_undo (); |
1571 #ifdef HAVE_SOUND | 1576 #ifdef HAVE_SOUND |
1572 syms_of_sound (); | 1577 syms_of_sound (); |
1573 #endif | 1578 #endif |
1648 globals_of_w32menu (); | 1653 globals_of_w32menu (); |
1649 globals_of_w32select (); | 1654 globals_of_w32select (); |
1650 #endif /* HAVE_NTGUI */ | 1655 #endif /* HAVE_NTGUI */ |
1651 } | 1656 } |
1652 | 1657 |
1653 if (!noninteractive) | 1658 init_process (); /* init_display uses add_keyboard_wait_descriptor. */ |
1654 { | |
1655 #ifdef VMS | |
1656 init_vms_input ();/* init_display calls get_frame_size, that needs this. */ | |
1657 #endif /* VMS */ | |
1658 init_display (); /* Determine terminal type. init_sys_modes uses results. */ | |
1659 } | |
1660 #ifndef MAC_OS8 | 1659 #ifndef MAC_OS8 |
1661 /* Called before init_window_once for Mac OS Classic. */ | 1660 /* Called before init_window_once for Mac OS Classic. */ |
1662 init_keyboard (); /* This too must precede init_sys_modes. */ | 1661 init_keyboard (); /* This too must precede init_sys_modes. */ |
1663 #endif | 1662 #endif |
1664 #ifdef VMS | 1663 #ifdef VMS |
1665 init_vmsproc (); /* And this too. */ | 1664 init_vmsproc (); /* And this too. */ |
1666 #endif /* VMS */ | 1665 #endif /* VMS */ |
1667 init_sys_modes (); /* Init system terminal modes (RAW or CBREAK, etc.). */ | 1666 if (!noninteractive) |
1667 { | |
1668 #ifdef VMS | |
1669 init_vms_input ();/* init_display calls get_tty_size, that needs this. */ | |
1670 #endif /* VMS */ | |
1671 init_display (); /* Determine terminal type. Calls init_sys_modes. */ | |
1672 } | |
1668 init_fns (); | 1673 init_fns (); |
1669 init_xdisp (); | 1674 init_xdisp (); |
1670 #ifdef HAVE_WINDOW_SYSTEM | 1675 #ifdef HAVE_WINDOW_SYSTEM |
1671 init_fringe (); | 1676 init_fringe (); |
1672 init_image (); | 1677 init_image (); |
1675 init_editfns (); | 1680 init_editfns (); |
1676 init_floatfns (); | 1681 init_floatfns (); |
1677 #ifdef VMS | 1682 #ifdef VMS |
1678 init_vmsfns (); | 1683 init_vmsfns (); |
1679 #endif /* VMS */ | 1684 #endif /* VMS */ |
1680 init_process (); | |
1681 #ifdef HAVE_SOUND | 1685 #ifdef HAVE_SOUND |
1682 init_sound (); | 1686 init_sound (); |
1683 #endif | 1687 #endif |
1684 init_window (); | 1688 init_window (); |
1685 | 1689 |
2088 | 2092 |
2089 int tpgrp; | 2093 int tpgrp; |
2090 if (EMACS_GET_TTY_PGRP (0, &tpgrp) != -1 | 2094 if (EMACS_GET_TTY_PGRP (0, &tpgrp) != -1 |
2091 && tpgrp == pgrp) | 2095 && tpgrp == pgrp) |
2092 { | 2096 { |
2093 fflush (stdout); | 2097 reset_all_sys_modes (); |
2094 reset_sys_modes (); | |
2095 if (sig && sig != SIGTERM) | 2098 if (sig && sig != SIGTERM) |
2096 fprintf (stderr, "Fatal error (%d)", sig); | 2099 fprintf (stderr, "Fatal error (%d)", sig); |
2097 } | 2100 } |
2098 } | 2101 } |
2099 #else | 2102 #else |
2100 fflush (stdout); | 2103 fflush (stdout); |
2101 reset_sys_modes (); | 2104 reset_all_sys_modes (); |
2102 #endif | 2105 #endif |
2103 | 2106 |
2104 stuff_buffered_input (stuff); | 2107 stuff_buffered_input (stuff); |
2105 | 2108 |
2106 #ifdef subprocesses | 2109 #ifdef subprocesses |
2118 #endif | 2121 #endif |
2119 | 2122 |
2120 #if 0 /* This triggers a bug in XCloseDisplay and is not needed. */ | 2123 #if 0 /* This triggers a bug in XCloseDisplay and is not needed. */ |
2121 #ifdef HAVE_X_WINDOWS | 2124 #ifdef HAVE_X_WINDOWS |
2122 /* It's not safe to call intern here. Maybe we are crashing. */ | 2125 /* It's not safe to call intern here. Maybe we are crashing. */ |
2123 if (!noninteractive && SYMBOLP (Vwindow_system) | 2126 if (!noninteractive && SYMBOLP (Vinitial_window_system) |
2124 && SCHARS (SYMBOL_NAME (Vwindow_system)) == 1 | 2127 && SCHARS (SYMBOL_NAME (Vinitial_window_system)) == 1 |
2125 && SREF (SYMBOL_NAME (Vwindow_system), 0) == 'x' | 2128 && SREF (SYMBOL_NAME (Vinitial_window_system), 0) == 'x' |
2126 && ! no_x) | 2129 && ! no_x) |
2127 Fx_close_current_connection (); | 2130 Fx_close_current_connection (); |
2128 #endif /* HAVE_X_WINDOWS */ | 2131 #endif /* HAVE_X_WINDOWS */ |
2129 #endif | 2132 #endif |
2130 | 2133 |