/* 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.
\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\
--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"
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). */
#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);
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. */
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);
init_alloc_once ();
init_obarray ();
init_eval_once ();
+ init_character_once ();
init_charset_once ();
init_coding_once ();
init_syntax_once (); /* Create standard syntax table. */
syms_of_macterm ();
syms_of_macmenu ();
syms_of_macselect ();
- syms_of_data ();
syms_of_search ();
syms_of_frame ();
mac_term_init (build_string ("Mac"), NULL, NULL);
init_keyboard ();
#endif
+ /* Called before syms_of_fileio, because it sets up Qerror_condition. */
+ syms_of_data ();
+ syms_of_fileio ();
+ /* Before syms_of_coding to initialize Vgc_cons_threshold. */
+ syms_of_alloc ();
+ /* Before syms_of_coding because it initializes Qcharsetp. */
+ syms_of_charset ();
+ /* Before init_window_once, because it sets up the
+ Vcoding_system_hash_table. */
+ syms_of_coding (); /* This should be after syms_of_fileio. */
init_window_once (); /* Init the window system. */
init_fileio_once (); /* Must precede any path manipulation. */
#ifdef CLASH_DETECTION
init_filelock ();
#endif
-#ifndef MAC_OS8
init_atimer ();
-#endif
running_asynch_code = 0;
/* Handle --unibyte and the EMACS_UNIBYTE envvar,
Lisp_Object buffer;
buffer = Fcdr (XCAR (tail));
- /* Verify that all buffers are empty now, as they
- ought to be. */
- if (BUF_Z (XBUFFER (buffer)) > BUF_BEG (XBUFFER (buffer)))
- abort ();
- /* It is safe to do this crudely in an empty buffer. */
- XBUFFER (buffer)->enable_multibyte_characters = Qnil;
+ /* Make a multibyte buffer unibyte. */
+ if (BUF_Z_BYTE (XBUFFER (buffer)) > BUF_Z (XBUFFER (buffer)))
+ {
+ struct buffer *current = current_buffer;
+
+ set_buffer_temp (XBUFFER (buffer));
+ Fset_buffer_multibyte (Qnil);
+ set_buffer_temp (current);
+ }
}
}
}
no_loadup
= argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args);
-
#ifdef HAVE_X_WINDOWS
/* Stupid kludge to catch command-line display spec. We can't
handle this argument entirely in window system dependent code
/* 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_alloc ();
+ syms_of_chartab ();
syms_of_lread ();
syms_of_print ();
syms_of_eval ();
syms_of_fns ();
syms_of_floatfns ();
- syms_of_abbrev ();
syms_of_buffer ();
syms_of_bytecode ();
syms_of_callint ();
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_charset ();
+ syms_of_character ();
syms_of_cmds ();
#ifndef NO_DIR_LIBRARY
syms_of_dired ();
syms_of_doc ();
syms_of_editfns ();
syms_of_emacs ();
- syms_of_fileio ();
- syms_of_coding (); /* This should be after syms_of_fileio. */
#ifdef CLASH_DETECTION
syms_of_filelock ();
#endif /* CLASH_DETECTION */
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 ();
#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 ();
syms_of_window ();
syms_of_xdisp ();
#ifdef HAVE_WINDOW_SYSTEM
+ syms_of_font ();
syms_of_fringe ();
syms_of_image ();
#endif /* HAVE_WINDOW_SYSTEM */
syms_of_fontset ();
#endif /* MAC_OSX && HAVE_CARBON */
+#ifdef HAVE_DBUS
+ syms_of_dbusbind ();
+#endif /* HAVE_DBUS */
+
#ifdef SYMS_SYSTEM
SYMS_SYSTEM;
#endif
#endif /* HAVE_NTGUI */
}
+ 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 */
init_image ();
#endif /* HAVE_WINDOW_SYSTEM */
init_macros ();
- init_editfns ();
init_floatfns ();
#ifdef VMS
init_vmsfns ();
{ "-unibyte", "--unibyte", 81, 0 },
{ "-no-multibyte", "--no-multibyte", 80, 0 },
{ "-nl", "--no-loadup", 70, 0 },
+ { "-disable-font-backend", "--disable-font-backend", 65, 0 },
/* -d must come last before the options handled in startup.el. */
{ "-d", "--display", 60, 1 },
{ "-display", 0, 60, 1 },
{ "-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 },
{ "-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 },
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: ;
}
{
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");
}
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,
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,