Use SSDATA when the context wants char *.
[bpt/emacs.git] / src / emacs.c
index 1cdf603..e696c82 100644 (file)
@@ -1,7 +1,7 @@
 /* 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,
-                 2010  Free Software Foundation, Inc.
+
+Copyright (C) 1985-1987, 1993-1995, 1997-1999, 2001-2011
+  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -27,14 +27,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <sys/types.h>
 #include <sys/file.h>
 #include <setjmp.h>
-
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
-
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
 
 #ifdef WINDOWSNT
 #include <fcntl.h>
@@ -63,6 +56,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "keyboard.h"
 #include "keymap.h"
 
+#ifdef HAVE_GNUTLS
+#include "gnutls.h"
+#endif
+
 #ifdef HAVE_NS
 #include "nsterm.h"
 #endif
@@ -91,60 +88,39 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #endif
 #endif
 
-static const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc.";
+/* If you change the following line, remember to update
+   msdos/mainmake.v2 which gleans the Emacs version from it!  */
 static const char emacs_version[] = "24.0.50";
+static const char emacs_copyright[] = "Copyright (C) 2011 Free Software Foundation, Inc.";
 
 /* Make these values available in GDB, which doesn't see macros.  */
 
 #ifdef USE_LSB_TAG
-int gdb_use_lsb = 1;
+int gdb_use_lsb EXTERNALLY_VISIBLE = 1;
 #else
-int gdb_use_lsb = 0;
+int gdb_use_lsb EXTERNALLY_VISIBLE = 0;
 #endif
 #ifndef USE_LISP_UNION_TYPE
-int gdb_use_union = 0;
+int gdb_use_union EXTERNALLY_VISIBLE  = 0;
 #else
-int gdb_use_union = 1;
+int gdb_use_union EXTERNALLY_VISIBLE = 1;
 #endif
-EMACS_INT gdb_valbits = VALBITS;
-EMACS_INT gdb_gctypebits = GCTYPEBITS;
+EMACS_INT gdb_valbits EXTERNALLY_VISIBLE = VALBITS;
+EMACS_INT gdb_gctypebits EXTERNALLY_VISIBLE = GCTYPEBITS;
 #if defined (DATA_SEG_BITS) && ! defined (USE_LSB_TAG)
-EMACS_INT gdb_data_seg_bits = DATA_SEG_BITS;
+EMACS_INT gdb_data_seg_bits EXTERNALLY_VISIBLE = DATA_SEG_BITS;
 #else
-EMACS_INT gdb_data_seg_bits = 0;
+EMACS_INT gdb_data_seg_bits EXTERNALLY_VISIBLE = 0;
 #endif
-EMACS_INT PVEC_FLAG = PSEUDOVECTOR_FLAG;
-EMACS_INT gdb_array_mark_flag = ARRAY_MARK_FLAG;
+EMACS_INT PVEC_FLAG EXTERNALLY_VISIBLE = PSEUDOVECTOR_FLAG;
+EMACS_INT 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 gdb_pvec_type = PVEC_TYPE_MASK;
-
-/* Command line args from shell, as list of strings.  */
-Lisp_Object Vcommand_line_args;
-
-/* The name under which Emacs was invoked, with any leading directory
-   names discarded.  */
-Lisp_Object Vinvocation_name;
-
-/* The directory name from which Emacs was invoked.  */
-Lisp_Object Vinvocation_directory;
-
-/* The directory name in which to find subdirs such as lisp and etc.
-   nil means get them only from PATH_LOADSEARCH.  */
-Lisp_Object Vinstallation_directory;
-
-/* The values of `current-time' before and after Emacs initialization.  */
-Lisp_Object Vbefore_init_time, Vafter_init_time;
-
-/* Hook run by `kill-emacs' before it does really anything.  */
-Lisp_Object Vkill_emacs_hook;
+enum pvec_type gdb_pvec_type EXTERNALLY_VISIBLE = PVEC_TYPE_MASK;
 
 /* Empty lisp strings.  To avoid having to build any others.  */
 Lisp_Object empty_unibyte_string, empty_multibyte_string;
 
