/* 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.
+ Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1998, 1999,
+ 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Emacs.
You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING. If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA. */
#include <config.h>
#include <fcntl.h>
#include <windows.h> /* just for w32.h */
#include "w32.h"
+#include "w32heap.h" /* for prototype of sbrk */
#endif
#include "lisp.h"
#include "blockinput.h"
#include "syssignal.h"
#include "process.h"
+#include "frame.h"
#include "termhooks.h"
#include "keyboard.h"
#include "keymap.h"
/* From glibc, a routine that returns a copy of the malloc internal state. */
extern void *malloc_get_state ();
/* From glibc, a routine that overwrites the malloc internal state. */
-extern void malloc_set_state ();
+extern int malloc_set_state ();
/* Non-zero if the MALLOC_CHECK_ enviroment variable was set while
dumping. Used to work around a bug in glibc's malloc. */
int malloc_using_checking;
#ifdef HAVE_WINDOW_SYSTEM
-extern Lisp_Object Vwindow_system;
+extern Lisp_Object Vinitial_window_system;
#endif /* HAVE_WINDOW_SYSTEM */
extern Lisp_Object Vauto_save_list_file_name;
--no-shared-memory, -nl do not use shared memory\n\
--no-site-file do not load site-start.el\n\
--no-splash do not display a splash screen on startup\n\
---no-window-system, -nw don't communicate with X, ignoring $DISPLAY\n\
+--no-window-system, -nw do not communicate with X, ignoring $DISPLAY\n\
+--quick, -Q equivalent to -q --no-site-file --no-splash\n\
--script FILE run FILE as an Emacs Lisp script\n\
--terminal, -t DEVICE use DEVICE for terminal I/O\n\
--unibyte, --no-multibyte run Emacs in unibyte mode\n\
Display options:\n\
\n\
--background-color, -bg COLOR window background color\n\
+--basic-display, -D disable many display features;\n\
+ 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\
--fullscreen, -fs make first frame fullscreen\n\
--fullwidth, -fw make the first frame wide as the screen\n\
--geometry, -g GEOMETRY window geometry\n\
---icon-type, -i use picture of gnu for Emacs icon\n\
+--no-bitmap-icon, -nbi do not use picture of gnu for Emacs icon\n\
--iconic start Emacs in iconified state\n\
--internal-border, -ib WIDTH width between text and main border\n\
--line-spacing, -lsp PIXELS additional space to put between lines\n\
--xrm XRESOURCES set additional X resources\n\
--help display this help and exit\n\
--version output version information and exit\n\
-\n\
+\n"
+
+#define USAGE4 "\
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"
-
-#define USAGE4 "\
+\n\
Report bugs to %s. First, please see the Bugs\n\
section of the Emacs manual or the file BUGS.\n"
#define REPORT_EMACS_BUG_ADDRESS "bug-gnu-emacs@gnu.org"
-#define REPORT_EMACS_BUG_PRETEST_ADDRESS "emacs-pretest-bug@gnu.org"
+#define REPORT_EMACS_BUG_PRETEST_ADDRESS "multi-tty@lists.fnord.hu"
/* This function is used to determine an address to which bug report should
be sent. */
else
{
printf ("GNU Emacs %s\n", SDATA (tem));
- printf ("Copyright (C) 2004 Free Software Foundation, Inc.\n");
+ printf ("Copyright (C) 2005 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");
{
/* Set this so we only do this once. */
putenv("EMACS_HEAP_EXEC=true");
- personality (PER_LINUX32);
+
+ /* A flag to turn off address randomization which is introduced
+ in linux kernel shipped with fedora core 4 */
+#define ADD_NO_RANDOMIZE 0x0040000
+ personality (PER_LINUX32 | ADD_NO_RANDOMIZE);
+#undef ADD_NO_RANDOMIZE
+
execvp (argv[0], argv);
/* If the exec fails, try to dump anyway. */
&& !getrlimit (RLIMIT_STACK, &rlim))
{
long newlim;
- extern int re_max_failures;
+ extern size_t re_max_failures;
/* Approximate the amount regex.c needs per unit of re_max_failures. */
int ratio = 20 * sizeof (char *);
/* Then add 33% to cover the size of the smaller stacks that regex.c
if (argmatch (argv, argc, "-script", "--script", 3, &junk, &skip_args))
{
noninteractive = 1; /* Set batch mode. */
- /* Convert --script to -l, un-skip it, and sort again so that -l will be
- handled in proper sequence. */
- argv[skip_args - 1] = "-l";
+ /* Convert --script to --scriptload, un-skip it, and sort again
+ so that it will be handled in proper sequence. */
+ argv[skip_args - 1] = "-scriptload";
skip_args -= 2;
sort_args (argc, argv);
}
faces, and the face implementation uses some symbols as
face names. */
syms_of_xfaces ();
+ /* XXX syms_of_keyboard uses some symbols in keymap.c. It would
+ be better to arrange things not to have this dependency. */
+ syms_of_keymap ();
/* Call syms_of_keyboard before init_window_once because
keyboard sets up symbols that include some face names that
the X support will want to use. This can happen when
syms_of_fontset ();
syms_of_macterm ();
syms_of_macmenu ();
+ syms_of_macselect ();
syms_of_data ();
syms_of_search ();
syms_of_frame ();
+ init_atimer ();
mac_term_init (build_string ("Mac"), NULL, NULL);
init_keyboard ();
#endif
#ifdef CLASH_DETECTION
init_filelock ();
#endif
+#ifndef MAC_OS8
init_atimer ();
+#endif
running_asynch_code = 0;
/* Handle --unibyte and the EMACS_UNIBYTE envvar,
#endif /* CLASH_DETECTION */
syms_of_indent ();
syms_of_insdel ();
- syms_of_keymap ();
+ /* syms_of_keymap (); */
syms_of_macros ();
syms_of_marker ();
syms_of_minibuf ();
#endif
#endif /* HAVE_X_WINDOWS */
-#ifdef HAVE_MENUS
#ifndef HAVE_NTGUI
#ifndef MAC_OS
/* Called before init_window_once for Mac OS Classic. */
syms_of_xmenu ();
#endif
#endif
-#endif
#ifdef HAVE_NTGUI
syms_of_w32term ();
syms_of_macterm ();
syms_of_macfns ();
syms_of_macmenu ();
+ syms_of_macselect ();
syms_of_fontset ();
#endif /* MAC_OSX && HAVE_CARBON */
#endif /* HAVE_NTGUI */
}
- if (!noninteractive)
- {
-#ifdef VMS
- init_vms_input ();/* init_display calls get_frame_size, that needs this. */
-#endif /* VMS */
- init_display (); /* Determine terminal type. init_sys_modes uses results. */
- }
+ 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. */
#ifdef VMS
init_vmsproc (); /* And this too. */
#endif /* VMS */
- init_sys_modes (); /* Init system terminal modes (RAW or CBREAK, etc.). */
+ if (!noninteractive)
+ {
+#ifdef VMS
+ init_vms_input ();/* init_display calls get_tty_size, that needs this. */
+#endif /* VMS */
+ init_display (); /* Determine terminal type. Calls init_sys_modes. */
+ }
init_fns ();
init_xdisp ();
#ifdef HAVE_WINDOW_SYSTEM
#ifdef VMS
init_vmsfns ();
#endif /* VMS */
- init_process ();
#ifdef HAVE_SOUND
init_sound ();
#endif
{ "-d", "--display", 60, 1 },
{ "-display", 0, 60, 1 },
/* Now for the options handled in startup.el. */
- { "-Q", "--bare-bones", 55, 0 },
- { "-bare-bones", 0, 55, 0 },
+ { "-Q", "--quick", 55, 0 },
+ { "-quick", 0, 55, 0 },
{ "-q", "--no-init-file", 50, 0 },
{ "-no-init-file", 0, 50, 0 },
{ "-no-site-file", "--no-site-file", 40, 0 },
{ "-u", "--user", 30, 1 },
{ "-user", 0, 30, 1 },
{ "-debug-init", "--debug-init", 20, 0 },
- { "-i", "--icon-type", 15, 0 },
- { "-itype", 0, 15, 0 },
+ { "-nbi", "--no-bitmap-icon", 15, 0 },
{ "-iconic", "--iconic", 15, 0 },
+ { "-D", "--basic-display", 12, 0},
+ { "-basic-display", 0, 12, 0},
{ "-bg", "--background-color", 10, 1 },
{ "-background", 0, 10, 1 },
{ "-fg", "--foreground-color", 10, 1 },
{ "-directory", 0, 0, 1 },
{ "-l", "--load", 0, 1 },
{ "-load", 0, 0, 1 },
+ { "-scriptload", "--scriptload", 0, 1 },
{ "-f", "--funcall", 0, 1 },
{ "-funcall", 0, 0, 1 },
{ "-eval", "--eval", 0, 1 },
if (EMACS_GET_TTY_PGRP (0, &tpgrp) != -1
&& tpgrp == pgrp)
{
- fflush (stdout);
- reset_sys_modes ();
+ reset_all_sys_modes ();
if (sig && sig != SIGTERM)
fprintf (stderr, "Fatal error (%d)", sig);
}
}
#else
fflush (stdout);
- reset_sys_modes ();
+ reset_all_sys_modes ();
#endif
stuff_buffered_input (stuff);
#if 0 /* This triggers a bug in XCloseDisplay and is not needed. */
#ifdef HAVE_X_WINDOWS
/* It's not safe to call intern here. Maybe we are crashing. */
- if (!noninteractive && SYMBOLP (Vwindow_system)
- && SCHARS (SYMBOL_NAME (Vwindow_system)) == 1
- && SREF (SYMBOL_NAME (Vwindow_system), 0) == 'x'
+ if (!noninteractive && SYMBOLP (Vinitial_window_system)
+ && SCHARS (SYMBOL_NAME (Vinitial_window_system)) == 1
+ && SREF (SYMBOL_NAME (Vinitial_window_system), 0) == 'x'
&& ! no_x)
Fx_close_current_connection ();
#endif /* HAVE_X_WINDOWS */
Many arguments are deleted from the list as they are processed. */);
DEFVAR_LISP ("system-type", &Vsystem_type,
-+ doc: /* Value is symbol indicating type of operating system you are using.
-+Special values:
-+ `gnu/linux' compiled for a GNU/Linux system.
-+ `darwin' compiled for Darwin (GNU-Darwin, Mac OS X, ...).
-+ `macos' compiled for Mac OS 9.
-+ `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.
-+Anything else indicates some sort of Unix system. */);
+ doc: /* Value is symbol indicating type of operating system you are using.
+Special values:
+ `gnu/linux' compiled for a GNU/Linux system.
+ `darwin' compiled for Darwin (GNU-Darwin, Mac OS X, ...).
+ `macos' compiled for Mac OS 9.
+ `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.
+Anything else indicates some sort of Unix system. */);
Vsystem_type = intern (SYSTEM_TYPE);
DEFVAR_LISP ("system-configuration", &Vsystem_configuration,