]> code.delx.au - gnu-emacs/blobdiff - src/emacs.c
Fix use of int instead of EMACS_INT in editfns.c.
[gnu-emacs] / src / emacs.c
index a5d57116c4f1857e43cd0cd2e0091b2fe22a1e0a..5e7efb642261577d8a0390c9973d6cf84933515d 100644 (file)
@@ -32,10 +32,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <unistd.h>
 #endif
 
-#ifdef HAVE_SYS_IOCTL_H
-#include <sys/ioctl.h>
-#endif
-
 #ifdef WINDOWSNT
 #include <fcntl.h>
 #include <windows.h> /* just for w32.h */
@@ -63,6 +59,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include "keyboard.h"
 #include "keymap.h"
 
+#ifdef HAVE_NS
+#include "nsterm.h"
+#endif
+
 #ifdef HAVE_SETLOCALE
 #include <locale.h>
 #endif
@@ -87,8 +87,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #endif
 #endif
 
-const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc.";
-const char emacs_version[] = "24.0.50";
+/* If you change the following line, remember to update
+   msdos/mainmake.v2 which gleans the Emacs version from it!  */
+static const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc.";
+static const char emacs_version[] = "24.0.50";
 
 /* Make these values available in GDB, which doesn't see macros.  */
 
@@ -213,15 +215,6 @@ static unsigned long heap_bss_diff;
    output a warning in dump-emacs.  */
 #define MAX_HEAP_BSS_DIFF (1024*1024)
 
-
-#ifdef HAVE_WINDOW_SYSTEM
-extern Lisp_Object Vinitial_window_system;
-#endif /* HAVE_WINDOW_SYSTEM */
-
-extern Lisp_Object Vauto_save_list_file_name;
-
-extern Lisp_Object Vinhibit_redisplay;
-
 /* Nonzero means running Emacs without interactive terminal.  */
 
 int noninteractive;
@@ -634,7 +627,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;
@@ -757,7 +750,6 @@ main (int argc, char **argv)
   char *ch_to_dir;
 
 #if GC_MARK_STACK
-  extern Lisp_Object *stack_base;
   stack_base = &dummy;
 #endif
 
@@ -845,8 +837,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 */
@@ -861,23 +854,6 @@ main (int argc, char **argv)
     }
 #endif /* HAVE_PERSONALITY_LINUX32 */
 
-
-/* Map in shared memory, if we are using that.  */
-#ifdef HAVE_SHM
-  if (argmatch (argv, argc, "-nl", "--no-shared-memory", 6, NULL, &skip_args))
-    {
-      map_in_data (0);
-      /* The shared memory was just restored, which clobbered this.  */
-      skip_args = 1;
-    }
-  else
-    {
-      map_in_data (1);
-      /* The shared memory was just restored, which clobbered this.  */
-      skip_args = 0;
-    }
-#endif
-
 #if defined (HAVE_SETRLIMIT) && defined (RLIMIT_STACK)
   /* Extend the stack space available.
      Don't do that if dumping, since some systems (e.g. DJGPP)
@@ -1276,9 +1252,7 @@ main (int argc, char **argv)
 #ifdef AIX
 /* 20 is SIGCHLD, 21 is SIGTTIN, 22 is SIGTTOU.  */
       signal (SIGXCPU, fatal_error_signal);
-#ifndef _I386
       signal (SIGIOINT, fatal_error_signal);
-#endif
       signal (SIGGRANT, fatal_error_signal);
       signal (SIGRETRACT, fatal_error_signal);
       signal (SIGSOUND, fatal_error_signal);
@@ -1354,68 +1328,6 @@ 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);
 
@@ -1628,6 +1540,10 @@ main (int argc, char **argv)
 #endif
 #endif /* HAVE_X_WINDOWS */
 
+#ifdef HAVE_LIBXML2
+      syms_of_xml ();
+#endif
+
       syms_of_menu ();
 
 #ifdef HAVE_NTGUI
@@ -1814,10 +1730,6 @@ 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 },
   /* -d must come last before the options handled in startup.el.  */
   { "-d", "--display", 60, 1 },
@@ -2094,8 +2006,6 @@ all of which are called before Emacs is actually killed.  */)
     unlink (SDATA (Vauto_save_list_file_name));
 
   exit (INTEGERP (arg) ? XINT (arg) : EXIT_SUCCESS);
-  /* NOTREACHED */
-  return Qnil;
 }
 
 
@@ -2120,7 +2030,7 @@ 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);