-/* Search path separator.  */
-Lisp_Object Vpath_separator;
-
 /* Set nonzero after Emacs has started up the first time.
   Prevents reinitialization of the Lisp world and keymaps
   on subsequent starts.  */
@@ -163,37 +139,14 @@ extern int malloc_set_state (void*);
 int malloc_using_checking;
 #endif
 
-/* Variable whose value is symbol giving operating system type.  */
-Lisp_Object Vsystem_type;
-
-/* Variable whose value is string giving configuration built for.  */
-Lisp_Object Vsystem_configuration;
-
-/* Variable whose value is string giving configuration options,
-   for use when reporting bugs.  */
-Lisp_Object Vsystem_configuration_options;
-
 Lisp_Object Qfile_name_handler_alist;
 
-/* Current and previous system locales for messages and time.  */
-Lisp_Object Vsystem_messages_locale;
-Lisp_Object Vprevious_system_messages_locale;
-Lisp_Object Vsystem_time_locale;
-Lisp_Object Vprevious_system_time_locale;
-
-/* Copyright and version info.  The version number may be updated by
-   Lisp code.  */
-Lisp_Object Vemacs_copyright, Vemacs_version;
+Lisp_Object Qrisky_local_variable;
 
 /* If non-zero, emacs should not attempt to use a window-specific code,
    but instead should use the virtual terminal under which it was started.  */
 int inhibit_window_system;
 
-/* If nonzero, set Emacs to run at this priority.  This is also used
-   in child_setup and sys_suspend to make sure subshells run at normal
-   priority; those functions have their own extern declaration.  */
-EMACS_INT emacs_priority;
-
 /* If non-zero, a filter or a sentinel is running.  Tested to save the match
    data on the first attempt to change it inside asynchronous code.  */
 int running_asynch_code;
@@ -221,14 +174,8 @@ static unsigned long heap_bss_diff;
 
 int noninteractive;
 
-/* Value of Lisp variable `noninteractive'.
-   Normally same as C variable `noninteractive'
-   but nothing terrible happens if user sets this one.  */
-
-int noninteractive1;
-
-/* Nonzero means Emacs was run in --quick mode.  */
-int inhibit_x_resources;
+/* Nonzero means remove site-lisp directories from load-path.  */
+int no_site_lisp;
 
 /* Name for the server started by the daemon.*/
 static char *daemon_name;
@@ -267,9 +214,11 @@ Initialization options:\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-site-lisp, -nsl        do not add site-lisp directories to load-path\n\
 --no-splash                 do not display a splash screen on startup\n\
 --no-window-system, -nw     do not communicate with X, ignoring $DISPLAY\n\
---quick, -Q                 equivalent to -q --no-site-file --no-splash\n\
+--quick, -Q                 equivalent to:\n\
+                              -q --no-site-file --no-site-lisp --no-splash\n\
 --script FILE               run FILE as an Emacs Lisp script\n\
 --terminal, -t DEVICE       use DEVICE for terminal I/O\n\
 --user, -u USER             load ~USER/.emacs instead of your own\n\
@@ -376,7 +325,7 @@ fatal_error_signal (int sig)
     {
       fatal_error_in_progress = 1;
 
-      if (sig == SIGTERM || sig == SIGHUP)
+      if (sig == SIGTERM || sig == SIGHUP || sig == SIGINT)
         Fkill_emacs (make_number (sig));
 
       shut_down_emacs (sig, 0, Qnil);
@@ -629,7 +578,7 @@ void __main (void)
    enough information to do it right.  */
 
 static int
-argmatch (char **argv, int argc, char *sstr, char *lstr, int minlen, char **valptr, int *skipptr)
+argmatch (char **argv, int argc, const char *sstr, const char *lstr, int minlen, char **valptr, int *skipptr)
 {
   char *p = NULL;
   int arglen;
@@ -806,8 +755,8 @@ main (int argc, char **argv)
            }
          else
            {
-             version = SDATA (tem);
-             copyright = SDATA (tem2);
+             version = SSDATA (tem);
+             copyright = SSDATA (tem2);
            }
        }
       else
@@ -824,13 +773,14 @@ main (int argc, char **argv)
       printf ("see the file named COPYING.\n");
       exit (0);
     }
