/* 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, 2008, 2009
- Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+ 2010 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#include <sys/types.h>
#include <sys/file.h>
+#include <setjmp.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef BSD_SYSTEM
+#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
extern void *malloc_get_state ();
/* From glibc, a routine that overwrites the malloc internal state. */
extern int malloc_set_state ();
-/* Non-zero if the MALLOC_CHECK_ enviroment variable was set while
+/* Non-zero if the MALLOC_CHECK_ environment variable was set while
dumping. Used to work around a bug in glibc's malloc. */
int malloc_using_checking;
#endif
int display_arg;
#endif
-#ifdef HAVE_NS
-extern char ns_no_defaults;
-#endif
-
/* An address near the bottom of the stack.
Tells GC how to save a copy of the stack. */
char *stack_bottom;
int noninteractive1;
+/* Nonzero means Emacs was run in --quick mode. */
+int inhibit_x_resources;
+
/* Name for the server started by the daemon.*/
static char *daemon_name;
Various environment variables and window system resources also affect\n\
Emacs' operation. See the main documentation.\n\
\n\
-Report bugs to %s. First, please see the Bugs\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
#endif /* DOUG_LEA_MALLOC */
-#define REPORT_EMACS_BUG_ADDRESS "bug-gnu-emacs@gnu.org"
-#define REPORT_EMACS_BUG_PRETEST_ADDRESS "emacs-pretest-bug@gnu.org"
-
-/* This function is used to determine an address to which bug report should
- be sent. */
-
-char *
-bug_reporting_address ()
-{
- int count = 0;
- Lisp_Object temp;
- char *string;
-
- temp = Fsymbol_value (intern ("emacs-version"));
-
- /* When `emacs-version' is invalid, use normal address. */
- if (!STRINGP(temp))
- return REPORT_EMACS_BUG_ADDRESS;
-
- string = SDATA (temp);
-
- /* Count dots in `emacs-version'. */
- while (*string)
- {
- if (*string == '.')
- count++;
- string++;
- }
-
- /* When `emacs-version' has at least three dots, it is development or
- pretest version of Emacs. */
- return count >= 3 ? REPORT_EMACS_BUG_PRETEST_ADDRESS : REPORT_EMACS_BUG_ADDRESS;
-}
-
-
/* ARGSUSED */
int
main (int argc, char **argv)
stack_base = &dummy;
#endif
+#if defined (USE_GTK) && defined (G_SLICE_ALWAYS_MALLOC)
+ /* This is used by the Cygwin build. */
+ setenv ("G_SLICE", "always-malloc", 1);
+#endif
+
if (!initialized)
{
extern char my_endbss[];
heap_bss_diff = (char *)my_heap_start - max (my_endbss, my_endbss_static);
}
-#ifdef LINUX_SBRK_BUG
- /* This is only used GNU/LINUX running on alpha when using libc5 */
- __sbrk (1);
-#endif
-
#ifdef RUN_TIME_REMAP
if (initialized)
run_time_remap (argv[0]);
&& initialized)
{
Lisp_Object tem, tem2;
- tem = Fsymbol_value (intern ("emacs-version"));
- tem2 = Fsymbol_value (intern ("emacs-copyright"));
+ tem = Fsymbol_value (intern_c_string ("emacs-version"));
+ tem2 = Fsymbol_value (intern_c_string ("emacs-copyright"));
if (!STRINGP (tem))
{
fprintf (stderr, "Invalid value of `emacs-version'\n");
#endif /* MSDOS || WINDOWSNT */
#ifdef MSDOS
-#if __DJGPP__ >= 2
if (!isatty (fileno (stdin)))
setmode (fileno (stdin), O_BINARY);
if (!isatty (fileno (stdout)))
fflush (stdout);
setmode (fileno (stdout), O_BINARY);
}
-#else /* not __DJGPP__ >= 2 */
- (stdin)->_flag &= ~_IOTEXT;
- (stdout)->_flag &= ~_IOTEXT;
- (stderr)->_flag &= ~_IOTEXT;
-#endif /* not __DJGPP__ >= 2 */
#endif /* MSDOS */
#ifdef SET_EMACS_PRIORITY
{
printf (USAGE1, argv[0], USAGE2);
printf (USAGE3);
- printf (USAGE4, bug_reporting_address ());
+ printf (USAGE4);
exit (0);
}
argv[skip_args] = fdStr;
execv (argv[0], argv);
- fprintf (stderr, "emacs daemon: exec failed: %d\t%d\n", errno);
+ fprintf (stderr, "emacs daemon: exec failed: %d\n", errno);
exit (1);
}
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 HAVE_WINDOW_SYSTEM
init_fringe_once (); /* Swap bitmaps if necessary. */
#endif /* HAVE_WINDOW_SYSTEM */
Lisp_Object old_log_max;
Lisp_Object symbol, tail;
- symbol = intern ("enable-multibyte-characters");
+ symbol = intern_c_string ("enable-multibyte-characters");
Fset_default (symbol, Qnil);
if (initialized)
ns_alloc_autorelease_pool();
if (!noninteractive)
{
- char *tmp;
- display_arg = 4;
- if (argmatch (argv, argc, "-q", "--no-init-file", 6, NULL, &skip_args))
- {
- ns_no_defaults = 1;
- skip_args--;
- }
- if (argmatch (argv, argc, "-Q", "--quick", 5, NULL, &skip_args))
- {
- ns_no_defaults = 1;
- skip_args--;
- }
#ifdef NS_IMPL_COCOA
if (skip_args < argc)
{
chdir (getenv ("HOME"));
}
}
-#endif
- /* This used for remote operation.. not fully implemented yet. */
- if (argmatch (argv, argc, "-_NSMachLaunch", 0, 3, &tmp, &skip_args))
- display_arg = 4;
- else if (argmatch (argv, argc, "-MachLaunch", 0, 3, &tmp, &skip_args))
- display_arg = 4;
- else if (argmatch (argv, argc, "-macosx", 0, 2, NULL, &skip_args))
- display_arg = 4;
- else if (argmatch (argv, argc, "-NSHost", 0, 3, &tmp, &skip_args))
- display_arg = 4;
+#endif /* COCOA */
}
#endif /* HAVE_NS */
syms_of_xfns ();
syms_of_xmenu ();
syms_of_fontset ();
+ syms_of_xsettings ();
#ifdef HAVE_X_SM
syms_of_xsmfns ();
#endif
#endif
init_window ();
init_font ();
-
+
if (!initialized)
{
char *file;
/* Handle -l loadup, args passed by Makefile. */
if (argmatch (argv, argc, "-l", "--load", 3, &file, &skip_args))
- Vtop_level = Fcons (intern ("load"),
+ Vtop_level = Fcons (intern_c_string ("load"),
Fcons (build_string (file), Qnil));
/* Unless next switch is -nl, load "loadup.el" first thing. */
if (! no_loadup)
- Vtop_level = Fcons (intern ("load"),
+ Vtop_level = Fcons (intern_c_string ("load"),
Fcons (build_string ("loadup.el"), Qnil));
}
struct standard_args
{
- char *name;
- char *longname;
+ const char *name;
+ const char *longname;
int priority;
int nargs;
};
-struct standard_args standard_args[] =
+const struct standard_args standard_args[] =
{
{ "-version", "--version", 150, 0 },
-#ifdef HAVE_SHM
- { "-nl", "--no-shared-memory", 140, 0 },
-#endif
{ "-t", "--terminal", 120, 1 },
{ "-nw", "--no-window-system", 110, 0 },
{ "-nw", "--no-windows", 110, 0 },
/* -d must come last before the options handled in startup.el. */
{ "-d", "--display", 60, 1 },
{ "-display", 0, 60, 1 },
- /* Now for the options handled in startup.el. */
+ /* Now for the options handled in `command-line' (startup.el). */
{ "-Q", "--quick", 55, 0 },
{ "-quick", 0, 55, 0 },
{ "-q", "--no-init-file", 50, 0 },
{ "-u", "--user", 30, 1 },
{ "-user", 0, 30, 1 },
{ "-debug-init", "--debug-init", 20, 0 },
- { "-nbi", "--no-bitmap-icon", 15, 0 },
{ "-iconic", "--iconic", 15, 0 },
{ "-D", "--basic-display", 12, 0},
{ "-basic-display", 0, 12, 0},
+ { "-nbc", "--no-blinking-cursor", 12, 0 },
+ /* Now for the options handled in `command-line-1' (startup.el). */
+ { "-nbi", "--no-bitmap-icon", 10, 0 },
{ "-bg", "--background-color", 10, 1 },
{ "-background", 0, 10, 1 },
{ "-fg", "--foreground-color", 10, 1 },
{ "-ib", "--internal-border", 10, 1 },
{ "-ms", "--mouse-color", 10, 1 },
{ "-cr", "--cursor-color", 10, 1 },
- { "-nbc", "--no-blinking-cursor", 10, 0 },
{ "-fn", "--font", 10, 1 },
{ "-font", 0, 10, 1 },
{ "-fs", "--fullscreen", 10, 0 },
\f
#ifndef CANNOT_DUMP
-#ifdef HAVE_SHM
-
-DEFUN ("dump-emacs-data", Fdump_emacs_data, Sdump_emacs_data, 1, 1, 0,
- doc: /* Dump current state of Emacs into data file FILENAME.
-This function exists on systems that use HAVE_SHM. */)
- (filename)
- Lisp_Object filename;
-{
- extern char my_edata[];
- Lisp_Object tem;
-
- check_pure_size ();
- CHECK_STRING (filename);
- filename = Fexpand_file_name (filename, Qnil);
-
- tem = Vpurify_flag;
- Vpurify_flag = Qnil;
-
- fflush (stdout);
- /* Tell malloc where start of impure now is. */
- /* Also arrange for warnings when nearly out of space. */
-#ifndef SYSTEM_MALLOC
- memory_warnings (my_edata, malloc_warning);
-#endif
- map_out_data (SDATA (filename));
-
- Vpurify_flag = tem;
-
- return Qnil;
-}
-
-#else /* not HAVE_SHM */
-
DEFUN ("dump-emacs", Fdump_emacs, Sdump_emacs, 2, 2, 0,
doc: /* Dump current state of Emacs into executable file FILENAME.
Take symbols from SYMFILE (presumably the file you executed to run Emacs).
return unbind_to (count, Qnil);
}
-#endif /* not HAVE_SHM */
-
#endif /* not CANNOT_DUMP */
\f
#if HAVE_SETLOCALE
void
syms_of_emacs ()
{
- Qfile_name_handler_alist = intern ("file-name-handler-alist");
+ Qfile_name_handler_alist = intern_c_string ("file-name-handler-alist");
staticpro (&Qfile_name_handler_alist);
#ifndef CANNOT_DUMP
-#ifdef HAVE_SHM
- defsubr (&Sdump_emacs_data);
-#else
defsubr (&Sdump_emacs);
-#endif
#endif
defsubr (&Skill_emacs);
`cygwin' compiled using the Cygwin library.
Anything else (in Emacs 23.1, the possibilities are: aix, berkeley-unix,
hpux, irix, lynxos 3.0.1, usg-unix-v) indicates some sort of Unix system. */);
- Vsystem_type = intern (SYSTEM_TYPE);
+ Vsystem_type = intern_c_string (SYSTEM_TYPE);
DEFVAR_LISP ("system-configuration", &Vsystem_configuration,
doc: /* Value is string indicating configuration Emacs was built for.
This is nil during initialization. */);
Vafter_init_time = Qnil;
+ DEFVAR_BOOL ("inhibit-x-resources", &inhibit_x_resources,
+ doc: /* If non-nil, X resources, Windows Registry settings, and NS defaults are not used. */);
+ inhibit_x_resources = 0;
+
/* Make sure IS_DAEMON starts up as false. */
daemon_pipe[1] = 0;
}