/* 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 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Emacs is distributed in the hope that it will be useful,
#endif
EMACS_INT PVEC_FLAG = PSEUDOVECTOR_FLAG;
EMACS_INT gdb_array_mark_flag = ARRAY_MARK_FLAG;
+/* GDB might say "No enum type named pvec_type" if we don't have at
+ least one symbol with that type, and then xbacktrace could fail. */
+enum pvec_type gdb_pvec_type = PVEC_TYPE_MASK;
/* Command line args from shell, as list of strings. */
Lisp_Object Vcommand_line_args;
used for debugging Emacs\n\
--border-color, -bd COLOR main border color\n\
--border-width, -bw WIDTH width of main border\n\
---color, --color=MODE color mode for character terminals;\n\
+--color, --color=MODE override color mode for character terminals;\n\
MODE defaults to `auto', and can also\n\
be `never', `auto', `always',\n\
or a mode name like `ansi8'\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
- created. Keep track of our main thread to make sure signals are delivered
- to it (see syssignal.h). */
+#ifdef FORWARD_SIGNAL_TO_MAIN_THREAD
+/* When compiled with GTK and running under Gnome, or Carbon under Mac
+ OS X, multiple threads may be created. Keep track of our main
+ thread to make sure signals are delivered to it (see syssignal.h). */
pthread_t main_thread;
#endif
-#ifdef SIGUSR1
-SIGTYPE
-handle_USR1_signal (sig)
- int sig;
-{
- struct input_event buf;
-
- SIGNAL_THREAD_CHECK (sig);
- bzero (&buf, sizeof buf);
- buf.kind = USER_SIGNAL_EVENT;
- buf.frame_or_window = selected_frame;
-
- kbd_buffer_store_event (&buf);
-}
-#endif /* SIGUSR1 */
-
-#ifdef SIGUSR2
-SIGTYPE
-handle_USR2_signal (sig)
- int sig;
-{
- struct input_event buf;
-
- SIGNAL_THREAD_CHECK (sig);
- bzero (&buf, sizeof buf);
- buf.kind = USER_SIGNAL_EVENT;
- buf.code = 1;
- buf.frame_or_window = selected_frame;
-
- kbd_buffer_store_event (&buf);
-}
-#endif /* SIGUSR2 */
-
/* Handle bus errors, invalid instruction, etc. */
SIGTYPE
fatal_error_signal (sig)
else
{
printf ("GNU Emacs %s\n", SDATA (tem));
- printf ("Copyright (C) 2005 Free Software Foundation, Inc.\n");
+ printf ("Copyright (C) 2008 Free Software Foundation, Inc.\n");
printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n");
printf ("You may redistribute copies of Emacs\n");
printf ("under the terms of the GNU General Public License.\n");
# endif /* not SYNC_INPUT */
#endif /* not SYSTEM_MALLOC */
-#ifdef HAVE_GTK_AND_PTHREAD
+#ifdef FORWARD_SIGNAL_TO_MAIN_THREAD
main_thread = pthread_self ();
-#endif /* HAVE_GTK_AND_PTHREAD */
+#endif /* FORWARD_SIGNAL_TO_MAIN_THREAD */
#if defined (MSDOS) || defined (WINDOWSNT)
/* We do all file input/output as binary files. When we need to translate
#if defined (USG5) && defined (INTERRUPT_INPUT)
setpgrp ();
#endif
+#endif
+#if defined (HAVE_GTK_AND_PTHREAD) && !defined (SYSTEM_MALLOC) && !defined (DOUG_LEA_MALLOC)
+ {
+ extern void malloc_enable_thread P_ ((void));
+
+ malloc_enable_thread ();
+ }
#endif
}
signal (SIGILL, fatal_error_signal);
signal (SIGTRAP, fatal_error_signal);
#ifdef SIGUSR1
- signal (SIGUSR1, handle_USR1_signal);
-#ifdef SIGUSR2
- signal (SIGUSR2, handle_USR2_signal);
+ add_user_signal (SIGUSR1, "sigusr1");
#endif
+#ifdef SIGUSR2
+ add_user_signal (SIGUSR2, "sigusr2");
#endif
#ifdef SIGABRT
signal (SIGABRT, fatal_error_signal);
syms_of_macfns ();
syms_of_ccl ();
syms_of_fontset ();
- syms_of_keymap ();
syms_of_macterm ();
syms_of_macmenu ();
syms_of_macselect ();
#endif /* CLASH_DETECTION */
syms_of_indent ();
syms_of_insdel ();
-#ifndef MAC_OS8
syms_of_keymap ();
-#endif
syms_of_macros ();
syms_of_marker ();
syms_of_minibuf ();
#endif
}
- /* Set up for profiling. This is known to work on FreeBSD and
- GNU/Linux. It might work on some other systems too. Give it a
- try and tell us if it works on your system. To compile for
- profiling use something like `make CFLAGS="-pg -g -O -DPROFILING=1'. */
-#if defined (__FreeBSD__) || defined (__linux)
+ /* Set up for profiling. This is known to work on FreeBSD,
+ GNU/Linux and MinGW. It might work on some other systems too.
+ Give it a try and tell us if it works on your system. To compile
+ for profiling, add -pg to the switches your platform uses in
+ CFLAGS and LDFLAGS. For example:
+ `make CFLAGS="-pg -g -O -DPROFILING=1" LDFLAGS="-pg -g"'. */
+#if defined (__FreeBSD__) || defined (GNU_LINUX) || defined(__MINGW32__)
#ifdef PROFILING
if (initialized)
{
extern void _mcleanup ();
+#ifdef __MINGW32__
+ extern unsigned char etext asm ("etext");
+#else
extern char etext;
+#endif
extern void safe_bcopy ();
extern void dump_opcode_frequencies ();
{ "-q", "--no-init-file", 50, 0 },
{ "-no-init-file", 0, 50, 0 },
{ "-no-site-file", "--no-site-file", 40, 0 },
- { "-no-splash", "--no-splash", 40, 0 },
{ "-u", "--user", 30, 1 },
{ "-user", 0, 30, 1 },
{ "-debug-init", "--debug-init", 20, 0 },
{ "-hb", "--horizontal-scroll-bars", 5, 0 },
{ "-vb", "--vertical-scroll-bars", 5, 0 },
{ "-color", "--color", 5, 0},
+ { "-no-splash", "--no-splash", 3, 0 },
+ { "-no-desktop", "--no-desktop", 3, 0 },
/* These have the same priority as ordinary file name args,
so they are not reordered with respect to those. */
{ "-L", "--directory", 0, 1 },
DEFUN ("kill-emacs", Fkill_emacs, Skill_emacs, 0, 1, "P",
doc: /* Exit the Emacs job and kill it.
If ARG is an integer, return ARG as the exit program code.
-If ARG is a string, stuff it as keyboard input.
+If ARG is a string, stuff it as keyboard input.
The value of `kill-emacs-hook', if not void,
is a list of functions (of no args),
stuff_buffered_input (stuff);
+#ifdef subprocesses
+ inhibit_sentinels = 1;
+#endif
kill_buffer_processes (Qnil);
Fdo_auto_save (Qt, Qnil);
if (! noninteractive)
error ("Dumping Emacs works only in batch mode");
-#ifdef __linux__
+#ifdef GNU_LINUX
if (heap_bss_diff > MAX_HEAP_BSS_DIFF)
{
fprintf (stderr, "**************************************************\n");
fprintf (stderr, "exec-shield in etc/PROBLEMS for more information.\n");
fprintf (stderr, "**************************************************\n");
}
-#endif /* __linux__ */
+#endif /* GNU_LINUX */
/* Bind `command-line-processed' to nil before dumping,
so that the dumped Emacs will process its command line
`ms-dos' compiled as an MS-DOS application.
`windows-nt' compiled as a native W32 application.
`cygwin' compiled using the Cygwin library.
- `vax-vms' or `axp-vms': compiled for a (Open)VMS system.
+ `vax-vms' or
+ `axp-vms' compiled for a (Open)VMS system.
Anything else indicates some sort of Unix system. */);
Vsystem_type = intern (SYSTEM_TYPE);
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,
emacs_priority = 0;
DEFVAR_LISP ("path-separator", &Vpath_separator,
- doc: /* The directory separator in search paths, as a string. */);
+ doc: /* String containing the character that separates directories in
+search paths, such as PATH and other similar environment variables. */);
{
char c = SEPCHAR;
Vpath_separator = make_string (&c, 1);
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,