aboutsummaryrefslogtreecommitdiffstats
path: root/src/emacs.c
diff options
context:
space:
mode:
authorAdrian Robert2008-07-15 18:15:18 +0000
committerAdrian Robert2008-07-15 18:15:18 +0000
commitedfda78355c5528eee489fa8a7f9c73bf8e734f2 (patch)
tree78d2414d9791e1efc17ec9b35b438ae35602340a /src/emacs.c
parent1391cd548782097e34d7856ec4f20ca90bdf2c26 (diff)
downloademacs-edfda78355c5528eee489fa8a7f9c73bf8e734f2.tar.gz
emacs-edfda78355c5528eee489fa8a7f9c73bf8e734f2.zip
merging Emacs.app (NeXTstep port)
Diffstat (limited to 'src/emacs.c')
-rw-r--r--src/emacs.c84
1 files changed, 75 insertions, 9 deletions
diff --git a/src/emacs.c b/src/emacs.c
index 8dfdf9062a1..a6e59f8c9fe 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -46,6 +46,11 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
46#include "w32heap.h" /* for prototype of sbrk */ 46#include "w32heap.h" /* for prototype of sbrk */
47#endif 47#endif
48 48
49#ifdef NS_IMPL_GNUSTEP
50/* At least under Debian, GSConfig is in a subdirectory. --Stef */
51#include <GNUstepBase/GSConfig.h>
52#endif
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"
@@ -193,7 +198,7 @@ int running_asynch_code;
193extern int inherited_pgroup; 198extern 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. */
198int display_arg; 203int display_arg;
199#endif 204#endif
@@ -838,7 +843,7 @@ main (argc, argv
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
@@ -1410,6 +1415,38 @@ main (argc, argv
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
@@ -1487,6 +1524,13 @@ main (argc, argv
1487 init_mac_osx_environment (); 1524 init_mac_osx_environment ();
1488#endif 1525#endif
1489 1526
1527#ifdef HAVE_NS
1528#ifndef CANNOT_DUMP
1529 if (initialized)
1530#endif
1531 ns_init_paths ();
1532#endif
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. */
@@ -1588,6 +1632,7 @@ main (argc, argv
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 ();
@@ -1599,13 +1644,6 @@ main (argc, argv
1599 1644
1600 syms_of_menu (); 1645 syms_of_menu ();
1601 1646
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
1609#ifdef HAVE_NTGUI 1647#ifdef HAVE_NTGUI
1610 syms_of_w32term (); 1648 syms_of_w32term ();
1611 syms_of_w32fns (); 1649 syms_of_w32fns ();
@@ -1622,6 +1660,14 @@ main (argc, argv
1622 syms_of_fontset (); 1660 syms_of_fontset ();
1623#endif /* MAC_OSX && HAVE_CARBON */ 1661#endif /* MAC_OSX && HAVE_CARBON */
1624 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 */
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 */
@@ -1843,6 +1889,15 @@ struct standard_args standard_args[] =
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 },
@@ -1862,6 +1917,13 @@ struct standard_args standard_args[] =
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};
@@ -2158,6 +2220,10 @@ shut_down_emacs (sig, no_x, stuff)
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