static const char emacs_version[] = VERSION;
static const char emacs_copyright[] = "Copyright (C) 2012 Free Software Foundation, Inc.";
-/* Make these values available in GDB, which doesn't see macros. */
-
-#if USE_LSB_TAG
-int gdb_use_lsb EXTERNALLY_VISIBLE = 1;
-#else
-int gdb_use_lsb EXTERNALLY_VISIBLE = 0;
-#endif
-#ifndef CHECK_LISP_OBJECT_TYPE
-int gdb_use_struct EXTERNALLY_VISIBLE = 0;
-#else
-int gdb_use_struct EXTERNALLY_VISIBLE = 1;
-#endif
-int gdb_valbits EXTERNALLY_VISIBLE = VALBITS;
-int gdb_gctypebits EXTERNALLY_VISIBLE = GCTYPEBITS;
-#if defined DATA_SEG_BITS && !USE_LSB_TAG
-uintptr_t gdb_data_seg_bits EXTERNALLY_VISIBLE = DATA_SEG_BITS;
-#else
-uintptr_t gdb_data_seg_bits EXTERNALLY_VISIBLE = 0;
-#endif
-ptrdiff_t PVEC_FLAG EXTERNALLY_VISIBLE = PSEUDOVECTOR_FLAG;
-ptrdiff_t gdb_array_mark_flag EXTERNALLY_VISIBLE = 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 const gdb_pvec_type EXTERNALLY_VISIBLE = 0;
-
/* Empty lisp strings. To avoid having to build any others. */
Lisp_Object empty_unibyte_string, empty_multibyte_string;
/* Nonzero if handling a fatal error already. */
int fatal_error_in_progress;
-/* If non-null, call this function from fatal_error_signal before
- committing suicide. */
-
-static void (*fatal_error_signal_hook) (void);
-
#ifdef FORWARD_SIGNAL_TO_MAIN_THREAD
/* When compiled with GTK and running under Gnome,
multiple threads may be created. Keep track of our main
sigunblock (sigmask (fatal_error_code));
#endif
- if (fatal_error_signal_hook)
- fatal_error_signal_hook ();
-
kill (getpid (), fatal_error_code);
}
if (!NILP (Vinvocation_directory))
{
dir = Vinvocation_directory;
+#ifdef WINDOWSNT
+ /* If we are running from the build directory, set DIR to the
+ src subdirectory of the Emacs tree, like on Posix
+ platforms. */
+ if (SBYTES (dir) > sizeof ("/i386/") - 1
+ && 0 == strcmp (SSDATA (dir) + SBYTES (dir) - sizeof ("/i386/") + 1,
+ "/i386/"))
+ dir = Fexpand_file_name (build_string ("../.."), dir);
+#else /* !WINDOWSNT */
+#endif
name = Fexpand_file_name (Vinvocation_name, dir);
while (1)
{
static void
malloc_initialize_hook (void)
{
-#ifndef USE_CRT_DLL
- extern char **environ;
-#endif
-
if (initialized)
{
if (!malloc_using_checking)
init_alloc_once ();
init_obarray ();
init_eval_once ();
- init_character_once ();
init_charset_once ();
init_coding_once ();
init_syntax_once (); /* Create standard syntax table. */
init_eval ();
init_data ();
-#ifdef CLASH_DETECTION
- init_filelock ();
-#endif
init_atimer ();
running_asynch_code = 0;
init_callproc (); /* Must follow init_cmdargs but not init_sys_modes. */
init_lread ();
+#ifdef WINDOWSNT
+ /* Check to see if Emacs has been installed correctly. */
+ check_windows_init_file ();
+#endif
/* Intern the names of all standard functions and variables;
define standard keys. */
init_keyboard (); /* This too must precede init_sys_modes. */
if (!noninteractive)
init_display (); /* Determine terminal type. Calls init_sys_modes. */
- init_fns ();
init_xdisp ();
#ifdef HAVE_WINDOW_SYSTEM
init_fringe ();
- init_image ();
#endif /* HAVE_WINDOW_SYSTEM */
init_macros ();
init_floatfns ();
-#ifdef HAVE_SOUND
- init_sound ();
-#endif
init_window ();
init_font ();
}
#endif /* HAVE_SETLOCALE */
\f
-#ifndef SEPCHAR
-#define SEPCHAR ':'
-#endif
Lisp_Object
decode_env_path (const char *evarname, const char *defalt)
{
const char *path, *p;
Lisp_Object lpath, element, tem;
+#ifdef WINDOWSNT
+ int defaulted = 0;
+ const char *emacs_dir = egetenv ("emacs_dir");
+ static const char *emacs_dir_env = "%emacs_dir%/";
+ const size_t emacs_dir_len = strlen (emacs_dir_env);
+#endif
/* It's okay to use getenv here, because this function is only used
to initialize variables when Emacs starts up, and isn't called
else
path = 0;
if (!path)
- path = defalt;
+ {
+ path = defalt;
+#ifdef WINDOWSNT
+ defaulted = 1;
+#endif
+ }
#ifdef DOS_NT
/* Ensure values from the environment use the proper directory separator. */
if (path)
p = path + strlen (path);
element = (p - path ? make_string (path, p - path)
: build_string ("."));
+#ifdef WINDOWSNT
+ /* Relative file names in the default path are interpreted as
+ being relative to $emacs_dir. */
+ if (emacs_dir && defaulted
+ && strncmp (path, emacs_dir_env, emacs_dir_len) == 0)
+ element = Fexpand_file_name (Fsubstring (element,
+ make_number (emacs_dir_len),
+ Qnil),
+ build_string (emacs_dir));
+#endif
/* Add /: to the front of the name
if it would otherwise be treated as magic. */
Anything else (in Emacs 24.1, the possibilities are: aix, berkeley-unix,
hpux, irix, usg-unix-v) indicates some sort of Unix system. */);
Vsystem_type = intern_c_string (SYSTEM_TYPE);
- /* The above values are from SYSTEM_TYPE in include files under src/s. */
+ /* See configure.ac (and config.nt) for the possible SYSTEM_TYPEs. */
DEFVAR_LISP ("system-configuration", Vsystem_configuration,
doc: /* Value is string indicating configuration Emacs was built for.
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 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,