-  if (argmatch (argv, argc, "-chdir", "--chdir", 2, &ch_to_dir, &skip_args))
-      if (chdir (ch_to_dir) == -1)
-        {
-          fprintf (stderr, "%s: Can't chdir to %s: %s\n",
-                   argv[0], ch_to_dir, strerror (errno));
-          exit (1);
-        }
+
+  if (argmatch (argv, argc, "-chdir", "--chdir", 4, &ch_to_dir, &skip_args))
+    if (chdir (ch_to_dir) == -1)
+      {
+       fprintf (stderr, "%s: Can't chdir to %s: %s\n",
+                argv[0], ch_to_dir, strerror (errno));
+       exit (1);
+      }
 
 
 #ifdef HAVE_PERSONALITY_LINUX32
@@ -839,8 +789,9 @@ main (int argc, char **argv)
           || strcmp (argv[argc-1], "bootstrap") == 0)
       && ! getenv ("EMACS_HEAP_EXEC"))
     {
+      static char heapexec[] = "EMACS_HEAP_EXEC=true";
       /* Set this so we only do this once.  */
-      putenv("EMACS_HEAP_EXEC=true");
+      putenv(heapexec);
 
       /* A flag to turn off address randomization which is introduced
          in linux kernel shipped with fedora core 4 */
@@ -960,13 +911,12 @@ main (int argc, char **argv)
          emacs_close (0);
          emacs_close (1);
          result = emacs_open (term, O_RDWR, 0);
-         if (result < 0)
+         if (result < 0 || dup (0) < 0)
            {
              char *errstring = strerror (errno);
              fprintf (stderr, "%s: %s: %s\n", argv[0], term, errstring);
              exit (1);
            }
-         dup (0);
          if (! isatty (0))
            {
              fprintf (stderr, "%s: %s: not a tty\n", argv[0], term);
@@ -1237,6 +1187,12 @@ main (int argc, char **argv)
 #ifdef SIGSYS
       signal (SIGSYS, fatal_error_signal);
 #endif
+      /*  May need special treatment on MS-Windows. See
+          http://lists.gnu.org/archive/html/emacs-devel/2010-09/msg01062.html
+          Please update the doc of kill-emacs, kill-emacs-hook, and
+          NEWS if you change this.
+      */
+      if (noninteractive) signal (SIGINT, fatal_error_signal);
       signal (SIGTERM, fatal_error_signal);
 #ifdef SIGXCPU
       signal (SIGXCPU, fatal_error_signal);
@@ -1329,71 +1285,12 @@ main (int argc, char **argv)
   init_atimer ();
   running_asynch_code = 0;
 
-  /* Handle --unibyte and the EMACS_UNIBYTE envvar,
-     but not while dumping.  */
-  if (1)
-    {
-      int inhibit_unibyte = 0;
-
-      /* --multibyte overrides EMACS_UNIBYTE.  */
-      if (argmatch (argv, argc, "-no-unibyte", "--no-unibyte", 4, NULL, &skip_args)
-         || argmatch (argv, argc, "-multibyte", "--multibyte", 4, NULL, &skip_args)
-         /* Ignore EMACS_UNIBYTE before dumping.  */
-         || (!initialized && noninteractive))
-       inhibit_unibyte = 1;
-
-      /* --unibyte requests that we set up to do everything with single-byte
-        buffers and strings.  We need to handle this before calling
-        init_lread, init_editfns and other places that generate Lisp strings
-        from text in the environment.  */
-      /* Actually this shouldn't be needed as of 20.4 in a generally
-        unibyte environment.  As handa says, environment values
-        aren't now decoded; also existing buffers are now made
-        unibyte during startup if .emacs sets unibyte.  Tested with
-        8-bit data in environment variables and /etc/passwd, setting
-        unibyte and Latin-1 in .emacs. -- Dave Love  */
-      if (argmatch (argv, argc, "-unibyte", "--unibyte", 4, NULL, &skip_args)
-         || argmatch (argv, argc, "-no-multibyte", "--no-multibyte", 4, NULL, &skip_args)
-         || (getenv ("EMACS_UNIBYTE") && !inhibit_unibyte))
-       {
-         Lisp_Object old_log_max;
-         Lisp_Object symbol, tail;
-
-         symbol = intern_c_string ("enable-multibyte-characters");
-         Fset_default (symbol, Qnil);
-
-         if (initialized)
-           {
-             /* Erase pre-dump messages in *Messages* now so no abort.  */
-             old_log_max = Vmessage_log_max;
-             XSETFASTINT (Vmessage_log_max, 0);
-             message_dolog ("", 0, 1, 0);
-             Vmessage_log_max = old_log_max;
-           }
-
-         for (tail = Vbuffer_alist; CONSP (tail);
-              tail = XCDR (tail))
-           {
-             Lisp_Object buffer;
-
-             buffer = Fcdr (XCAR (tail));
-             /* Make a multibyte buffer unibyte.  */
-             if (BUF_Z_BYTE (XBUFFER (buffer)) > BUF_Z (XBUFFER (buffer)))
-               {
-                 struct buffer *current = current_buffer;
-
-                 set_buffer_temp (XBUFFER (buffer));
-                 Fset_buffer_multibyte (Qnil);
-                 set_buffer_temp (current);
-               }
-           }
-         message ("Warning: unibyte sessions are obsolete and will disappear");
-       }
-    }
-
   no_loadup
     = argmatch (argv, argc, "-nl", "--no-loadup", 6, NULL, &skip_args);
 
+  no_site_lisp
+    = argmatch (argv, argc, "-nsl", "--no-site-lisp", 11, NULL, &skip_args);
+
 #ifdef HAVE_NS
   ns_alloc_autorelease_pool();
   if (!noninteractive)
@@ -1462,9 +1359,27 @@ main (int argc, char **argv)
             && argv[count_before + 1][1] == '-')
       argv[count_before + 1] = "-d";
 
+    if (! no_site_lisp)
+      {
+        if (argmatch (argv, argc, "-Q", "--quick", 3, NULL, &skip_args)
+            || argmatch (argv, argc, "-quick", 0, 2, NULL, &skip_args))
+          no_site_lisp = 1;
+      }
+
     /* Don't actually discard this arg.  */
     skip_args = count_before;
   }
