comparison src/emacs.c @ 5118:e0db3c197671 ben-lisp-object

merge up to latest default branch, doesn't compile yet
author Ben Wing <ben@xemacs.org>
date Sat, 26 Dec 2009 21:18:49 -0600
parents 3742ea8250b5 aa5ed11f473b
children b5df3737028a
comparison
equal deleted inserted replaced
5117:3742ea8250b5 5118:e0db3c197671
540 Lisp_Object Vlisp_directory, Vconfigure_lisp_directory; 540 Lisp_Object Vlisp_directory, Vconfigure_lisp_directory;
541 Lisp_Object Vmule_lisp_directory, Vconfigure_mule_lisp_directory; 541 Lisp_Object Vmule_lisp_directory, Vconfigure_mule_lisp_directory;
542 Lisp_Object Vmodule_directory, Vconfigure_module_directory; 542 Lisp_Object Vmodule_directory, Vconfigure_module_directory;
543 Lisp_Object Vsite_module_directory, Vconfigure_site_module_directory; 543 Lisp_Object Vsite_module_directory, Vconfigure_site_module_directory;
544 Lisp_Object Vconfigure_package_path; 544 Lisp_Object Vconfigure_package_path;
545 Lisp_Object Vconfigure_early_package_directories;
546 Lisp_Object Vconfigure_late_package_directories;
547 Lisp_Object Vconfigure_last_package_directories;
545 Lisp_Object Vdata_directory, Vconfigure_data_directory; 548 Lisp_Object Vdata_directory, Vconfigure_data_directory;
546 Lisp_Object Vdoc_directory, Vconfigure_doc_directory; 549 Lisp_Object Vdoc_directory, Vconfigure_doc_directory;
547 Lisp_Object Vconfigure_lock_directory; 550 Lisp_Object Vconfigure_lock_directory;
548 Lisp_Object Vdata_directory_list; 551 Lisp_Object Vdata_directory_list;
549 Lisp_Object Vconfigure_info_directory; 552 Lisp_Object Vconfigure_info_directory;
801 804
802 Too bad we can't just use getopt for all of this, but we don't have 805 Too bad we can't just use getopt for all of this, but we don't have
803 enough information to do it right. */ 806 enough information to do it right. */
804 807
805 static int 808 static int
806 argmatch (Wexttext **argv, int argc, Ascbyte *sstr, Ascbyte *lstr, 809 argmatch (Wexttext **argv, int argc, const Ascbyte *sstr, const Ascbyte *lstr,
807 int minlen, Wexttext **valptr, int *skipptr) 810 int minlen, Wexttext **valptr, int *skipptr)
808 { 811 {
809 Wexttext *p = NULL; 812 Wexttext *p = NULL;
810 Charcount arglen; 813 Charcount arglen;
811 Wexttext *arg; 814 Wexttext *arg;
857 return 0; 860 return 0;
858 } 861 }
859 } 862 }
860 863
861 static void 864 static void
862 check_compatible_window_system (Ascbyte *must) 865 check_compatible_window_system (const Ascbyte *must)
863 { 866 {
864 if (display_use && strcmp (display_use, must)) 867 if (display_use && strcmp (display_use, must))
865 fatal ("Incompatible window system type `%s': `%s' already specified", 868 fatal ("Incompatible window system type `%s': `%s' already specified",
866 must, display_use); 869 must, display_use);
867 display_use = must; 870 display_use = must;
890 main_1 (int argc, Wexttext **argv, Wexttext **UNUSED (envp), int restart) 893 main_1 (int argc, Wexttext **argv, Wexttext **UNUSED (envp), int restart)
891 { 894 {
892 Rawbyte stack_bottom_variable; 895 Rawbyte stack_bottom_variable;
893 int skip_args = 0; 896 int skip_args = 0;
894 Lisp_Object load_me; 897 Lisp_Object load_me;
895 #ifdef NeXT
896 extern int malloc_cookie;
897 #endif
898 898
899 #if (!defined (SYSTEM_MALLOC) && !defined (HAVE_LIBMCHECK) \ 899 #if (!defined (SYSTEM_MALLOC) && !defined (HAVE_LIBMCHECK) \
900 && !defined (DOUG_LEA_MALLOC)) 900 && !defined (DOUG_LEA_MALLOC))
901 /* Make sure that any libraries we link against haven't installed a 901 /* Make sure that any libraries we link against haven't installed a
902 hook for a gmalloc of a potentially incompatible version. */ 902 hook for a gmalloc of a potentially incompatible version. */
906 __realloc_hook = NULL; 906 __realloc_hook = NULL;
907 __free_hook = NULL; 907 __free_hook = NULL;
908 #endif /* not SYSTEM_MALLOC or HAVE_LIBMCHECK or DOUG_LEA_MALLOC */ 908 #endif /* not SYSTEM_MALLOC or HAVE_LIBMCHECK or DOUG_LEA_MALLOC */
909 909
910 noninteractive = 0; 910 noninteractive = 0;
911 display_use = 0; 911 display_use = NULL;
912 inhibit_non_essential_conversion_operations = 1; 912 inhibit_non_essential_conversion_operations = 1;
913 913
914 #ifdef MC_ALLOC 914 #ifdef NEW_GC
915 #ifndef PDUMP 915 #ifndef PDUMP
916 if (!initialized) 916 if (!initialized)
917 #endif 917 #endif
918 { 918 {
919 if (!restart) 919 if (!restart)
922 #ifdef ALLOC_TYPE_STATS 922 #ifdef ALLOC_TYPE_STATS
923 init_lrecord_stats (); 923 init_lrecord_stats ();
924 #endif /* ALLOC_TYPE_STATS */ 924 #endif /* ALLOC_TYPE_STATS */
925 } 925 }
926 } 926 }
927 #endif /* MC_ALLOC */ 927 #endif /* NEW_GC */
928 928
929 #ifdef NeXT
930 /* 19-Jun-1995 -baw
931 * NeXT secret magic, ripped from Emacs-for-NS by Carl Edman
932 * <cedman@princeton.edu>. Note that even Carl doesn't know what this
933 * does; it was provided by NeXT, and it presumably makes NS's mallocator
934 * work with dumping. But malloc_jumpstart() and malloc_freezedry() in
935 * unexnext.c are both completely undocumented, even in NS header files!
936 * But hey, it solves all NS related memory problems, so who's
937 * complaining? */
938 if (initialized && malloc_jumpstart (malloc_cookie) != 0)
939 stderr_out ("malloc jumpstart failed!\n");
940 #endif /* NeXT */
941
942 /*
943 #if defined (GNU_MALLOC) && \
944 defined (ERROR_CHECK_MALLOC) && \
945 !defined (HAVE_LIBMCHECK)
946 */
947 #if defined (LOSING_GCC_DESTRUCTOR_FREE_BUG) 929 #if defined (LOSING_GCC_DESTRUCTOR_FREE_BUG)
948 /* Prior to XEmacs 21, this was `#if 0'ed out. */ 930 /* Prior to XEmacs 21, this was `#if 0'ed out. */
949 /* I'm enabling this because it is the only reliable way I've found to */ 931 /* I'm enabling this because it is the only reliable way I've found to */
950 /* prevent a very annoying problem where GCC will attempt to free (3) */ 932 /* prevent a very annoying problem where GCC will attempt to free (3) */
951 /* memory at exit() and cause a coredump. */ 933 /* memory at exit() and cause a coredump. */
952 init_free_hook (); 934 init_free_hook ();
953 #endif 935 #endif
954 936
937 #define SHEBANG_PROGNAME_LENGTH \
938 (int)((sizeof (WEXTSTRING (SHEBANG_PROGNAME)) - sizeof (WEXTSTRING (""))))
939 #define SHEBANG_EXE_PROGNAME_LENGTH \
940 (int)(sizeof (WEXTSTRING (SHEBANG_PROGNAME) WEXTSTRING(".exe")) \
941 - sizeof (WEXTSTRING ("")))
942
943 {
944 int progname_len = wext_strlen (argv[0]);
945 if (progname_len >= SHEBANG_PROGNAME_LENGTH)
946 {
947 if (!wext_strcmp_ascii (argv[0] +
948 (progname_len - SHEBANG_PROGNAME_LENGTH),
949 SHEBANG_PROGNAME)
950 /* Allow trailing .exe. Don't check it, it could also be
951 .com. */
952 || (progname_len >= SHEBANG_EXE_PROGNAME_LENGTH &&
953 !wext_strncmp_ascii
954 (argv[0] + (progname_len - SHEBANG_EXE_PROGNAME_LENGTH),
955 SHEBANG_PROGNAME,
956 SHEBANG_PROGNAME_LENGTH)))
957 {
958 Wexttext **newarr = alloca_array (Wexttext *, argc + 2);
959 int j;
960
961 newarr[0] = argv[0];
962 newarr[1] = WEXTSTRING ("--script");
963 for (j = 1; j < argc; ++j)
964 {
965 newarr[j + 1] = argv[j];
966 }
967 argv = newarr;
968 argc++;
969 }
970 }
971 }
972
955 sort_args (argc, argv); 973 sort_args (argc, argv);
956 974
957 #if 0 /* defined (_SCO_DS) 975 #if 0 /* defined (_SCO_DS)
958 #### Turn this off, we already have another SCO_DS hack in main(). 976 #### Turn this off, we already have another SCO_DS hack in main().
959 */ 977 */
992 #ifdef SET_EMACS_PRIORITY 1010 #ifdef SET_EMACS_PRIORITY
993 if (emacs_priority != 0) 1011 if (emacs_priority != 0)
994 nice (-emacs_priority); 1012 nice (-emacs_priority);
995 setuid (getuid ()); 1013 setuid (getuid ());
996 #endif /* SET_EMACS_PRIORITY */ 1014 #endif /* SET_EMACS_PRIORITY */
997
998 #ifdef EXTRA_INITIALIZE
999 EXTRA_INITIALIZE;
1000 #endif
1001 1015
1002 /* NOTE NOTE NOTE: Keep the following args in sync with the big list of 1016 /* NOTE NOTE NOTE: Keep the following args in sync with the big list of
1003 arguments below in standard_args[], with the help text in startup.el, 1017 arguments below in standard_args[], with the help text in startup.el,
1004 and with the list of non-clobbered variables near where pdump_load() 1018 and with the list of non-clobbered variables near where pdump_load()
1005 is called! */ 1019 is called! */
1019 /* Handle the -si/--show-inline-info switch, which means show the 1033 /* Handle the -si/--show-inline-info switch, which means show the
1020 alignment and max size of the inline data and quit */ 1034 alignment and max size of the inline data and quit */
1021 if (argmatch (argv, argc, "-si", "--show-inline-info", 0, NULL, &skip_args)) 1035 if (argmatch (argv, argc, "-si", "--show-inline-info", 0, NULL, &skip_args))
1022 { 1036 {
1023 #if defined (PDUMP) && defined (DUMP_IN_EXEC) && !defined (WIN32_NATIVE) 1037 #if defined (PDUMP) && defined (DUMP_IN_EXEC) && !defined (WIN32_NATIVE)
1024 printf ("%u %u\n", dumped_data_max_size (), dumped_data_align_offset ()); 1038 /* #### We really should check for sizeof (size_t) > sizeof (long) */
1039 printf ("%lu %lu\n", (unsigned long) dumped_data_max_size (),
1040 (unsigned long) dumped_data_align_offset ());
1041
1025 #else 1042 #else
1026 printf ("Portable dumper not configured for dumping into executable or windows native; -si just forces exit.\n"); 1043 printf ("Portable dumper not configured for dumping into executable or windows native; -si just forces exit.\n");
1027 #endif 1044 #endif
1028 exit (0); 1045 exit (0);
1029 } 1046 }
1040 inhibit_autoloads = 1; 1057 inhibit_autoloads = 1;
1041 #endif 1058 #endif
1042 noninteractive = 1; 1059 noninteractive = 1;
1043 } 1060 }
1044 1061
1062 {
1063 int count_before = skip_args;
1064 /* Handle the -script switch, which implies batch and vanilla. The -l
1065 part of its functionality is implemented in Lisp. */
1066 if (argmatch (argv, argc, "-script", "--script", 0, NULL,
1067 &skip_args))
1068 {
1069 noninteractive = 1;
1070 vanilla_inhibiting = 1;
1071 }
1072
1073 /* Don't actually discard this argument. */
1074 skip_args = count_before;
1075 }
1045 #ifdef WIN32_NATIVE 1076 #ifdef WIN32_NATIVE
1046 { 1077 {
1047 /* Since we aren't a console application, we can't easily be terminated 1078 /* Since we aren't a console application, we can't easily be terminated
1048 using ^C. (We aren't a console application to avoid Windows from 1079 using ^C. (We aren't a console application to avoid Windows from
1049 automatically and unwantedly creating a console window for us. If 1080 automatically and unwantedly creating a console window for us. If
1182 retry_close (1); 1213 retry_close (1);
1183 1214
1184 fd = wext_retry_open (term, O_RDWR | OPEN_BINARY, 2); 1215 fd = wext_retry_open (term, O_RDWR | OPEN_BINARY, 2);
1185 /* Conversions are not possible yet, and printing will be in 1216 /* Conversions are not possible yet, and printing will be in
1186 external format, so strerror() and ttyname() are OK. */ 1217 external format, so strerror() and ttyname() are OK. */
1187 if (fd < 0) 1218 if (fd < 0 || dup (0) < 0)
1188 fatal ("%s: %s", WEXTTEXT_TO_8_BIT (term), strerror (errno)); 1219 fatal ("%s: %s", WEXTTEXT_TO_8_BIT (term), strerror (errno));
1189 dup (0);
1190 if (! isatty (0)) 1220 if (! isatty (0))
1191 fatal ("%s: not a tty", WEXTTEXT_TO_8_BIT (term)); 1221 fatal ("%s: not a tty", WEXTTEXT_TO_8_BIT (term));
1192 1222
1193 #if 0 1223 #if 0
1194 stderr_out ("Using %s", ttyname (0)); 1224 stderr_out ("Using %s", ttyname (0));
1310 /* First, do really basic environment initialization -- catching signals 1340 /* First, do really basic environment initialization -- catching signals
1311 and the like. These functions have no dependence on any part of 1341 and the like. These functions have no dependence on any part of
1312 the Lisp engine and need to be done both at dump time and at run time. */ 1342 the Lisp engine and need to be done both at dump time and at run time. */
1313 1343
1314 init_signals_very_early (); 1344 init_signals_very_early ();
1345 #ifdef NEW_GC
1346 vdb_install_signal_handler ();
1347 #endif /* NEW_GC */
1315 init_data_very_early (); /* Catch math errors. */ 1348 init_data_very_early (); /* Catch math errors. */
1316 init_floatfns_very_early (); /* Catch floating-point math errors. */ 1349 init_floatfns_very_early (); /* Catch floating-point math errors. */
1317 init_process_times_very_early (); /* Initialize our process timers. 1350 init_process_times_very_early (); /* Initialize our process timers.
1318 As early as possible, of course, 1351 As early as possible, of course,
1319 so we can be fairly accurate. */ 1352 so we can be fairly accurate. */
1384 debug_paths = debug_paths_save; 1417 debug_paths = debug_paths_save;
1385 inhibit_site_lisp = inhibit_site_lisp_save; 1418 inhibit_site_lisp = inhibit_site_lisp_save;
1386 inhibit_site_modules = inhibit_site_modules_save; 1419 inhibit_site_modules = inhibit_site_modules_save;
1387 1420
1388 if (initialized) 1421 if (initialized)
1389 run_temacs_argc = restart ? -2 : -1; 1422 run_temacs_argc = -1;
1390 else 1423 else
1391 purify_flag = 1; 1424 purify_flag = 1;
1392 } 1425 }
1393 #else /* not PDUMP */ 1426 #else /* not PDUMP */
1394 if (!initialized) 1427 if (!initialized)
1395 purify_flag = 1; 1428 purify_flag = 1;
1396 #endif 1429 #endif
1397 1430
1398 init_alloc_early (); 1431 init_alloc_early ();
1432
1433 init_gc_early ();
1399 1434
1400 if (!initialized) 1435 if (!initialized)
1401 { 1436 {
1402 /* Initialize things so that new Lisp objects 1437 /* Initialize things so that new Lisp objects
1403 can be created and objects can be staticpro'd. 1438 can be created and objects can be staticpro'd.
1404 Must be basically the very first thing done 1439 Must be basically the very first thing done
1405 because pretty much all of the initialization 1440 because pretty much all of the initialization
1406 routines below create new objects. */ 1441 routines below create new objects. */
1407 init_alloc_once_early (); 1442 init_alloc_once_early ();
1408 1443
1444 init_gc_once_early ();
1445
1409 /* Initialize Qnil, Qt, Qunbound, and the 1446 /* Initialize Qnil, Qt, Qunbound, and the
1410 obarray. After this, symbols can be 1447 obarray. After this, symbols can be
1411 interned. This depends on init_alloc_once_early(). */ 1448 interned. This depends on init_alloc_once_early(). */
1412 init_symbols_once_early (); 1449 init_symbols_once_early ();
1413 1450
1439 Order does not matter in these functions. 1476 Order does not matter in these functions.
1440 */ 1477 */
1441 1478
1442 syms_of_abbrev (); 1479 syms_of_abbrev ();
1443 syms_of_alloc (); 1480 syms_of_alloc ();
1444 #ifdef MC_ALLOC 1481 #ifdef NEW_GC
1445 syms_of_mc_alloc (); 1482 syms_of_mc_alloc ();
1446 #endif /* MC_ALLOC */ 1483 #endif /* NEW_GC */
1484 syms_of_gc ();
1485 #ifdef NEW_GC
1486 syms_of_vdb ();
1487 #endif /* NEW_GC */
1447 syms_of_buffer (); 1488 syms_of_buffer ();
1448 syms_of_bytecode (); 1489 syms_of_bytecode ();
1449 syms_of_callint (); 1490 syms_of_callint ();
1450 syms_of_casefiddle (); 1491 syms_of_casefiddle ();
1451 syms_of_casetab (); 1492 syms_of_casetab ();
1518 #ifdef WITH_NUMBER_TYPES 1559 #ifdef WITH_NUMBER_TYPES
1519 syms_of_number (); 1560 syms_of_number ();
1520 #endif 1561 #endif
1521 syms_of_objects (); 1562 syms_of_objects ();
1522 syms_of_print (); 1563 syms_of_print ();
1523 #if !defined (NO_SUBPROCESSES)
1524 syms_of_process (); 1564 syms_of_process ();
1525 #ifdef HAVE_WIN32_PROCESSES 1565 #ifdef HAVE_WIN32_PROCESSES
1526 syms_of_process_nt (); 1566 syms_of_process_nt ();
1527 #endif
1528 #endif 1567 #endif
1529 syms_of_profile (); 1568 syms_of_profile ();
1530 #if defined (HAVE_MMAP) && defined (REL_ALLOC) && !defined (DOUG_LEA_MALLOC) 1569 #if defined (HAVE_MMAP) && defined (REL_ALLOC) && !defined (DOUG_LEA_MALLOC)
1531 syms_of_ralloc (); 1570 syms_of_ralloc ();
1532 #endif /* HAVE_MMAP && REL_ALLOC */ 1571 #endif /* HAVE_MMAP && REL_ALLOC */
1599 #ifdef HAVE_XIM 1638 #ifdef HAVE_XIM
1600 #ifdef XIM_XLIB 1639 #ifdef XIM_XLIB
1601 syms_of_input_method_xlib (); 1640 syms_of_input_method_xlib ();
1602 #endif 1641 #endif
1603 #endif /* HAVE_XIM */ 1642 #endif /* HAVE_XIM */
1643
1644 #ifdef USE_XFT
1645 syms_of_font_mgr();
1646 #endif
1647
1604 #endif /* HAVE_X_WINDOWS */ 1648 #endif /* HAVE_X_WINDOWS */
1605 1649
1606 #ifdef HAVE_MS_WINDOWS 1650 #ifdef HAVE_MS_WINDOWS
1607 syms_of_console_mswindows (); 1651 syms_of_console_mswindows ();
1608 syms_of_device_mswindows (); 1652 syms_of_device_mswindows ();
1656 1700
1657 #ifdef SYMS_MACHINE 1701 #ifdef SYMS_MACHINE
1658 SYMS_MACHINE; 1702 SYMS_MACHINE;
1659 #endif 1703 #endif
1660 1704
1661 /*
1662 #if defined (GNU_MALLOC) && \
1663 defined (ERROR_CHECK_MALLOC) && \
1664 !defined (HAVE_LIBMCHECK)
1665 */
1666 /* Prior to XEmacs 21, this was `#if 0'ed out. -slb */ 1705 /* Prior to XEmacs 21, this was `#if 0'ed out. -slb */
1667 #if defined (LOSING_GCC_DESTRUCTOR_FREE_BUG) 1706 #if defined (LOSING_GCC_DESTRUCTOR_FREE_BUG)
1668 syms_of_free_hook (); 1707 syms_of_free_hook ();
1669 #endif 1708 #endif
1670 1709
1848 #ifdef PDUMP 1887 #ifdef PDUMP
1849 else if (!restart) /* after successful pdump_load() 1888 else if (!restart) /* after successful pdump_load()
1850 (note, we are inside ifdef PDUMP) */ 1889 (note, we are inside ifdef PDUMP) */
1851 { 1890 {
1852 reinit_alloc_early (); 1891 reinit_alloc_early ();
1892 reinit_gc_early ();
1853 reinit_symbols_early (); 1893 reinit_symbols_early ();
1854 #ifndef MC_ALLOC 1894 #ifndef NEW_GC
1855 reinit_opaque_early (); 1895 reinit_opaque_early ();
1856 #endif /* not MC_ALLOC */ 1896 #endif /* not NEW_GC */
1857 reinit_eistring_early (); 1897 reinit_eistring_early ();
1858 1898
1859 reinit_console_type_create_stream (); 1899 reinit_console_type_create_stream ();
1860 #ifdef HAVE_TTY 1900 #ifdef HAVE_TTY
1861 reinit_console_type_create_tty (); 1901 reinit_console_type_create_tty ();
2052 vars_of_fns (); 2092 vars_of_fns ();
2053 #ifdef USE_C_FONT_LOCK 2093 #ifdef USE_C_FONT_LOCK
2054 vars_of_font_lock (); 2094 vars_of_font_lock ();
2055 #endif /* USE_C_FONT_LOCK */ 2095 #endif /* USE_C_FONT_LOCK */
2056 vars_of_frame (); 2096 vars_of_frame ();
2097 vars_of_gc ();
2057 vars_of_glyphs (); 2098 vars_of_glyphs ();
2058 vars_of_glyphs_eimage (); 2099 vars_of_glyphs_eimage ();
2059 vars_of_glyphs_widget (); 2100 vars_of_glyphs_widget ();
2060 vars_of_gui (); 2101 vars_of_gui ();
2061 vars_of_gutter (); 2102 vars_of_gutter ();
2093 vars_of_number (); 2134 vars_of_number ();
2094 #endif 2135 #endif
2095 vars_of_objects (); 2136 vars_of_objects ();
2096 vars_of_print (); 2137 vars_of_print ();
2097 2138
2098 #ifndef NO_SUBPROCESSES
2099 vars_of_process (); 2139 vars_of_process ();
2100 #ifdef HAVE_UNIX_PROCESSES 2140 #ifdef HAVE_UNIX_PROCESSES
2101 vars_of_process_unix (); 2141 vars_of_process_unix ();
2102 #endif 2142 #endif
2103 #ifdef HAVE_WIN32_PROCESSES 2143 #ifdef HAVE_WIN32_PROCESSES
2104 vars_of_process_nt (); 2144 vars_of_process_nt ();
2105 #endif
2106 #endif 2145 #endif
2107 2146
2108 vars_of_profile (); 2147 vars_of_profile ();
2109 #if defined (HAVE_MMAP) && defined (REL_ALLOC) && !defined (DOUG_LEA_MALLOC) 2148 #if defined (HAVE_MMAP) && defined (REL_ALLOC) && !defined (DOUG_LEA_MALLOC)
2110 vars_of_ralloc (); 2149 vars_of_ralloc ();
2136 vars_of_objects_tty (); 2175 vars_of_objects_tty ();
2137 #endif 2176 #endif
2138 2177
2139 #ifdef HAVE_GTK 2178 #ifdef HAVE_GTK
2140 vars_of_device_gtk (); 2179 vars_of_device_gtk ();
2180 vars_of_console_gtk ();
2141 #ifdef HAVE_DIALOGS 2181 #ifdef HAVE_DIALOGS
2142 vars_of_dialog_gtk (); 2182 vars_of_dialog_gtk ();
2143 #endif 2183 #endif
2144 vars_of_event_gtk (); 2184 vars_of_event_gtk ();
2145 vars_of_frame_gtk (); 2185 vars_of_frame_gtk ();
2160 2200
2161 #ifdef HAVE_X_WINDOWS 2201 #ifdef HAVE_X_WINDOWS
2162 #ifdef HAVE_BALLOON_HELP 2202 #ifdef HAVE_BALLOON_HELP
2163 vars_of_balloon_x (); 2203 vars_of_balloon_x ();
2164 #endif 2204 #endif
2205 vars_of_console_x ();
2165 vars_of_device_x (); 2206 vars_of_device_x ();
2166 #ifdef HAVE_X_DIALOGS 2207 #ifdef HAVE_X_DIALOGS
2167 vars_of_dialog_x (); 2208 vars_of_dialog_x ();
2168 #endif 2209 #endif
2169 vars_of_frame_x (); 2210 vars_of_frame_x ();
2177 vars_of_scrollbar_x (); 2218 vars_of_scrollbar_x ();
2178 #endif 2219 #endif
2179 #if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_X_DIALOGS) || defined (HAVE_TOOLBARS) 2220 #if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_X_DIALOGS) || defined (HAVE_TOOLBARS)
2180 vars_of_gui_x (); 2221 vars_of_gui_x ();
2181 #endif 2222 #endif
2223
2224 #ifdef USE_XFT
2225 vars_of_font_mgr ();
2226 #endif
2227
2182 #endif /* HAVE_X_WINDOWS */ 2228 #endif /* HAVE_X_WINDOWS */
2183 2229
2184 2230
2185 #ifdef HAVE_MS_WINDOWS 2231 #ifdef HAVE_MS_WINDOWS
2186 vars_of_device_mswindows (); 2232 vars_of_device_mswindows ();
2265 #endif /* USE_C_FONT_LOCK */ 2311 #endif /* USE_C_FONT_LOCK */
2266 reinit_vars_of_glyphs (); 2312 reinit_vars_of_glyphs ();
2267 reinit_vars_of_glyphs_widget (); 2313 reinit_vars_of_glyphs_widget ();
2268 reinit_vars_of_insdel (); 2314 reinit_vars_of_insdel ();
2269 reinit_vars_of_lread (); 2315 reinit_vars_of_lread ();
2270 #ifndef MC_ALLOC 2316 #ifndef NEW_GC
2271 reinit_vars_of_lstream (); 2317 reinit_vars_of_lstream ();
2272 #endif /* not MC_ALLOC */ 2318 #endif /* not NEW_GC */
2273 reinit_vars_of_minibuf (); 2319 reinit_vars_of_minibuf ();
2274 #ifdef HAVE_SHLIB 2320 #ifdef HAVE_SHLIB
2275 reinit_vars_of_module (); 2321 reinit_vars_of_module ();
2276 #endif 2322 #endif
2277 reinit_vars_of_objects (); 2323 reinit_vars_of_objects ();
2302 reinit_vars_of_menubar_x (); 2348 reinit_vars_of_menubar_x ();
2303 #endif 2349 #endif
2304 reinit_vars_of_select_x (); 2350 reinit_vars_of_select_x ();
2305 #if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_X_DIALOGS) || defined (HAVE_TOOLBARS) 2351 #if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_X_DIALOGS) || defined (HAVE_TOOLBARS)
2306 reinit_vars_of_gui_x (); 2352 reinit_vars_of_gui_x ();
2353 #endif
2354 #ifdef USE_XFT
2355 reinit_vars_of_font_mgr ();
2307 #endif 2356 #endif
2308 #endif /* HAVE_X_WINDOWS */ 2357 #endif /* HAVE_X_WINDOWS */
2309 2358
2310 #ifdef MULE 2359 #ifdef MULE
2311 reinit_vars_of_mule_coding (); 2360 reinit_vars_of_mule_coding ();
2370 objects and we have defined the basic coding systems (in the 2419 objects and we have defined the basic coding systems (in the
2371 just-previous complex-vars calls). We will in fact do conversion 2420 just-previous complex-vars calls). We will in fact do conversion
2372 quite soon, e.g. in complex_vars_of_glyphs_x(). */ 2421 quite soon, e.g. in complex_vars_of_glyphs_x(). */
2373 inhibit_non_essential_conversion_operations = 0; 2422 inhibit_non_essential_conversion_operations = 0;
2374 2423
2424 #ifdef USE_XFT
2425 /* This uses coding systems. Must be done before faces are init'ed. */
2426 /* not in xft reloaded #3 */
2427 complex_vars_of_font_mgr ();
2428 #endif
2429
2375 /* Depends on specifiers. */ 2430 /* Depends on specifiers. */
2376 complex_vars_of_faces (); 2431 complex_vars_of_faces ();
2377 2432
2378 /* This calls allocate_glyph(), which creates specifiers 2433 /* This calls allocate_glyph(), which creates specifiers
2379 and also relies on a variable (Vthe_nothing_vector) initialized 2434 and also relies on a variable (Vthe_nothing_vector) initialized
2390 complex_vars_of_glyphs_x (); 2445 complex_vars_of_glyphs_x ();
2391 #endif 2446 #endif
2392 #ifdef HAVE_MS_WINDOWS 2447 #ifdef HAVE_MS_WINDOWS
2393 complex_vars_of_glyphs_mswindows (); 2448 complex_vars_of_glyphs_mswindows ();
2394 #endif 2449 #endif
2395
2396 /* This calls Fmake_glyph_internal(). */
2397 complex_vars_of_alloc ();
2398 2450
2399 /* This calls Fmake_glyph_internal(). */ 2451 /* This calls Fmake_glyph_internal(). */
2400 #ifdef HAVE_MENUBARS 2452 #ifdef HAVE_MENUBARS
2401 complex_vars_of_menubar (); 2453 complex_vars_of_menubar ();
2402 #endif 2454 #endif
2437 2489
2438 /* These two might call Ffile_name_as_directory(), which 2490 /* These two might call Ffile_name_as_directory(), which
2439 might depend on all sorts of things; I'm not sure. */ 2491 might depend on all sorts of things; I'm not sure. */
2440 complex_vars_of_emacs (); 2492 complex_vars_of_emacs ();
2441 2493
2494 complex_vars_of_gc ();
2495
2442 /* This creates a couple of basic keymaps and depends on Lisp 2496 /* This creates a couple of basic keymaps and depends on Lisp
2443 hash tables and Ffset() (both of which depend on some variables 2497 hash tables and Ffset() (both of which depend on some variables
2444 initialized in the vars_of_*() section) and possibly other 2498 initialized in the vars_of_*() section) and possibly other
2445 stuff. */ 2499 stuff. */
2446 complex_vars_of_keymap (); 2500 complex_vars_of_keymap ();
2447 2501
2448 #ifdef ERROR_CHECK_GC 2502 #ifdef ERROR_CHECK_GC
2449 { 2503 {
2450 extern int always_gc; 2504 extern int always_gc;
2451 if (always_gc) /* purification debugging hack */ 2505 if (always_gc) /* purification debugging hack */
2506 #ifdef NEW_GC
2507 gc_full ();
2508 #else /* not NEW_GC */
2452 garbage_collect_1 (); 2509 garbage_collect_1 ();
2510 #endif /* not NEW_GC */
2453 } 2511 }
2454 #endif 2512 #endif
2455 } 2513 }
2456 else 2514 else
2457 { 2515 {
2645 /* Handled by main_1 above: Each must have its own priority and must be 2703 /* Handled by main_1 above: Each must have its own priority and must be
2646 in the order mentioned in main_1. */ 2704 in the order mentioned in main_1. */
2647 { "-sd", "--show-dump-id", 105, 0 }, 2705 { "-sd", "--show-dump-id", 105, 0 },
2648 { "-nd", "--no-dump-file", 95, 0 }, 2706 { "-nd", "--no-dump-file", 95, 0 },
2649 { "-batch", "--batch", 88, 0 }, 2707 { "-batch", "--batch", 88, 0 },
2708 { "-script", "--script", 89, 1 },
2650 #ifdef WIN32_NATIVE 2709 #ifdef WIN32_NATIVE
2651 { "-mswindows-termination-handle", 0, 84, 1 }, 2710 { "-mswindows-termination-handle", 0, 84, 1 },
2652 { "-nuni", "--no-unicode-lib-calls", 83, 0 }, 2711 { "-nuni", "--no-unicode-lib-calls", 83, 0 },
2653 #endif /* WIN32_NATIVE */ 2712 #endif /* WIN32_NATIVE */
2654 { "-debug-paths", "--debug-paths", 82, 0 }, 2713 { "-debug-paths", "--debug-paths", 82, 0 },
2910 return Fnreverse (plist); 2969 return Fnreverse (plist);
2911 } 2970 }
2912 2971
2913 DEFUN_NORETURN ("run-emacs-from-temacs", Frun_emacs_from_temacs, 0, MANY, 0, /* 2972 DEFUN_NORETURN ("run-emacs-from-temacs", Frun_emacs_from_temacs, 0, MANY, 0, /*
2914 Do not call this. It will reinitialize your XEmacs. You'll be sorry. 2973 Do not call this. It will reinitialize your XEmacs. You'll be sorry.
2974
2975 arguments: (&rest ARGS)
2915 */ 2976 */
2916 /* If this function is called from startup.el, it will be possible to run 2977 /* If this function is called from startup.el, it will be possible to run
2917 temacs as an editor using `temacs -batch -l loadup.el run-temacs', instead 2978 temacs as an editor using `temacs -batch -l ../lisp/loadup.el
2918 of having to dump an emacs and then run that (when debugging emacs itself, 2979 run-temacs', instead of having to dump an emacs and then run that (when
2919 this can be much faster)). [Actually, the speed difference isn't that 2980 debugging emacs itself, this can be much faster)). [Actually, the speed
2920 much as long as your filesystem is local, and you don't end up with 2981 difference isn't that much as long as your filesystem is local, and you
2921 a dumped version in case you want to rerun it. This function is most 2982 don't end up with a dumped version in case you want to rerun it. This
2922 useful when used as part of the `make all-elc' command. --ben] 2983 function is most useful when used as part of the `make all-elc'
2923 This will "restart" emacs with the specified command-line arguments. 2984 command. --ben] This will "restart" emacs with the specified command-line
2985 arguments.
2924 2986
2925 Martin thinks this function is most useful when using debugging 2987 Martin thinks this function is most useful when using debugging
2926 tools like Purify or tcov that get confused by XEmacs' dumping. */ 2988 tools like Purify or tcov that get confused by XEmacs' dumping. */
2927 (int nargs, Lisp_Object *args)) 2989 (int nargs, Lisp_Object *args))
2928 { 2990 {
2929 int i; 2991 int i;
2930 2992
2993 #ifdef NEW_GC
2994 if (gc_in_progress) gc_full ();
2995 #else /* not NEW_GC */
2931 assert (!gc_in_progress); 2996 assert (!gc_in_progress);
2997 #endif /* not NEW_GC */
2932 2998
2933 if (run_temacs_argc < 0) 2999 if (run_temacs_argc < 0)
2934 invalid_operation ("I've lost my temacs-hood", Qunbound); 3000 invalid_operation ("I've lost my temacs-hood", Qunbound);
2935 3001
2936 run_temacs_argc = nargs + 1; 3002 run_temacs_argc = nargs + 1;
3192 3258
3193 fflush (stderr); 3259 fflush (stderr);
3194 fflush (stdout); 3260 fflush (stdout);
3195 3261
3196 disksave_object_finalization (); 3262 disksave_object_finalization ();
3197 #ifndef MC_ALLOC 3263 #ifndef NEW_GC
3198 release_breathing_space (); 3264 release_breathing_space ();
3199 #endif /* not MC_ALLOC */ 3265 #endif /* not NEW_GC */
3200 3266
3201 /* Tell malloc where start of impure now is */ 3267 /* Tell malloc where start of impure now is */
3202 /* Also arrange for warnings when nearly out of space. */ 3268 /* Also arrange for warnings when nearly out of space. */
3203 #ifndef SYSTEM_MALLOC 3269 #ifndef SYSTEM_MALLOC
3204 memory_warnings (my_edata, malloc_warning); 3270 memory_warnings (my_edata, malloc_warning);
3205 #endif 3271 #endif
3206 3272
3273 #ifdef NEW_GC
3274 gc_full ();
3275 #else /* not NEW_GC */
3207 garbage_collect_1 (); 3276 garbage_collect_1 ();
3277 #endif /* not NEW_GC */
3208 3278
3209 #ifdef PDUMP 3279 #ifdef PDUMP
3210 pdump (); 3280 pdump ();
3211 #elif defined (WIN32_NATIVE) 3281 #elif defined (WIN32_NATIVE)
3212 unexec (XSTRING_DATA (filename), 3282 unexec (XSTRING_DATA (filename),
3550 3620
3551 /* Dumping apparently isn't supported by versions of GCC >= 2.8. */ 3621 /* Dumping apparently isn't supported by versions of GCC >= 2.8. */
3552 /* The following needs conditionalization on whether either XEmacs or */ 3622 /* The following needs conditionalization on whether either XEmacs or */
3553 /* various system shared libraries have been built and linked with */ 3623 /* various system shared libraries have been built and linked with */
3554 /* GCC >= 2.8. -slb */ 3624 /* GCC >= 2.8. -slb */
3555 #if defined (GNU_MALLOC) 3625 #ifndef SYSTEM_MALLOC
3556 static void 3626 static void
3557 voodoo_free_hook (void *UNUSED (mem)) 3627 voodoo_free_hook (void *UNUSED (mem))
3558 { 3628 {
3559 /* Disable all calls to free() when XEmacs is exiting and it doesn't */ 3629 /* Disable all calls to free() when XEmacs is exiting and it doesn't */
3560 /* matter. */ 3630 /* matter. */
3563 /* prototype of __free_hook varies with glibc version */ 3633 /* prototype of __free_hook varies with glibc version */
3564 (TYPEOF (__free_hook)) 3634 (TYPEOF (__free_hook))
3565 #endif 3635 #endif
3566 voodoo_free_hook; 3636 voodoo_free_hook;
3567 } 3637 }
3568 #endif /* GNU_MALLOC */ 3638 #endif /* SYSTEM_MALLOC */
3569 3639
3570 DEFUN_NORETURN ("kill-emacs", Fkill_emacs, 0, 1, "P", /* 3640 DEFUN_NORETURN ("kill-emacs", Fkill_emacs, 0, 1, "P", /*
3571 Exit the XEmacs job and kill it. Ask for confirmation, without argument. 3641 Exit the XEmacs job and kill it. Ask for confirmation, without argument.
3572 If ARG is an integer, return ARG as the exit program code. 3642 If ARG is an integer, return ARG as the exit program code.
3573 If ARG is a string, stuff it as keyboard input. 3643 If ARG is a string, stuff it as keyboard input.
3621 pause_so_user_can_read_messages (1); 3691 pause_so_user_can_read_messages (1);
3622 #endif 3692 #endif
3623 3693
3624 shut_down_emacs (0, STRINGP (arg) ? arg : Qnil, 0); 3694 shut_down_emacs (0, STRINGP (arg) ? arg : Qnil, 0);
3625 3695
3626 #if defined (GNU_MALLOC) 3696 #ifndef SYSTEM_MALLOC
3627 __free_hook = 3697 __free_hook =
3628 #if defined (TYPEOF) && !defined (UNO) 3698 #if defined (TYPEOF) && !defined (UNO)
3629 /* prototype of __free_hook varies with glibc version */ 3699 /* prototype of __free_hook varies with glibc version */
3630 (TYPEOF (__free_hook)) 3700 (TYPEOF (__free_hook))
3631 #endif 3701 #endif
3726 code below, we avoid a deadlock. */ 3796 code below, we avoid a deadlock. */
3727 EMACS_UNBLOCK_SIGNAL (sig); 3797 EMACS_UNBLOCK_SIGNAL (sig);
3728 3798
3729 guts_of_fatal_error_signal (sig); 3799 guts_of_fatal_error_signal (sig);
3730 3800
3801 #ifdef NEW_GC
3802 /* This time the signal will really be fatal. To be able to debug
3803 SIGSEGV and SIGBUS also during write barrier, send SIGABRT. */
3804 #ifdef WIN32_NATIVE
3805 if (sig == SIGSEGV)
3806 raise (SIGABRT);
3807 else
3808 raise (sig);
3809 #else
3810 if ((sig == SIGSEGV) || (sig == SIGBUS))
3811 kill (qxe_getpid (), SIGABRT);
3812 else
3813 kill (qxe_getpid (), sig);
3814 #endif
3815 #else /* not NEW_GC */
3731 /* Signal the same code; this time it will really be fatal. */ 3816 /* Signal the same code; this time it will really be fatal. */
3732 #ifdef WIN32_NATIVE 3817 #ifdef WIN32_NATIVE
3733 raise (sig); 3818 raise (sig);
3734 #else 3819 #else
3735 kill (qxe_getpid (), sig); 3820 kill (qxe_getpid (), sig);
3736 #endif 3821 #endif
3822 #endif /* not NEW_GC */
3737 SIGRETURN; 3823 SIGRETURN;
3738 } 3824 }
3739 3825
3740 #ifdef _MSC_VER 3826 #ifdef _MSC_VER
3741 3827
4177 Arbitrary string to place in the version string after the codename. 4263 Arbitrary string to place in the version string after the codename.
4178 4264
4179 Appropriate surrounding whitespace will be added, but typically looks best 4265 Appropriate surrounding whitespace will be added, but typically looks best
4180 if enclosed in parentheses. 4266 if enclosed in parentheses.
4181 4267
4182 A standard use is to indicate the date version.sh was last updated from 4268 A standard use is to indicate the topmost hash id of the Mercurial
4183 the CVS mainline, where it is automatically given a value similar to 4269 changeset from which XEmacs was compiled. Developers may also use it
4184 \"(+CVS-20050221)\". Developers may also use it to indicate particular 4270 to indicate particular branches, etc.
4185 branches, etc.
4186 */ ); 4271 */ );
4187 #ifdef XEMACS_EXTRA_NAME 4272 #ifdef XEMACS_EXTRA_NAME
4188 Vxemacs_extra_name = build_string (XEMACS_EXTRA_NAME); 4273 Vxemacs_extra_name = build_string (XEMACS_EXTRA_NAME);
4189 #endif 4274 #endif
4190 4275
4442 #ifdef PATH_MODULESEARCH 4527 #ifdef PATH_MODULESEARCH
4443 Vconfigure_module_directory = Ffile_name_as_directory 4528 Vconfigure_module_directory = Ffile_name_as_directory
4444 (build_ext_string (PATH_MODULESEARCH, Qfile_name)); 4529 (build_ext_string (PATH_MODULESEARCH, Qfile_name));
4445 #else 4530 #else
4446 Vconfigure_module_directory = Qnil; 4531 Vconfigure_module_directory = Qnil;
4532 #endif
4533
4534 DEFVAR_LISP ("configure-early-package-directories", &Vconfigure_early_package_directories /*
4535 For internal use by the build procedure only.
4536 configure's idea of what the early package directories will be.
4537 */ );
4538 #ifdef PATH_EARLY_PACKAGE_DIRECTORIES
4539 Vconfigure_early_package_directories = split_external_path (PATH_EARLY_PACKAGE_DIRECTORIES);
4540 #else
4541 Vconfigure_early_package_directories = Qnil;
4542 #endif
4543
4544 DEFVAR_LISP ("configure-late-package-directories", &Vconfigure_late_package_directories /*
4545 For internal use by the build procedure only.
4546 configure's idea of what the late package directories will be.
4547 */ );
4548 #ifdef PATH_LATE_PACKAGE_DIRECTORIES
4549 Vconfigure_late_package_directories = split_external_path (PATH_LATE_PACKAGE_DIRECTORIES);
4550 #else
4551 Vconfigure_late_package_directories = Qnil;
4552 #endif
4553
4554 DEFVAR_LISP ("configure-last-package-directories", &Vconfigure_last_package_directories /*
4555 For internal use by the build procedure only.
4556 configure's idea of what the last package directories will be.
4557 */ );
4558 #ifdef PATH_LAST_PACKAGE_DIRECTORIES
4559 Vconfigure_last_package_directories = split_external_path (PATH_LAST_PACKAGE_DIRECTORIES);
4560 #else
4561 Vconfigure_last_package_directories = Qnil;
4447 #endif 4562 #endif
4448 4563
4449 DEFVAR_LISP ("configure-package-path", &Vconfigure_package_path /* 4564 DEFVAR_LISP ("configure-package-path", &Vconfigure_package_path /*
4450 For internal use by the build procedure only. 4565 For internal use by the build procedure only.
4451 configure's idea of what the package path will be. 4566 configure's idea of what the package path will be.