comparison src/emacs.c @ 96675:d45acf0c8d23

merging Emacs.app (NeXTstep port)
author Adrian Robert <Adrian.B.Robert@gmail.com>
date Tue, 15 Jul 2008 18:15:18 +0000
parents 0e3e875ffade
children 55d682b9e1c2
comparison
equal deleted inserted replaced
96674:ff312a846b25 96675:d45acf0c8d23
42 #ifdef WINDOWSNT 42 #ifdef WINDOWSNT
43 #include <fcntl.h> 43 #include <fcntl.h>
44 #include <windows.h> /* just for w32.h */ 44 #include <windows.h> /* just for w32.h */
45 #include "w32.h" 45 #include "w32.h"
46 #include "w32heap.h" /* for prototype of sbrk */ 46 #include "w32heap.h" /* for prototype of sbrk */
47 #endif
48
49 #ifdef NS_IMPL_GNUSTEP
50 /* At least under Debian, GSConfig is in a subdirectory. --Stef */
51 #include <GNUstepBase/GSConfig.h>
47 #endif 52 #endif
48 53
49 #include "lisp.h" 54 #include "lisp.h"
50 #include "commands.h" 55 #include "commands.h"
51 #include "intervals.h" 56 #include "intervals.h"
191 #ifdef BSD_PGRPS 196 #ifdef BSD_PGRPS
192 /* See sysdep.c. */ 197 /* See sysdep.c. */
193 extern int inherited_pgroup; 198 extern int inherited_pgroup;
194 #endif 199 #endif
195 200
196 #ifdef HAVE_X_WINDOWS 201 #if defined(HAVE_X_WINDOWS) || defined(HAVE_NS)
197 /* If non-zero, -d was specified, meaning we're using some window system. */ 202 /* If non-zero, -d was specified, meaning we're using some window system. */
198 int display_arg; 203 int display_arg;
199 #endif 204 #endif
200 205
201 /* An address near the bottom of the stack. 206 /* An address near the bottom of the stack.
836 #ifdef RUN_TIME_REMAP 841 #ifdef RUN_TIME_REMAP
837 if (initialized) 842 if (initialized)
838 run_time_remap (argv[0]); 843 run_time_remap (argv[0]);
839 #endif 844 #endif
840 845
841 #ifdef MAC_OSX 846 #if defined (MAC_OSX) || defined (NS_IMPL_COCOA)
842 if (!initialized) 847 if (!initialized)
843 unexec_init_emacs_zone (); 848 unexec_init_emacs_zone ();
844 #endif 849 #endif
845 850
846 sort_args (argc, argv); 851 sort_args (argc, argv);
1408 } 1413 }
1409 1414
1410 no_loadup 1415 no_loadup
1411 = argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args); 1416 = argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args);
1412 1417
1418 #ifdef HAVE_NS
1419 ns_alloc_autorelease_pool();
1420 if (!noninteractive)
1421 {
1422 char *tmp;
1423 display_arg = 4;
1424 #ifdef NS_IMPL_COCOA
1425 if (skip_args < argc)
1426 {
1427 if (!strncmp(argv[skip_args], "-psn", 4))
1428 {
1429 skip_args += 1;
1430 }
1431 else
1432 {
1433 if (skip_args+1 < argc && !strncmp(argv[skip_args+1], "-psn", 4))
1434 skip_args += 2;
1435 }
1436 }
1437 #endif
1438 /* This used for remote operation.. not fully implemented yet. */
1439 if (argmatch (argv, argc, "-_NSMachLaunch", 0, 3, &tmp, &skip_args))
1440 display_arg = 4;
1441 else if (argmatch (argv, argc, "-MachLaunch", 0, 3, &tmp, &skip_args))
1442 display_arg = 4;
1443 else if (argmatch (argv, argc, "-macosx", 0, 2, NULL, &skip_args))
1444 display_arg = 4;
1445 else if (argmatch (argv, argc, "-NSHost", 0, 3, &tmp, &skip_args))
1446 display_arg = 4;
1447 }
1448 #endif /* HAVE_NS */
1449
1413 #ifdef HAVE_X_WINDOWS 1450 #ifdef HAVE_X_WINDOWS
1414 /* Stupid kludge to catch command-line display spec. We can't 1451 /* Stupid kludge to catch command-line display spec. We can't
1415 handle this argument entirely in window system dependent code 1452 handle this argument entirely in window system dependent code
1416 because we don't even know which window system dependent code 1453 because we don't even know which window system dependent code
1417 to run until we've recognized this argument. */ 1454 to run until we've recognized this argument. */
1483 #endif 1520 #endif
1484 1521
1485 #if defined (MAC_OSX) && defined (HAVE_CARBON) 1522 #if defined (MAC_OSX) && defined (HAVE_CARBON)
1486 if (initialized) 1523 if (initialized)
1487 init_mac_osx_environment (); 1524 init_mac_osx_environment ();
1525 #endif
1526
1527 #ifdef HAVE_NS
1528 #ifndef CANNOT_DUMP
1529 if (initialized)
1530 #endif
1531 ns_init_paths ();
1488 #endif 1532 #endif
1489 1533
1490 /* egetenv is a pretty low-level facility, which may get called in 1534 /* egetenv is a pretty low-level facility, which may get called in
1491 many circumstances; it seems flimsy to put off initializing it 1535 many circumstances; it seems flimsy to put off initializing it
1492 until calling init_callproc. */ 1536 until calling init_callproc. */
1586 syms_of_image (); 1630 syms_of_image ();
1587 #endif /* HAVE_WINDOW_SYSTEM */ 1631 #endif /* HAVE_WINDOW_SYSTEM */
1588 #ifdef HAVE_X_WINDOWS 1632 #ifdef HAVE_X_WINDOWS
1589 syms_of_xterm (); 1633 syms_of_xterm ();
1590 syms_of_xfns (); 1634 syms_of_xfns ();
1635 syms_of_xmenu ();
1591 syms_of_fontset (); 1636 syms_of_fontset ();
1592 #ifdef HAVE_X_SM 1637 #ifdef HAVE_X_SM
1593 syms_of_xsmfns (); 1638 syms_of_xsmfns ();
1594 #endif 1639 #endif
1595 #ifdef HAVE_X11 1640 #ifdef HAVE_X11
1596 syms_of_xselect (); 1641 syms_of_xselect ();
1597 #endif 1642 #endif
1598 #endif /* HAVE_X_WINDOWS */ 1643 #endif /* HAVE_X_WINDOWS */
1599 1644
1600 syms_of_menu (); 1645 syms_of_menu ();
1601
1602 #ifndef HAVE_NTGUI
1603 #ifndef MAC_OS
1604 /* Called before init_window_once for Mac OS Classic. */
1605 syms_of_xmenu ();
1606 #endif
1607 #endif
1608 1646
1609 #ifdef HAVE_NTGUI 1647 #ifdef HAVE_NTGUI
1610 syms_of_w32term (); 1648 syms_of_w32term ();
1611 syms_of_w32fns (); 1649 syms_of_w32fns ();
1612 syms_of_w32select (); 1650 syms_of_w32select ();
1619 syms_of_macfns (); 1657 syms_of_macfns ();
1620 syms_of_macmenu (); 1658 syms_of_macmenu ();
1621 syms_of_macselect (); 1659 syms_of_macselect ();
1622 syms_of_fontset (); 1660 syms_of_fontset ();
1623 #endif /* MAC_OSX && HAVE_CARBON */ 1661 #endif /* MAC_OSX && HAVE_CARBON */
1662
1663 #ifdef HAVE_NS
1664 syms_of_nsterm ();
1665 syms_of_nsfns ();
1666 syms_of_nsmenu ();
1667 syms_of_nsselect ();
1668 syms_of_fontset ();
1669 #endif /* HAVE_NS */
1624 1670
1625 #ifdef HAVE_DBUS 1671 #ifdef HAVE_DBUS
1626 syms_of_dbusbind (); 1672 syms_of_dbusbind ();
1627 #endif /* HAVE_DBUS */ 1673 #endif /* HAVE_DBUS */
1628 1674
1841 { "-hb", "--horizontal-scroll-bars", 5, 0 }, 1887 { "-hb", "--horizontal-scroll-bars", 5, 0 },
1842 { "-vb", "--vertical-scroll-bars", 5, 0 }, 1888 { "-vb", "--vertical-scroll-bars", 5, 0 },
1843 { "-color", "--color", 5, 0}, 1889 { "-color", "--color", 5, 0},
1844 { "-no-splash", "--no-splash", 3, 0 }, 1890 { "-no-splash", "--no-splash", 3, 0 },
1845 { "-no-desktop", "--no-desktop", 3, 0 }, 1891 { "-no-desktop", "--no-desktop", 3, 0 },
1892 #ifdef HAVE_NS
1893 { "-NSAutoLaunch", 0, 5, 1 },
1894 { "-NXAutoLaunch", 0, 5, 1 },
1895 { "-disable-font-backend", "--disable-font-backend", 65, 0 },
1896 { "-_NSMachLaunch", 0, 85, 1 },
1897 { "-MachLaunch", 0, 85, 1 },
1898 { "-macosx", 0, 85, 0 },
1899 { "-NSHost", 0, 85, 1 },
1900 #endif
1846 /* These have the same priority as ordinary file name args, 1901 /* These have the same priority as ordinary file name args,
1847 so they are not reordered with respect to those. */ 1902 so they are not reordered with respect to those. */
1848 { "-L", "--directory", 0, 1 }, 1903 { "-L", "--directory", 0, 1 },
1849 { "-directory", 0, 0, 1 }, 1904 { "-directory", 0, 0, 1 },
1850 { "-l", "--load", 0, 1 }, 1905 { "-l", "--load", 0, 1 },
1860 { "-execute", "--execute", 0, 1 }, 1915 { "-execute", "--execute", 0, 1 },
1861 { "-find-file", "--find-file", 0, 1 }, 1916 { "-find-file", "--find-file", 0, 1 },
1862 { "-visit", "--visit", 0, 1 }, 1917 { "-visit", "--visit", 0, 1 },
1863 { "-file", "--file", 0, 1 }, 1918 { "-file", "--file", 0, 1 },
1864 { "-insert", "--insert", 0, 1 }, 1919 { "-insert", "--insert", 0, 1 },
1920 #ifdef HAVE_NS
1921 { "-NXOpen", 0, 0, 1 },
1922 { "-NXOpenTemp", 0, 0, 1 },
1923 { "-NSOpen", 0, 0, 1 },
1924 { "-NSOpenTemp", 0, 0, 1 },
1925 { "-GSFilePath", 0, 0, 1 },
1926 #endif
1865 /* This should be processed after ordinary file name args and the like. */ 1927 /* This should be processed after ordinary file name args and the like. */
1866 { "-kill", "--kill", -10, 0 }, 1928 { "-kill", "--kill", -10, 0 },
1867 }; 1929 };
1868 1930
1869 /* Reorder the elements of ARGV (assumed to have ARGC elements) 1931 /* Reorder the elements of ARGV (assumed to have ARGC elements)
2156 } 2218 }
2157 2219
2158 #ifdef MSDOS 2220 #ifdef MSDOS
2159 dos_cleanup (); 2221 dos_cleanup ();
2160 #endif 2222 #endif
2223
2224 #ifdef HAVE_NS
2225 ns_term_shutdown (sig);
2226 #endif
2161 } 2227 }
2162 2228
2163 2229
2164 2230
2165 #ifndef CANNOT_DUMP 2231 #ifndef CANNOT_DUMP