+#else  /* !HAVE_X_WINDOWS */
+  if (! no_site_lisp)
+  {
+    int count_before = skip_args;
+
+    if (argmatch (argv, argc, "-Q", "--quick", 3, NULL, &skip_args)
+        || argmatch (argv, argc, "-quick", 0, 2, NULL, &skip_args))
+      no_site_lisp = 1;
+
+    skip_args = count_before;
+  }
 #endif
 
   /* argmatch must not be used after here,
@@ -1558,9 +1473,7 @@ main (int argc, char **argv)
       syms_of_doc ();
       syms_of_editfns ();
       syms_of_emacs ();
-#ifdef CLASH_DETECTION
       syms_of_filelock ();
-#endif /* CLASH_DETECTION */
       syms_of_indent ();
       syms_of_insdel ();
       /* syms_of_keymap (); */
@@ -1603,6 +1516,10 @@ main (int argc, char **argv)
 #endif
 #endif /* HAVE_X_WINDOWS */
 
+#ifdef HAVE_LIBXML2
+      syms_of_xml ();
+#endif
+
       syms_of_menu ();
 
 #ifdef HAVE_NTGUI
@@ -1628,6 +1545,10 @@ main (int argc, char **argv)
       syms_of_fontset ();
 #endif /* HAVE_NS */
 
+#ifdef HAVE_GNUTLS
+      syms_of_gnutls ();
+#endif
+
 #ifdef HAVE_DBUS
       syms_of_dbusbind ();
 #endif /* HAVE_DBUS */
@@ -1789,15 +1710,13 @@ const struct standard_args standard_args[] =
   { "-script", "--script", 100, 1 },
   { "-daemon", "--daemon", 99, 0 },
   { "-help", "--help", 90, 0 },
-  { "-no-unibyte", "--no-unibyte", 83, 0 },
-  { "-multibyte", "--multibyte", 82, 0 },
-  { "-unibyte", "--unibyte", 81, 0 },
-  { "-no-multibyte", "--no-multibyte", 80, 0 },
   { "-nl", "--no-loadup", 70, 0 },
