extern void malloc_warning ();
extern void set_time_zone_rule ();
extern char *index ();
-extern char *strerror ();
+
+/* Make these values available in GDB, which doesn't see macros. */
+
+EMACS_INT gdb_valbits = VALBITS;
+EMACS_INT gdb_gctypebits = GCTYPEBITS;
+EMACS_INT gdb_emacs_intbits = sizeof (EMACS_INT) * BITS_PER_CHAR;
+#ifdef DATA_SEG_BITS
+EMACS_INT gdb_data_seg_bits = DATA_SEG_BITS;
+#else
+EMACS_INT gdb_data_seg_bits = 0;
+#endif
+EMACS_INT PVEC_FLAG = PSEUDOVECTOR_FLAG;
/* Command line args from shell, as list of strings */
Lisp_Object Vcommand_line_args;
Lisp_Object Qfile_name_handler_alist;
/* Current and previous system locales for messages and time. */
-Lisp_Object Vmessages_locale;
-Lisp_Object Vprevious_messages_locale;
-Lisp_Object Vtime_locale;
-Lisp_Object Vprevious_time_locale;
+Lisp_Object Vsystem_messages_locale;
+Lisp_Object Vprevious_system_messages_locale;
+Lisp_Object Vsystem_time_locale;
+Lisp_Object Vprevious_system_time_locale;
/* If non-zero, emacs should not attempt to use an window-specific code,
but instead should use the virtual terminal under which it was started */
static void sort_args ();
void syms_of_emacs ();
+
+#define USAGE1 "\
+Usage: %s [OPTION-OR-FILENAME]...\n\
+\n\
+Run Emacs, the extensible, customizable, self-documenting real-time\n\
+display editor. The recommended way to start Emacs for normal editing\n\
+is with no options at all.\n\
+\n\
+Run M-x info RET m emacs RET m command arguments RET inside Emacs to\n\
+read the main documentation for these command-line arguments.\n\
+\n\
+Initialization options:\n\
+\n\
+--batch do not do interactive display; implies -q\n\
+--debug-init enable Emacs Lisp debugger during init file\n\
+--help display this help message and exit\n\
+--multibyte, --no-unibyte run Emacs in multibyte mode\n\
+--no-init-file, -q load neither ~/.emacs nor default.el\n\
+--no-shared-memory, -nl do not use shared memory\n\
+--no-site-file do not load site-start.el\n\
+--no-windows, -nw don't communicate with X, ignoring $DISPLAY\n\
+--terminal, -t DEVICE use DEVICE for terminal I/O\n\
+--unibyte, --no-multibyte run Emacs in unibyte mode\n\
+--user, -u USER load ~USER/.emacs instead of your own\n\
+--version display version information and exit\n\
+\n\
+Action options:\n\
+\n\
+FILE visit FILE using find-file\n\
++LINENUM FILE visit FILE using find-file, then go to line LINENUM\n\
+--directory, -L DIR add DIR to variable load-path\n\
+--eval EXPR evaluate Emacs Lisp expression EXPR\n\
+--execute EXPR evaluate Emacs Lisp expression EXPR\n\
+--find-file FILE visit FILE\n\
+--funcall, -f FUNC call Emacs function FUNC with no arguments\n\
+--insert FILE insert contents of FILE into current buffer\n\
+--kill exit without asking for confirmation\n\
+--load, -l FILE load FILE of Emacs Lisp code using the load function\n\
+--visit FILE visit FILE\n\
+\n"
+
+#define USAGE2 "\
+Display options:\n\
+\n\
+--background-color, -bg COLOR window background color\n\
+--border-color, -bd COLOR main border color\n\
+--border-width, -bw WIDTH width of main border\n\
+--cursor-color, -cr COLOR color of the Emacs cursor indicating point\n\
+--display, -d DISPLAY use X server DISPLAY\n\
+--font, -fn FONT default font; must be fixed-widthp\n\
+--foreground-color, -fg COLOR window foreground color\n\
+--geometry, -g GEOMETRY window geometry\n\
+--iconic start Emacs in iconified state\n\
+--icon-type, -i use picture of gnu for Emacs icon\n\
+--internal-border, -ib WIDTH width between text and main border\n\
+--line-spacing, -lsp PIXELS additional space to put between lines\n\
+--mouse-color, -ms COLOR mouse cursor color in Emacs window\n\
+--name NAME title of main Emacs window\n\
+--reverse-video, -r, -rv switch foreground and background\n\
+--title, -T, -wn, TITLE title for Emacs windows\n\
+--vertical-scroll-bars, -vb enable vertical scroll bars\n\
+--xrm XRESOURCES set additional X resources\n\
+\n\
+You can generally also specify long option names with a single -; for\n\
+example, -batch as well as --batch. You can use any unambiguous\n\
+abbreviation for a --option.\n\
+\n\
+Various environment variables and window system resources also affect\n\
+Emacs' operation. See the main documentation.\n\
+\n\
+Report bugs to bug-gnu-emacs@gnu.org. First, please see the Bugs\n\
+section of the Emacs manual or the file BUGS.\n"
+
\f
/* Signal code for the fatal signal that was received */
int fatal_error_code;
MSDOS has its own definition on msdos.c */
#if ! defined (DOS_NT) && ! defined (NO_ABORT)
-void
+
+#ifndef ABORT_RETURN_TYPE
+#define ABORT_RETURN_TYPE void
+#endif
+
+ABORT_RETURN_TYPE
abort ()
{
kill (getpid (), SIGABRT);
char **argv;
char **envp;
{
+#if GC_MARK_STACK
+ Lisp_Object dummy;
+#endif
char stack_bottom_variable;
int do_initial_setlocale;
int skip_args = 0;
#endif
int no_loadup = 0;
+#if GC_MARK_STACK
+ extern Lisp_Object *stack_base;
+ stack_base = &dummy;
+#endif
+
#ifdef LINUX_SBRK_BUG
__sbrk (1);
#endif
/* Handle the --help option, which gives a usage message.. */
if (argmatch (argv, argc, "-help", "--help", 3, NULL, &skip_args))
{
- printf ("\
-Usage: %s [--batch] [-t term] [--terminal term]\n\
- [-d display] [--display display] [-nw] [--no-windows]\n\
- [-q] [--no-init-file] [-u user] [--user user] [--debug-init]\n\
- [--unibyte] [--multibyte] [--version] [--no-site-file]\n\
- [-f func] [--funcall func] [-l file] [--load file] [--eval expr]\n\
- [--insert file] [+linenum] file-to-visit [--kill]\n\
-Report bugs to bug-gnu-emacs@gnu.org. First, please see\n\
-the Bugs section of the Emacs manual or the file BUGS.\n", argv[0]);
+ printf (USAGE1, argv[0]);
+ printf (USAGE2);
exit (0);
}
#endif
}
-#ifdef POSIX_SIGNALS
init_signals ();
-#endif
/* Don't catch SIGHUP if dumping. */
if (1
function creates Vterminal_frame. Termcap frames now use
faces, and the face implementation uses some symbols as
face names. */
-#ifndef HAVE_NTGUI
syms_of_xfaces ();
-#endif
init_window_once (); /* Init the window system */
init_fileio_once (); /* Must precede any path manipulation. */
if (do_initial_setlocale)
{
fixup_locale ();
- Vmessages_locale = Vprevious_messages_locale;
- Vtime_locale = Vprevious_time_locale;
+ Vsystem_messages_locale = Vprevious_system_messages_locale;
+ Vsystem_time_locale = Vprevious_system_time_locale;
}
init_eval ();
#ifdef CLASH_DETECTION
init_filelock ();;
#endif
+ init_atimer ();
running_asynch_code = 0;
/* Handle --unibyte and the EMACS_UNIBYTE envvar,
}
no_loadup
- = !argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args);
+ = argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args);
#ifdef HAVE_X_WINDOWS
/* AIX crashes are reported in system versions 3.2.3 and 3.2.4
if this is not done. Do it after set_process_environment so that we
don't pollute Vprocess_environment. */
-#ifdef AIX
+ /* Setting LANG here will defeat the startup locale processing... */
+#ifdef AIX3_2
putenv ("LANG=C");
#endif
syms_of_sound ();
#endif
- /* Only defined if Emacs is compiled with USE_TEXT_PROPERTIES */
syms_of_textprop ();
+ syms_of_composite ();
#ifdef VMS
syms_of_vmsproc ();
#endif /* VMS */
#ifdef HAVE_NTGUI
syms_of_w32term ();
syms_of_w32fns ();
- syms_of_w32faces ();
syms_of_w32select ();
syms_of_w32menu ();
syms_of_fontset ();
init_xdisp ();
init_macros ();
init_editfns ();
-#ifdef LISP_FLOAT_TYPE
init_floatfns ();
-#endif
#ifdef VMS
init_vmsfns ();
#endif /* VMS */
extern void _mcleanup ();
extern char etext;
extern void safe_bcopy ();
+ extern void dump_opcode_frequencies ();
+
atexit (_mcleanup);
/* This uses safe_bcopy because that function comes first in the
Emacs executable. It might be better to use something that
{ "-f", "--funcall", 0, 1 },
{ "-funcall", 0, 0, 1 },
{ "-eval", "--eval", 0, 1 },
+ { "-execute", "--execute", 0, 1 },
{ "-find-file", "--find-file", 0, 1 },
{ "-visit", "--visit", 0, 1 },
+ { "-file", "--file", 0, 1 },
{ "-insert", "--insert", 0, 1 },
/* This should be processed after ordinary file name args and the like. */
{ "-kill", "--kill", -10, 0 },
void
fixup_locale ()
{
- char *l;
-
/* The Emacs Lisp reader needs LC_NUMERIC to be "C",
so that numbers are read and printed properly for Emacs Lisp. */
setlocale (LC_NUMERIC, "C");
-
-#ifdef LC_MESSAGES
- l = setlocale (LC_MESSAGES, (char *) 0);
- Vprevious_messages_locale = l ? build_string (l) : Qnil;
-#endif
- l = setlocale (LC_TIME, (char *) 0);
- Vprevious_time_locale = l ? build_string (l) : Qnil;
}
+/* Set system locale CATEGORY, with previous locale *PLOCALE, to
+ DESIRED_LOCALE. */
static void
synchronize_locale (category, plocale, desired_locale)
int category;
Lisp_Object *plocale;
Lisp_Object desired_locale;
{
- if (STRINGP (desired_locale)
- && (NILP (*plocale) || NILP (Fstring_equal (*plocale, desired_locale)))
- && setlocale (category, XSTRING (desired_locale)->data))
- *plocale = desired_locale;
+ if (! EQ (*plocale, desired_locale))
+ {
+ *plocale = desired_locale;
+ setlocale (category, (STRINGP (desired_locale)
+ ? (char *)(XSTRING (desired_locale)->data)
+ : ""));
+ }
}
-/* Set system time locale to match Vtime_locale, if possible. */
+/* Set system time locale to match Vsystem_time_locale, if possible. */
void
-synchronize_time_locale ()
+synchronize_system_time_locale ()
{
- synchronize_locale (LC_TIME, &Vprevious_time_locale, Vtime_locale);
+ synchronize_locale (LC_TIME, &Vprevious_system_time_locale,
+ Vsystem_time_locale);
}
-/* Set system messages locale to match Vmessages_locale, if possible. */
+/* Set system messages locale to match Vsystem_messages_locale, if
+ possible. */
void
-synchronize_messages_locale ()
+synchronize_system_messages_locale ()
{
#ifdef LC_MESSAGES
- synchronize_locale (LC_MESSAGES, &Vprevious_messages_locale,
- Vmessages_locale);
+ synchronize_locale (LC_MESSAGES, &Vprevious_system_messages_locale,
+ Vsystem_messages_locale);
#endif
}
#endif /* HAVE_SETLOCALE */
near where the Emacs executable was found.");
Vinstallation_directory = Qnil;
- DEFVAR_LISP ("messages-locale", &Vmessages_locale,
+ DEFVAR_LISP ("system-messages-locale", &Vsystem_messages_locale,
"System locale for messages.");
- Vmessages_locale = Qnil;
+ Vsystem_messages_locale = Qnil;
- DEFVAR_LISP ("previous-messages-locale", &Vprevious_messages_locale,
+ DEFVAR_LISP ("previous-system-messages-locale",
+ &Vprevious_system_messages_locale,
"Most recently used system locale for messages.");
- Vprevious_messages_locale = Qnil;
+ Vprevious_system_messages_locale = Qnil;
- DEFVAR_LISP ("time-locale", &Vtime_locale,
+ DEFVAR_LISP ("system-time-locale", &Vsystem_time_locale,
"System locale for time.");
- Vtime_locale = Qnil;
+ Vsystem_time_locale = Qnil;
- DEFVAR_LISP ("previous-time-locale", &Vprevious_time_locale,
+ DEFVAR_LISP ("previous-system-time-locale", &Vprevious_system_time_locale,
"Most recently used system locale for time.");
- Vprevious_time_locale = Qnil;
+ Vprevious_system_time_locale = Qnil;
}