(Qfont_spec, Qfont_entity, Qfont_object): Extern them.
[bpt/emacs.git] / src / emacs.c
index 94357bb..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"
@@ -353,7 +356,7 @@ int fatal_error_in_progress;
 void (*fatal_error_signal_hook) P_ ((void));
 
 #ifdef HAVE_GTK_AND_PTHREAD
-/* When compiled with GTK and running under Gnome, multiple threads meay be
+/* When compiled with GTK and running under Gnome, multiple threads may be
    created.  Keep track of our main thread to make sure signals are delivered
    to it (see syssignal.h).  */
 
@@ -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 ();
@@ -1569,7 +1547,6 @@ main (argc, argv
       syms_of_fns ();
       syms_of_floatfns ();
 
-      syms_of_abbrev ();
       syms_of_buffer ();
       syms_of_bytecode ();
       syms_of_callint ();
@@ -1577,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
@@ -1600,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 ();
@@ -1612,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 ();
@@ -1626,9 +1594,7 @@ main (argc, argv
       syms_of_window ();
       syms_of_xdisp ();
 #ifdef HAVE_WINDOW_SYSTEM
-#ifdef USE_FONT_BACKEND
       syms_of_font ();
-#endif /* USE_FONT_BACKEND */
       syms_of_fringe ();
       syms_of_image ();
 #endif /* HAVE_WINDOW_SYSTEM */
@@ -1667,6 +1633,10 @@ main (argc, argv
       syms_of_fontset ();
 #endif /* MAC_OSX && HAVE_CARBON */
 
+#ifdef HAVE_DBUS
+      syms_of_dbusbind ();
+#endif /* HAVE_DBUS */
+
 #ifdef SYMS_SYSTEM
       SYMS_SYSTEM;
 #endif
@@ -1696,11 +1666,9 @@ main (argc, argv
 
   init_charset ();
 
+  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 */
@@ -1718,7 +1686,6 @@ main (argc, argv
   init_image ();
 #endif /* HAVE_WINDOW_SYSTEM */
   init_macros ();
-  init_editfns ();
   init_floatfns ();
 #ifdef VMS
   init_vmsfns ();
@@ -1842,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 },
@@ -1881,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 },
@@ -1895,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 },
@@ -2006,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: ;
        }
@@ -2260,10 +2234,10 @@ You must run Emacs in batch mode in order to dump it.  */)
     {
       fprintf (stderr, "**************************************************\n");
       fprintf (stderr, "Warning: Your system has a gap between BSS and the\n");
-      fprintf (stderr, "heap (%lu byte).  This usually means that exec-shield\n",
+      fprintf (stderr, "heap (%lu bytes).  This usually means that exec-shield\n",
                heap_bss_diff);
       fprintf (stderr, "or something similar is in effect.  The dump may\n");
-      fprintf (stderr, "fail because of this.  See the section about \n");
+      fprintf (stderr, "fail because of this.  See the section about\n");
       fprintf (stderr, "exec-shield in etc/PROBLEMS for more information.\n");
       fprintf (stderr, "**************************************************\n");
     }
@@ -2506,7 +2480,7 @@ Emacs is running.  */);
               doc: /* Non-nil means Emacs is running without interactive terminal.  */);
 
   DEFVAR_LISP ("kill-emacs-hook", &Vkill_emacs_hook,
-              doc: /* Hook to be run when kill-emacs is called.
+              doc: /* Hook to be run when `kill-emacs' is called.
 Since `kill-emacs' may be invoked when the terminal is disconnected (or
 in other similar situations), functions placed on this hook should not
 expect to be able to interact with the user.  To ask for confirmation,
@@ -2543,8 +2517,8 @@ The value is nil if that directory's name is not known.  */);
   DEFVAR_LISP ("installation-directory", &Vinstallation_directory,
               doc: /* A directory within which to look for the `lib-src' and `etc' directories.
 This is non-nil when we can't find those directories in their standard
-installed locations, but we can find them
-near where the Emacs executable was found.  */);
+installed locations, but we can find them near where the Emacs executable
+was found.  */);
   Vinstallation_directory = Qnil;
 
   DEFVAR_LISP ("system-messages-locale", &Vsystem_messages_locale,