+  { "-nsl", "--no-site-lisp", 65, 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 `command-line' (startup.el).  */
+  /* (Note that to imply -nsl, -Q is partially handled here.)  */
   { "-Q", "--quick", 55, 0 },
   { "-quick", 0, 55, 0 },
   { "-q", "--no-init-file", 50, 0 },
@@ -2043,6 +1962,9 @@ DEFUN ("kill-emacs", Fkill_emacs, Skill_emacs, 0, 1, "P",
 If ARG is an integer, return ARG as the exit program code.
 If ARG is a string, stuff it as keyboard input.
 
+This function is called upon receipt of the signals SIGTERM
+or SIGHUP, and upon SIGINT in batch mode.
+
 The value of `kill-emacs-hook', if not void,
 is a list of functions (of no args),
 all of which are called before Emacs is actually killed.  */)
@@ -2055,7 +1977,7 @@ all of which are called before Emacs is actually killed.  */)
   if (feof (stdin))
     arg = Qt;
 
-  if (!NILP (Vrun_hooks) && !noninteractive)
+  if (!NILP (Vrun_hooks))
     call1 (Vrun_hooks, intern ("kill-emacs-hook"));
 
   UNGCPRO;
@@ -2066,7 +1988,7 @@ all of which are called before Emacs is actually killed.  */)
      kill it because we are exiting Emacs deliberately (not crashing).
      Do it after shut_down_emacs, which does an auto-save.  */
   if (STRINGP (Vauto_save_list_file_name))
-    unlink (SDATA (Vauto_save_list_file_name));
+    unlink (SSDATA (Vauto_save_list_file_name));
 
   exit (INTEGERP (arg) ? XINT (arg) : EXIT_SUCCESS);
 }
@@ -2093,13 +2015,11 @@ shut_down_emacs (int sig, int no_x, Lisp_Object stuff)
   Vinhibit_redisplay = Qt;
 
   /* If we are controlling the terminal, reset terminal modes.  */
-#ifdef EMACS_HAVE_TTY_PGRP
+#ifndef DOS_NT
   {
     int pgrp = EMACS_GETPGRP (0);
-
-    int tpgrp;
-    if (EMACS_GET_TTY_PGRP (0, &tpgrp) != -1
-       && tpgrp == pgrp)
+    int tpgrp = tcgetpgrp (0);
+    if ((tpgrp != -1) && tpgrp == pgrp)
       {
        reset_all_sys_modes ();
        if (sig && sig != SIGTERM)
@@ -2164,6 +2084,10 @@ shut_down_emacs (int sig, int no_x, Lisp_Object stuff)
 \f
 #ifndef CANNOT_DUMP
 
+/* FIXME: maybe this should go into header file, config.h seems the
+   only one appropriate. */
+extern int unexec (const char *, const char *);
+
 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).
@@ -2231,13 +2155,13 @@ You must run Emacs in batch mode in order to dump it.  */)
      Meanwhile, my_edata is not valid on Windows.  */
   memory_warnings (my_edata, malloc_warning);
 #endif /* not WINDOWSNT */
-#endif
-#if !defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) && !defined SYNC_INPUT
+#if defined (HAVE_GTK_AND_PTHREAD) && !defined SYNC_INPUT
   /* Pthread may call malloc before main, and then we will get an endless
      loop, because pthread_self (see alloc.c) calls malloc the first time
      it is called on some systems.  */
   reset_malloc_hooks ();
 #endif
+#endif /* not SYSTEM_MALLOC */
 #ifdef DOUG_LEA_MALLOC
   malloc_state_ptr = malloc_get_state ();
 #endif
@@ -2245,8 +2169,7 @@ You must run Emacs in batch mode in order to dump it.  */)
 #ifdef USE_MMAP_FOR_BUFFERS
   mmap_set_vars (0);
 #endif
-  unexec (SDATA (filename),
-         !NILP (symfile) ? SDATA (symfile) : 0, my_edata, 0, 0);
+  unexec (SSDATA (filename), !NILP (symfile) ? SSDATA (symfile) : 0);
 #ifdef USE_MMAP_FOR_BUFFERS
   mmap_set_vars (1);
 #endif
