(Qfont_spec, Qfont_entity, Qfont_object): Extern them.
[bpt/emacs.git] / src / emacs.c
index 21e583f..7074076 100644 (file)
@@ -1,6 +1,7 @@
 /* Fully extensible Emacs, running on Unix, intended for GNU.
    Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1998, 1999,
-                 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+                 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+                 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -262,6 +263,7 @@ Initialization options:\n\
 \n\
 --batch                     do not do interactive display; implies -q\n\
 --debug-init                enable Emacs Lisp debugger for init file\n\
+--disable-font-backend      do not use font backend (only if compiled)\n\
 --display, -d DISPLAY       use X server DISPLAY\n\
 --multibyte, --no-unibyte   inhibit the effect of EMACS_UNIBYTE\n\
 --no-desktop                do not load a saved desktop\n\
@@ -325,6 +327,7 @@ Display options:\n\
 --title, -T TITLE               title for initial Emacs frame\n\
 --vertical-scroll-bars, -vb     enable vertical scroll bars\n\
 --xrm XRESOURCES                set additional X resources\n\
+--parent-id XID                 set parent window\n\
 --help                          display this help and exit\n\
 --version                       output version information and exit\n\
 \n"
@@ -421,11 +424,7 @@ memory_warning_signal (sig)
 
 #if ! defined (DOS_NT) && ! defined (NO_ABORT)
 
-#ifndef ABORT_RETURN_TYPE
-#define ABORT_RETURN_TYPE void
-#endif
-
-ABORT_RETURN_TYPE
+void
 abort ()
 {
   kill (getpid (), SIGABRT);
@@ -788,9 +787,6 @@ bug_reporting_address ()
   return count >= 3 ? REPORT_EMACS_BUG_PRETEST_ADDRESS : REPORT_EMACS_BUG_ADDRESS;
 }
 
-#ifdef USE_FONT_BACKEND
-extern int enable_font_backend;
-#endif /* USE_FONT_BACKEND */
 
 /* ARGSUSED */
 int
