Include coding.h and termhooks.h.
[bpt/emacs.git] / src / emacs.c
index df5e4cd..c402521 100644 (file)
@@ -202,6 +202,10 @@ extern int inherited_pgroup;
 int display_arg;
 #endif
 
+#ifdef HAVE_NS
+extern char ns_no_defaults;
+#endif
+
 /* An address near the bottom of the stack.
    Tells GC how to save a copy of the stack.  */
 char *stack_bottom;
@@ -1113,9 +1117,10 @@ main (int argc, char **argv)
 
 #ifndef NS_IMPL_COCOA
       f = fork ();
-#else
-      /* Under Cocoa we must do fork+exec:
-   (http://developer.apple.com/ReleaseNotes/CoreFoundation/CoreFoundation.html)
+#else /* NS_IMPL_COCOA */
+      /* Under Cocoa we must do fork+exec as CoreFoundation lib fails in
+         forked process: http://developer.apple.com/ReleaseNotes/
+                                  CoreFoundation/CoreFoundation.html)
          We mark being in the exec'd process by a daemon name argument of
          form "--daemon=\nFD0,FD1\nNAME" where FD are the pipe file descriptors,
          NAME is the original daemon name, if any. */
@@ -1123,7 +1128,7 @@ main (int argc, char **argv)
          f = fork ();  /* in orig */
       else
          f = 0;  /* in exec'd */
-#endif
+#endif /* NS_IMPL_COCOA */
       if (f > 0)
        {
          int retval;
@@ -1161,9 +1166,9 @@ main (int argc, char **argv)
 
 #ifdef NS_IMPL_COCOA
       {
-        /* in orig process, forked as child, OR in exec'd */
+        /* In orig process, forked as child, OR in exec'd. */
         if (!dname_arg || !strchr (dname_arg, '\n'))
-          {  /* in orig, child: now exec w/special daemon name */
+          {  /* In orig, child: now exec w/special daemon name. */
             char fdStr[80];
 
             if (dname_arg && strlen (dname_arg) > 70)
@@ -1181,7 +1186,7 @@ main (int argc, char **argv)
             exit (1);
           }
 
-        /* in exec'd: parse special dname into pipe and name info */
+        /* In exec'd: parse special dname into pipe and name info. */
         if (!dname_arg || !strchr (dname_arg, '\n')
             || strlen (dname_arg) < 1 || strlen (dname_arg) > 70)
           {
@@ -1193,7 +1198,7 @@ main (int argc, char **argv)
                 dname_arg2);
         dname_arg = strlen (dname_arg2) ? dname_arg2 : NULL;
       }
-#endif
+#endif /* NS_IMPL_COCOA */
 
       if (dname_arg)
                daemon_name = xstrdup (dname_arg);
@@ -1473,6 +1478,16 @@ main (int argc, char **argv)
     {
       char *tmp;
       display_arg = 4;
+      if (argmatch (argv, argc, "-q", "--no-init-file", 6, NULL, &skip_args))
+        {
+          ns_no_defaults = 1;
+          skip_args--;
+        }
+      if (argmatch (argv, argc, "-Q", "--quick", 5, NULL, &skip_args))
+        {
+          ns_no_defaults = 1;
+          skip_args--;
+        }
 #ifdef NS_IMPL_COCOA
       if (skip_args < argc)
         {