@@ -2280,7 +2203,7 @@ synchronize_locale (int category, Lisp_Object *plocale, Lisp_Object desired_loca
     {
       *plocale = desired_locale;
       setlocale (category, (STRINGP (desired_locale)
-                           ? (char *) SDATA (desired_locale)
+                           ? SSDATA (desired_locale)
                            : ""));
     }
 }
@@ -2426,6 +2349,8 @@ syms_of_emacs (void)
 {
   Qfile_name_handler_alist = intern_c_string ("file-name-handler-alist");
   staticpro (&Qfile_name_handler_alist);
+  Qrisky_local_variable = intern_c_string ("risky-local-variable");
+  staticpro (&Qrisky_local_variable);
 
 #ifndef CANNOT_DUMP
   defsubr (&Sdump_emacs);
@@ -2438,11 +2363,11 @@ syms_of_emacs (void)
   defsubr (&Sdaemonp);
   defsubr (&Sdaemon_initialized);
 
-  DEFVAR_LISP ("command-line-args", &Vcommand_line_args,
+  DEFVAR_LISP ("command-line-args", Vcommand_line_args,
               doc: /* Args passed by shell to Emacs, as a list of strings.
 Many arguments are deleted from the list as they are processed.  */);
 
-  DEFVAR_LISP ("system-type", &Vsystem_type,
+  DEFVAR_LISP ("system-type", Vsystem_type,
               doc: /* The value is a symbol indicating the type of operating system you are using.
 Special values:
   `gnu'          compiled for a GNU Hurd system.
@@ -2452,43 +2377,36 @@ Special values:
   `ms-dos'       compiled as an MS-DOS application.
   `windows-nt'   compiled as a native W32 application.
   `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.  */);
+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);
+  /* Above values are from SYSTEM_TYPE in src/s/*.h.  */
 
-  DEFVAR_LISP ("system-configuration", &Vsystem_configuration,
+  DEFVAR_LISP ("system-configuration", Vsystem_configuration,
               doc: /* Value is string indicating configuration Emacs was built for.
 On MS-Windows, the value reflects the OS flavor and version on which
 Emacs is running.  */);
   Vsystem_configuration = build_string (EMACS_CONFIGURATION);
 
-  DEFVAR_LISP ("system-configuration-options", &Vsystem_configuration_options,
+  DEFVAR_LISP ("system-configuration-options", Vsystem_configuration_options,
               doc: /* String containing the configuration options Emacs was built with.  */);
   Vsystem_configuration_options = build_string (EMACS_CONFIG_OPTIONS);
 
-  DEFVAR_BOOL ("noninteractive", &noninteractive1,
+  DEFVAR_BOOL ("noninteractive", noninteractive1,
               doc: /* Non-nil means Emacs is running without interactive terminal.  */);
 
-  DEFVAR_LISP ("kill-emacs-hook", &Vkill_emacs_hook,
+  DEFVAR_LISP ("kill-emacs-hook", Vkill_emacs_hook,
               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,
 see `kill-emacs-query-functions' instead.
 
-The hook is not run in batch mode, i.e., if `noninteractive' is non-nil.  */);
+Before Emacs 24.1, the hook was not run in batch mode, i.e., if
+`noninteractive' was non-nil.  */);
   Vkill_emacs_hook = Qnil;
 
-  DEFVAR_INT ("emacs-priority", &emacs_priority,
-             doc: /* Priority for Emacs to run at.
-This value is effective only if set before Emacs is dumped,
-and only if the Emacs executable is installed with setuid to permit
-it to change priority.  (Emacs sets its uid back to the real uid.)
-Currently, you need to define SET_EMACS_PRIORITY in `config.h'
-before you compile Emacs, to enable the code for this feature.  */);
-  emacs_priority = 0;
-
-  DEFVAR_LISP ("path-separator", &Vpath_separator,
+  DEFVAR_LISP ("path-separator", Vpath_separator,
               doc: /* String containing the character that separates directories in
 search paths, such as PATH and other similar environment variables.  */);
   {
@@ -2496,62 +2414,77 @@ search paths, such as PATH and other similar environment variables.  */);
     Vpath_separator = make_string (&c, 1);
   }
 
-  DEFVAR_LISP ("invocation-name", &Vinvocation_name,
+  DEFVAR_LISP ("invocation-name", Vinvocation_name,
               doc: /* The program name that was used to run Emacs.
 Any directory names are omitted.  */);
 
-  DEFVAR_LISP ("invocation-directory", &Vinvocation_directory,
+  DEFVAR_LISP ("invocation-directory", Vinvocation_directory,
               doc: /* The directory in which the Emacs executable was found, to run it.
 The value is nil if that directory's name is not known.  */);
 
-  DEFVAR_LISP ("installation-directory", &Vinstallation_directory,
+  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.  */);
   Vinstallation_directory = Qnil;
 
-  DEFVAR_LISP ("system-messages-locale", &Vsystem_messages_locale,
+  DEFVAR_LISP ("system-messages-locale", Vsystem_messages_locale,
               doc: /* System locale for messages.  */);
   Vsystem_messages_locale = Qnil;
 
   DEFVAR_LISP ("previous-system-messages-locale",
-              &Vprevious_system_messages_locale,
+              Vprevious_system_messages_locale,
               doc: /* Most recently used system locale for messages.  */);
   Vprevious_system_messages_locale = Qnil;
 
-  DEFVAR_LISP ("system-time-locale", &Vsystem_time_locale,
+  DEFVAR_LISP ("system-time-locale", Vsystem_time_locale,
               doc: /* System locale for time.  */);
   Vsystem_time_locale = Qnil;
 
-  DEFVAR_LISP ("previous-system-time-locale", &Vprevious_system_time_locale,
+  DEFVAR_LISP ("previous-system-time-locale", Vprevious_system_time_locale,
               doc: /* Most recently used system locale for time.  */);
   Vprevious_system_time_locale = Qnil;
 
-  DEFVAR_LISP ("before-init-time", &Vbefore_init_time,
+  DEFVAR_LISP ("before-init-time", Vbefore_init_time,
               doc: /* Value of `current-time' before Emacs begins initialization.  */);
   Vbefore_init_time = Qnil;
 
-  DEFVAR_LISP ("after-init-time", &Vafter_init_time,
+  DEFVAR_LISP ("after-init-time", Vafter_init_time,
               doc: /* Value of `current-time' after loading the init files.
 This is nil during initialization.  */);
   Vafter_init_time = Qnil;
 
-  DEFVAR_BOOL ("inhibit-x-resources", &inhibit_x_resources,
+  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;
 
-  DEFVAR_LISP ("emacs-copyright", &Vemacs_copyright,
+  DEFVAR_LISP ("emacs-copyright", Vemacs_copyright,
               doc: /* Short copyright string for this version of Emacs.  */);
   Vemacs_copyright = build_string (emacs_copyright);
 
-  DEFVAR_LISP ("emacs-version", &Vemacs_version,
+  DEFVAR_LISP ("emacs-version", Vemacs_version,
               doc: /* Version numbers of this version of Emacs.  */);
   Vemacs_version = build_string (emacs_version);
 
+  DEFVAR_LISP ("dynamic-library-alist", Vdynamic_library_alist,
+    doc: /* Alist of dynamic libraries vs external files implementing them.
+Each element is a list (LIBRARY FILE...), where the car is a symbol
+representing a supported external library, and the rest are strings giving
+alternate filenames for that library.
+
+Emacs tries to load the library from the files in the order they appear on
+the list; if none is loaded, the running session of Emacs won't have access
+to that library.
+
+Note that image types `pbm' and `xbm' do not need entries in this variable
+because they do not depend on external libraries and are always available.
+
+Also note that this is not a generic facility for accessing external
+libraries; only those already known by Emacs will be loaded.  */);
+  Vdynamic_library_alist = Qnil;
+  Fput (intern_c_string ("dynamic-library-alist"), Qrisky_local_variable, Qt);
+
   /* Make sure IS_DAEMON starts up as false.  */
   daemon_pipe[1] = 0;
 }
-
-/* arch-tag: 7bfd356a-c720-4612-8ab6-aa4222931c2e
-   (do not change this comment) */