@@ -1085,10 +1081,6 @@ main (argc, argv
   if (do_initial_setlocale)
     setlocale (LC_ALL, "");
 
-#ifdef EXTRA_INITIALIZE
-  EXTRA_INITIALIZE;
-#endif
-
   inhibit_window_system = 0;
 
   /* Handle the -t switch, which specifies filename to use as terminal.  */
@@ -1138,8 +1130,9 @@ main (argc, argv
   if (argmatch (argv, argc, "-script", "--script", 3, &junk, &skip_args))
     {
       noninteractive = 1;      /* Set batch mode.  */
-      /* Convert --script to --scriptload, un-skip it, and sort again
+      /* Convert --script to -scriptload, un-skip it, and sort again
         so that it will be handled in proper sequence.  */
+      /* FIXME broken for --script=FILE - is that supposed to work?  */
       argv[skip_args - 1] = "-scriptload";
       skip_args -= 2;
       sort_args (argc, argv);
@@ -1363,9 +1356,7 @@ main (argc, argv
 #ifdef CLASH_DETECTION
   init_filelock ();
 #endif
-#ifndef MAC_OS8
   init_atimer ();
-#endif
   running_asynch_code = 0;
 
   /* Handle --unibyte and the EMACS_UNIBYTE envvar,
@@ -1432,17 +1423,6 @@ main (argc, argv
   no_loadup
     = argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args);
 
-#ifdef USE_FONT_BACKEND
-  enable_font_backend = 1;
-  if (argmatch (argv, argc, "-enable-font-backend", "--enable-font-backend",
-               4, NULL, &skip_args))
-    enable_font_backend = 1;
-  else if (argmatch (argv, argc,
-                    "-disable-font-backend", "--disable-font-backend",
-                    4, NULL, &skip_args))
-    enable_font_backend = 0;
-#endif /* USE_FONT_BACKEND */
-
 #ifdef HAVE_X_WINDOWS
   /* Stupid kludge to catch command-line display spec.  We can't
      handle this argument entirely in window system dependent code
@@ -1558,10 +1538,8 @@ main (argc, argv
       /* The basic levels of Lisp must come first.  */
       /* And data must come first of all
         for the sake of symbols like error-message.  */
-#ifndef MAC_OS8
       /* Called before init_window_once for Mac OS Classic.  */
       syms_of_data ();
-#endif
       syms_of_chartab ();
       syms_of_lread ();
       syms_of_print ();
@@ -1576,10 +1554,7 @@ main (argc, argv
       syms_of_casetab ();
       syms_of_callproc ();
       syms_of_category ();
-#ifndef MAC_OS8
-      /* Called before init_window_once for Mac OS Classic.  */
       syms_of_ccl ();
-#endif
       syms_of_character ();
       syms_of_cmds ();
 #ifndef NO_DIR_LIBRARY
@@ -1599,11 +1574,8 @@ main (argc, argv
       syms_of_marker ();
       syms_of_minibuf ();
       syms_of_process ();
-#ifndef MAC_OS8
-      /* Called before init_window_once for Mac OS Classic.  */
       syms_of_search ();
       syms_of_frame ();
-#endif
       syms_of_syntax ();
       syms_of_terminal ();
       syms_of_term ();
@@ -1611,10 +1583,7 @@ main (argc, argv
 #ifdef HAVE_SOUND
       syms_of_sound ();
 #endif
-#ifndef MAC_OS8
-      /* Called before init_window_once for Mac OS Classic.  */
       syms_of_textprop ();
-#endif
       syms_of_composite ();
 #ifdef VMS
       syms_of_vmsproc ();
@@ -1699,10 +1668,7 @@ main (argc, argv
 
   init_editfns (); /* init_process uses Voperating_system_release. */
   init_process (); /* init_display uses add_keyboard_wait_descriptor. */
-#ifndef MAC_OS8
-  /* Called before init_window_once for Mac OS Classic.  */
   init_keyboard ();    /* This too must precede init_sys_modes.  */
-#endif
 #ifdef VMS
   init_vmsproc ();     /* And this too.  */
 #endif /* VMS */
@@ -1843,7 +1809,6 @@ struct standard_args standard_args[] =
   { "-unibyte", "--unibyte", 81, 0 },
   { "-no-multibyte", "--no-multibyte", 80, 0 },
   { "-nl", "--no-loadup", 70, 0 },
-  { "-enable-font-backend", "--enable-font-backend", 65, 0 },
   { "-disable-font-backend", "--disable-font-backend", 65, 0 },
   /* -d must come last before the options handled in startup.el.  */
   { "-d", "--display", 60, 1 },
@@ -1882,6 +1847,7 @@ struct standard_args standard_args[] =
   { "-title", 0, 10, 1 },
   { "-name", "--name", 10, 1 },
   { "-xrm", "--xrm", 10, 1 },
+  { "-parent-id", "--parent-id", 10, 1 },
   { "-r", "--reverse-video", 5, 0 },
   { "-rv", 0, 5, 0 },
   { "-reverse", 0, 5, 0 },
@@ -1896,7 +1862,11 @@ struct standard_args standard_args[] =
   { "-directory", 0, 0, 1 },
   { "-l", "--load", 0, 1 },
   { "-load", 0, 0, 1 },
-  { "-scriptload", "--scriptload", 0, 1 },
+  /* This has no longname, because using --scriptload confuses sort_args,
+     because then the --script long option seems to match twice; ie
+     you can't have a long option which is a prefix of another long
+     option.  In any case, this is entirely an internal option.  */
+  { "-scriptload", NULL, 0, 1 },
   { "-f", "--funcall", 0, 1 },
   { "-funcall", 0, 0, 1 },
   { "-eval", "--eval", 0, 1 },
@@ -2007,6 +1977,9 @@ sort_args (argc, argv)
                    fatal ("Option `%s' requires an argument\n", argv[from]);
                  from += options[from];
                }
+             /* FIXME When match < 0, shouldn't there be some error,
+                or at least indication to the user that there was a
+                problem?  */
            }
        done: ;
        }