]> git.eshelyaron.com Git - emacs.git/commitdiff
Merged from emacs@sv.gnu.org. Last-minute emacsclient rewrites be damned!
authorKaroly Lorentey <lorentey@elte.hu>
Sun, 3 Dec 2006 15:03:30 +0000 (15:03 +0000)
committerKaroly Lorentey <lorentey@elte.hu>
Sun, 3 Dec 2006 15:03:30 +0000 (15:03 +0000)
Patches applied:

 * emacs@sv.gnu.org/emacs--devo--0--patch-490
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-491
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-492
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-493
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-494
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-495
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-496
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-497
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-498
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-499
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-500
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-501
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-502
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-503
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-504
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-505
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-506
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-507
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-508
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-509
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-510
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-511
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-512
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-513
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-514
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-515
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-516
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-517
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-518
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-519
   Update from CVS: etc/TUTORIAL.cn: Updated.

 * emacs@sv.gnu.org/emacs--devo--0--patch-520
   Merge from erc--emacs--22

 * emacs@sv.gnu.org/emacs--devo--0--patch-521
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-522
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-523
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-524
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-525
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-526
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-527
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-528
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-529
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-530
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-531
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-532
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-533
   Update from CVS

 * emacs@sv.gnu.org/emacs--devo--0--patch-534
   Merge from gnus--rel--5.10

 * emacs@sv.gnu.org/emacs--devo--0--patch-535
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-161
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-162
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-163
   Merge from emacs--devo--0

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-164
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-165
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-166
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-167
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-168
   Update from CVS

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-169
   Merge from emacs--devo--0

 * emacs@sv.gnu.org/gnus--rel--5.10--patch-170
   Update from CVS

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-588

58 files changed:
1  2 
README
configure
configure.in
lib-src/emacsclient.c
lib-src/etags.c
lisp/bindings.el
lisp/ebuff-menu.el
lisp/faces.el
lisp/files.el
lisp/help-fns.el
lisp/international/mule-cmds.el
lisp/international/mule.el
lisp/ldefs-boot.el
lisp/mail/emacsbug.el
lisp/menu-bar.el
lisp/server.el
lisp/simple.el
lisp/startup.el
lisp/subr.el
lisp/term/x-win.el
lisp/term/xterm.el
lisp/tmm.el
lisp/version.el
s.diff
src/alloc.c
src/buffer.c
src/coding.c
src/config.in
src/data.c
src/emacs.c
src/eval.c
src/fileio.c
src/fns.c
src/frame.c
src/gtkutil.c
src/image.c
src/indent.c
src/keyboard.c
src/lread.c
src/macfns.c
src/macterm.c
src/macterm.h
src/minibuf.c
src/msdos.c
src/process.c
src/sysdep.c
src/term.c
src/termhooks.h
src/w32term.c
src/window.c
src/xdisp.c
src/xfaces.c
src/xfns.c
src/xmenu.c
src/xselect.c
src/xsmfns.c
src/xterm.c
src/xterm.h

diff --cc README
index 91563b1b8175f289664811075f426f958b07375a,793b7560620b3d1f00c73ad6e9598e827eb421b4..ebb42242dea6e713ceb363952b6729597413ae8a
--- 1/README
--- 2/README
+++ b/README
@@@ -1,11 -1,9 +1,9 @@@
--This directory tree holds version 22.0.91 of GNU Emacs, the extensible,
++This directory tree holds version 23.0.51 of GNU Emacs, the extensible,
  customizable, self-documenting real-time display editor.
  
- You may encounter bugs in this release.  If you do, please report
- them; your bug reports are valuable contributions to the FSF, since
- they allow us to notice and fix problems on machines we don't have, or
- in code we don't use often.  See the file BUGS for more information on
- how to report bugs.
+ The file INSTALL in this directory says how to build and install GNU
+ Emacs on various systems, once you have unpacked or checked out the
+ entire Emacs file tree.
  
  See the file etc/NEWS for information on new features and other
  user-visible changes in recent versions of Emacs.
diff --cc configure
Simple merge
diff --cc configure.in
Simple merge
index 3d15a06b14794f03cb1f6053c02a4c492501df5b,f05b98eccee89da74aa649405d57d37aef98cd6e..64a0e00d5b9f50f1a41451cf04af15d26e66bccf
@@@ -37,34 -69,14 +69,38 @@@ Boston, MA 02110-1301, USA.  *
  
  #ifdef VMS
  # include "vms-pwd.h"
- #else
+ #else /* not VMS */
+ #ifdef WINDOWSNT
+ # include <io.h>
+ #else /* not WINDOWSNT */
  # include <pwd.h>
+ #endif /* not WINDOWSNT */
  #endif /* not VMS */
 +#include <sys/stat.h>
  
 +#include <signal.h>
 +#include <errno.h>
 +
 +/* From lisp.h */
 +#ifndef DIRECTORY_SEP
 +#define DIRECTORY_SEP '/'
 +#endif
 +#ifndef IS_DIRECTORY_SEP
 +#define IS_DIRECTORY_SEP(_c_) ((_c_) == DIRECTORY_SEP)
 +#endif
 +#ifndef IS_DEVICE_SEP
 +#ifndef DEVICE_SEP
 +#define IS_DEVICE_SEP(_c_) 0
 +#else
 +#define IS_DEVICE_SEP(_c_) ((_c_) == DEVICE_SEP)
 +#endif
 +#endif
 +#ifndef IS_ANY_SEP
 +#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_))
 +#endif
 +
 +
 +\f
  char *getenv (), *getwd ();
  char *(getcwd) ();
  
  #define VERSION "unspecified"
  #endif
  \f
 -#define SEND_QUOTED(data) (quote_file_name (s, (data)))
+ #define SEND_STRING(data) (send_to_emacs (s, (data)))
++#define SEND_QUOTED(data) (quote_argument (s, (data)))
+ #ifndef EXIT_SUCCESS
+ #define EXIT_SUCCESS 0
+ #endif
+ #ifndef EXIT_FAILURE
+ #define EXIT_FAILURE 1
+ #endif
+ #ifndef FALSE
+ #define FALSE 0
+ #endif
+ #ifndef TRUE
+ #define TRUE 1
+ #endif
+ #ifndef NO_RETURN
+ #define NO_RETURN
+ #endif
\f
  /* Name used to invoke this program.  */
  char *progname;
  
@@@ -96,16 -119,19 +155,25 @@@ int window_system = 0
  /* The display on which Emacs should work.  --display.  */
  char *display = NULL;
  
 +/* Nonzero means open a new Emacs frame on the current terminal. */
 +int tty = 0;
 +
  /* If non-NULL, the name of an editor to fallback to if the server
     is not running.  --alternate-editor.   */
- const char * alternate_editor = NULL;
+ const char *alternate_editor = NULL;
  
  /* If non-NULL, the filename of the UNIX socket.  */
  char *socket_name = NULL;
  
+ /* If non-NULL, the filename of the authentication file.  */
+ char *server_file = NULL;
+ /* PID of the Emacs server process.  */
+ int emacs_pid = 0;
++/* File handles for communicating with Emacs. */
++FILE *out, *in;
++
  void print_help_and_exit () NO_RETURN;
  
  struct option longopts[] =
    { "eval",   no_argument,       NULL, 'e' },
    { "help",   no_argument,       NULL, 'H' },
    { "version",        no_argument,       NULL, 'V' },
 +  { "tty",    no_argument,       NULL, 't' },
 +  { "current-frame", no_argument,  NULL, 'c' },
    { "alternate-editor", required_argument, NULL, 'a' },
+ #ifndef NO_SOCKETS_IN_FILE_SYSTEM
    { "socket-name",    required_argument, NULL, 's' },
+ #endif
+   { "server-file",    required_argument, NULL, 'f' },
    { "display",        required_argument, NULL, 'd' },
    { 0, 0, 0, 0 }
  };
  
++\f
++/* Like malloc but get fatal error if memory is exhausted.  */
++
++long *
++xmalloc (size)
++     unsigned int size;
++{
++  long *result = (long *) malloc (size);
++  if (result == NULL)
++    {
++      perror ("malloc");
++      exit (EXIT_FAILURE);
++    }
++  return result;
++}
++
++/* Like strdup but get a fatal error if memory is exhausted. */
++
++char *
++xstrdup (const char *s)
++{
++  char *result = strdup (s);
++  if (result == NULL)
++    {
++      perror ("strdup");
++      exit (EXIT_FAILURE);
++    }
++  return result;
++}
++
++/* From sysdep.c */
++#if !defined (HAVE_GET_CURRENT_DIR_NAME) || defined (BROKEN_GET_CURRENT_DIR_NAME)
++
++/* Return the current working directory.  Returns NULL on errors.
++   Any other returned value must be freed with free. This is used
++   only when get_current_dir_name is not defined on the system.  */
++char*
++get_current_dir_name ()
++{
++  char *buf;
++  char *pwd;
++  struct stat dotstat, pwdstat;
++  /* If PWD is accurate, use it instead of calling getwd.  PWD is
++     sometimes a nicer name, and using it may avoid a fatal error if a
++     parent directory is searchable but not readable.  */
++    if ((pwd = getenv ("PWD")) != 0
++      && (IS_DIRECTORY_SEP (*pwd) || (*pwd && IS_DEVICE_SEP (pwd[1])))
++      && stat (pwd, &pwdstat) == 0
++      && stat (".", &dotstat) == 0
++      && dotstat.st_ino == pwdstat.st_ino
++      && dotstat.st_dev == pwdstat.st_dev
++#ifdef MAXPATHLEN
++      && strlen (pwd) < MAXPATHLEN
++#endif
++      )
++    {
++      buf = (char *) xmalloc (strlen (pwd) + 1);
++      if (!buf)
++        return NULL;
++      strcpy (buf, pwd);
++    }
++#ifdef HAVE_GETCWD
++  else
++    {
++      size_t buf_size = 1024;
++      buf = (char *) xmalloc (buf_size);
++      if (!buf)
++        return NULL;
++      for (;;)
++        {
++          if (getcwd (buf, buf_size) == buf)
++            break;
++          if (errno != ERANGE)
++            {
++              int tmp_errno = errno;
++              free (buf);
++              errno = tmp_errno;
++              return NULL;
++            }
++          buf_size *= 2;
++          buf = (char *) realloc (buf, buf_size);
++          if (!buf)
++            return NULL;
++        }
++    }
++#else
++  else
++    {
++      /* We need MAXPATHLEN here.  */
++      buf = (char *) xmalloc (MAXPATHLEN + 1);
++      if (!buf)
++        return NULL;
++      if (getwd (buf) == NULL)
++        {
++          int tmp_errno = errno;
++          free (buf);
++          errno = tmp_errno;
++          return NULL;
++        }
++    }
++#endif
++  return buf;
++}
++#endif
++
+ /* Message functions. */
+ #ifdef WINDOWSNT
+ /* I first tried to check for STDOUT.  The check did not work,
+    I get a valid handle also in nonconsole apps.
+    Instead I test for console title, which seems to work.  */
+ int
+ w32_window_app()
+ {
+   static int window_app = -1;
+   char szTitle[MAX_PATH];
+   if (window_app < 0)
+     window_app = (GetConsoleTitleA (szTitle, MAX_PATH) == 0);
+   return window_app;
+ }
+ #endif
+ void
+ message (int is_error, char *message, ...)
+ {
+   char msg [2048];
+   va_list args;
+   va_start (args, message);
+   vsprintf (msg, message, args);
+   va_end (args);
+ #ifdef WINDOWSNT
+   if (w32_window_app ())
+     {
+       if (is_error)
+       MessageBox (NULL, msg, "Emacsclient ERROR", MB_ICONERROR);
+       else
+       MessageBox (NULL, msg, "Emacsclient", MB_ICONINFORMATION);
+     }
+   else
+ #endif
+     {
+       FILE *f = is_error ? stderr : stdout;
+       fputs (msg, f);
+       fflush (f);
+     }
+ }
  /* Decode the options from argv and argc.
     The global variable `optind' will say how many arguments we used up.  */
  
@@@ -138,7 -209,12 +361,12 @@@ decode_options (argc, argv
    while (1)
      {
        int opt = getopt_long (argc, argv,
-                            "VHnea:s:d:tc", longopts, 0);
+ #ifndef NO_SOCKETS_IN_FILE_SYSTEM
 -                           "VHnea:s:f:d:",
++                           "VHnea:s:f:d:tc",
+ #else
 -                             "VHnea:f:d:",
++                           "VHnea:f:d:tc",
+ #endif
 -                             longopts, 0);
++                           longopts, 0);
  
        if (opt == EOF)
        break;
          break;
        }
      }
 +
 +  if (!tty && display)
 +    window_system = 1;
 +  else
 +    tty = 1;
 +
 +  /* --no-wait implies --current-frame on ttys when there are file
 +       arguments or expressions given.  */
 +  if (nowait && tty && argc - optind > 0)
 +    current_frame = 1;
 +
 +  if (current_frame)
 +    {
 +      tty = 0;
 +      window_system = 0;
 +    }
 +
 +  if (tty)
 +    window_system = 0;
  }
  
++\f
  void
  print_help_and_exit ()
  {
-   printf (
-         "Usage: %s [OPTIONS] FILE...\n\
+   message (FALSE,
 -        "Usage: %s [OPTIONS] FILE...\n\
++         "Usage: %s [OPTIONS] FILE...\n\
  Tell the Emacs server to visit the specified files.\n\
  Every FILE can be either just a FILENAME or [+LINE[:COLUMN]] FILENAME.\n\
  \n\
  The following OPTIONS are accepted:\n\
- -V, --version           Just print a version info and return\n\
 -\n\
 --V, --version         Just print version info and return\n\
 --H, --help            Print this usage information message\n\
 --e, --eval            Evaluate FILE arguments as Lisp expressions\n\
 --n, --no-wait         Don't wait for the server to return\n\
 --d, --display=DISPLAY Visit the file in the given display\n"
++-V, --version           Just print version info and return\n\
 +-H, --help              Print this usage information message\n\
 +-t, --tty               Open a new Emacs frame on the current terminal\n\
 +-c, --current-frame   Do not create a new frame; use the current Emacs frame\n\
- -n, --no-wait           Don't wait for the server to return\n\
 +-e, --eval              Evaluate the FILE arguments as ELisp expressions\n\
- -d, --display=DISPLAY   Visit the file in the given display\n\
- -s, --socket-name=FILENAME\n\
-                         Set the filename of the UNIX socket for communication\n\
++-n, --no-wait           Don't wait for the server to return\n\
++-d, --display=DISPLAY   Visit the file in the given display\n"
+ #ifndef NO_SOCKETS_IN_FILE_SYSTEM
+ "-s, --socket-name=FILENAME\n\
 -                      Set filename of the UNIX socket for communication\n"
++                        Set filename of the UNIX socket for communication\n"
+ #endif
+ "-f, --server-file=FILENAME\n\
 -                      Set filename of the TCP authentication file\n\
++                        Set filename of the TCP authentication file\n\
  -a, --alternate-editor=EDITOR\n\
 -                      Editor to fallback to if server is not running\n\
 +                        Editor to fallback to if the server is not running\n\
  \n\
  Report bugs to bug-gnu-emacs@gnu.org.\n", progname);
    exit (EXIT_SUCCESS);
  }
  
- /* Like malloc but get fatal error if memory is exhausted.  */
- long *
- xmalloc (size)
-      unsigned int size;
 -\f
+ /*
+   Try to run a different command, or --if no alternate editor is
+   defined-- exit with an errorcode.
+ */
+ void
 -fail (argc, argv)
 -     int argc;
 -     char **argv;
++fail (void)
  {
-   long *result = (long *) malloc (size);
-   if (result == NULL)
+   if (alternate_editor)
      {
-       perror ("malloc");
-       exit (EXIT_FAILURE);
+       int i = optind - 1;
+ #ifdef WINDOWSNT
 -      argv[i] = (char *)alternate_editor;
++      main_argv[i] = (char *)alternate_editor;
+ #endif
 -      execvp (alternate_editor, argv + i);
++      execvp (alternate_editor, main_argv + i);
+       message (TRUE, "%s: error executing alternate editor \"%s\"\n",
 -               progname, alternate_editor);
++             progname, alternate_editor);
      }
-   return result;
+   exit (EXIT_FAILURE);
  }
  
- /* Like strdup but get a fatal error if memory is exhausted. */
\f
+ #if !defined (HAVE_SOCKETS) || !defined (HAVE_INET_SOCKETS)
  
- char *
- xstrdup (const char *s)
+ int
+ main (argc, argv)
+      int argc;
+      char **argv;
  {
-   char *result = strdup (s);
-   if (result == NULL)
-     {
-       perror ("strdup");
-       exit (EXIT_FAILURE);
-     }
-   return result;
 -  message (TRUE, "%s: Sorry, the Emacs server is supported only\non systems with Berkely sockets.\n",
++  main_argc = argc;
++  main_argv = argv;
++  progname = argv[0];
++  message (TRUE, "%s: Sorry, the Emacs server is supported only\n"
++         "on systems with Berkeley sockets.\n", 
+          argv[0]);
 -
 -  fail (argc, argv);
++  fail ();
  }
  
- /* From sysdep.c */
- #if !defined (HAVE_GET_CURRENT_DIR_NAME) || defined (BROKEN_GET_CURRENT_DIR_NAME)
+ #else /* HAVE_SOCKETS && HAVE_INET_SOCKETS */
  
- /* Return the current working directory.  Returns NULL on errors.
-    Any other returned value must be freed with free. This is used
-    only when get_current_dir_name is not defined on the system.  */
- char*
- get_current_dir_name ()
- {
-   char *buf;
-   char *pwd;
-   struct stat dotstat, pwdstat;
-   /* If PWD is accurate, use it instead of calling getwd.  PWD is
-      sometimes a nicer name, and using it may avoid a fatal error if a
-      parent directory is searchable but not readable.  */
-     if ((pwd = getenv ("PWD")) != 0
-       && (IS_DIRECTORY_SEP (*pwd) || (*pwd && IS_DEVICE_SEP (pwd[1])))
-       && stat (pwd, &pwdstat) == 0
-       && stat (".", &dotstat) == 0
-       && dotstat.st_ino == pwdstat.st_ino
-       && dotstat.st_dev == pwdstat.st_dev
- #ifdef MAXPATHLEN
-       && strlen (pwd) < MAXPATHLEN
- #endif
-       )
-     {
-       buf = (char *) malloc (strlen (pwd) + 1);
-       if (!buf)
-         return NULL;
-       strcpy (buf, pwd);
-     }
- #ifdef HAVE_GETCWD
-   else
-     {
-       size_t buf_size = 1024;
-       buf = (char *) malloc (buf_size);
-       if (!buf)
-         return NULL;
-       for (;;)
-         {
-           if (getcwd (buf, buf_size) == buf)
-             break;
-           if (errno != ERANGE)
-             {
-               int tmp_errno = errno;
-               free (buf);
-               errno = tmp_errno;
-               return NULL;
-             }
-           buf_size *= 2;
-           buf = (char *) realloc (buf, buf_size);
-           if (!buf)
-             return NULL;
-         }
-     }
+ #ifdef WINDOWSNT
+ # include <winsock2.h>
  #else
-   else
+ # include <sys/types.h>
+ # include <sys/socket.h>
+ # include <sys/un.h>
+ # include <sys/stat.h>
+ # include <errno.h>
+ #endif
+ #define AUTH_KEY_LENGTH      64
+ #define SEND_BUFFER_SIZE   4096
+ extern char *strerror ();
+ extern int errno;
+ /* Buffer to accumulate data to send in TCP connections.  */
+ char send_buffer[SEND_BUFFER_SIZE + 1];
+ int sblen = 0;        /* Fill pointer for the send buffer.  */
+ /* Let's send the data to Emacs when either
+    - the data ends in "\n", or
+    - the buffer is full (but this shouldn't happen)
+    Otherwise, we just accumulate it.  */
+ void
+ send_to_emacs (s, data)
+      HSOCKET s;
+      char *data;
+ {
+   while (data)
      {
-       /* We need MAXPATHLEN here.  */
-       buf = (char *) malloc (MAXPATHLEN + 1);
-       if (!buf)
-         return NULL;
-       if (getwd (buf) == NULL)
-         {
-           int tmp_errno = errno;
-           free (buf);
-           errno = tmp_errno;
-           return NULL;
-         }
+       int dlen = strlen (data);
+       if (dlen + sblen >= SEND_BUFFER_SIZE)
+       {
+         int part = SEND_BUFFER_SIZE - sblen;
+         strncpy (&send_buffer[sblen], data, part);
+         data += part;
+         sblen = SEND_BUFFER_SIZE;
+       }
+       else if (dlen)
+       {
+         strcpy (&send_buffer[sblen], data);
+         data = NULL;
+         sblen += dlen;
+       }
+       else
+       break;
+       if (sblen == SEND_BUFFER_SIZE
+         || (sblen > 0 && send_buffer[sblen-1] == '\n'))
+       {
+         int sent = send (s, send_buffer, sblen, 0);
+         if (sent != sblen)
+           strcpy (send_buffer, &send_buffer[sent]);
+         sblen -= sent;
+       }
      }
- #endif
-   return buf;
  }
- #endif
  
 -/* In NAME, insert a & before each &, each space, each newline, and
 +\f
 +/* In STR, insert a & before each &, each space, each newline, and
     any initial -.  Change spaces to underscores, too, so that the
 -   return value never contains a space.  */
 +   return value never contains a space.
 +
 +   Does not change the string.  Outputs the result to STREAM.  */
  void
- quote_argument (str, stream)
 -quote_file_name (s, name)
++quote_argument (s, str)
+      HSOCKET s;
 -     char *name;
 +     char *str;
-      FILE *stream;
  {
 -  char *copy = (char *) malloc (strlen (name) * 2 + 1);
 +  char *copy = (char *) xmalloc (strlen (str) * 2 + 1);
    char *p, *q;
  
 -  p = name;
 +  p = str;
    q = copy;
    while (*p)
      {
    free (copy);
  }
  
 +
 +/* The inverse of quote_argument.  Removes quoting in string STR by
 +   modifying the string in place.   Returns STR. */
 +
 +char *
 +unquote_argument (str)
 +     char *str;
 +{
 +  char *p, *q;
 +
 +  if (! str)
 +    return str;
 +
 +  p = str;
 +  q = str;
 +  while (*p)
 +    {
 +      if (*p == '&')
 +        {
 +          p++;
 +          if (*p == '&')
 +            *p = '&';
 +          else if (*p == '_')
 +            *p = ' ';
 +          else if (*p == 'n')
 +            *p = '\n';
 +          else if (*p == '-')
 +            *p = '-';
 +        }
 +      *q++ = *p++;
 +    }
 +  *q = 0;
 +  return str;
 +}
 +
++\f
+ int
+ file_name_absolute_p (filename)
+      const unsigned char *filename;
+ {
+   /* Sanity check, it shouldn't happen.  */
+   if (! filename) return FALSE;
+   /* /xxx is always an absolute path.  */
+   if (filename[0] == '/') return TRUE;
+   /* Empty filenames (which shouldn't happen) are relative.  */
+   if (filename[0] == '\0') return FALSE;
+ #ifdef WINDOWSNT
+   /* X:\xxx is always absolute; X:xxx is an error and will fail.  */
+   if (isalpha (filename[0])
+       && filename[1] == ':' && (filename[2] == '\\' || filename[2] == '/'))
+     return TRUE;
+   /* Both \xxx and \\xxx\yyy are absolute.  */
+   if (filename[0] == '\\') return TRUE;
+ #endif
+   return FALSE;
+ }
+ #ifdef WINDOWSNT
+ /* Wrapper to make WSACleanup a cdecl, as required by atexit().  */
+ void
+ __cdecl close_winsock ()
+ {
+   WSACleanup ();
+ }
+ /* Initialize the WinSock2 library.  */
+ void
+ initialize_sockets ()
+ {
+   WSADATA wsaData;
+   if (WSAStartup (MAKEWORD (2, 0), &wsaData))
+     {
+       message (TRUE, "%s: error initializing WinSock2", progname);
+       exit (EXIT_FAILURE);
+     }
+   atexit (close_winsock);
+ }
+ #endif /* WINDOWSNT */
++
  \f
  /*
-   Try to run a different command, or --if no alternate editor is
-   defined-- exit with an errorcode.
+  * Read the information needed to set up a TCP comm channel with
+  * the Emacs server: host, port, pid and authentication string.
  */
- void
- fail (void)
+ int
+ get_server_config (server, authentication)
+      struct sockaddr_in *server;
+      char *authentication;
  {
-   if (alternate_editor)
+   char dotted[32];
+   char *port;
+   char *pid;
+   FILE *config = NULL;
+   if (file_name_absolute_p (server_file))
+     config = fopen (server_file, "rb");
+   else
      {
-       int i = optind - 1;
-       execvp (alternate_editor, main_argv + i);
-       return;
+       char *home = getenv ("HOME");
+       if (home)
+         {
+           char *path = alloca (32 + strlen (home) + strlen (server_file));
+           sprintf (path, "%s/.emacs.d/server/%s", home, server_file);
+           config = fopen (path, "rb");
+         }
+ #ifdef WINDOWSNT
+       if (!config && (home = getenv ("APPDATA")))
+         {
+           char *path = alloca (32 + strlen (home) + strlen (server_file));
+           sprintf (path, "%s/.emacs.d/server/%s", home, server_file);
+           config = fopen (path, "rb");
+         }
+ #endif
+     }
+   if (! config)
+     return FALSE;
+   if (fgets (dotted, sizeof dotted, config)
+       && (port = strchr (dotted, ':'))
+       && (pid = strchr (port, ' ')))
+     {
+       *port++ = '\0';
+       *pid++  = '\0';
      }
    else
      {
+       message (TRUE, "%s: invalid configuration info", progname);
        exit (EXIT_FAILURE);
      }
+   server->sin_family = AF_INET;
+   server->sin_addr.s_addr = inet_addr (dotted);
+   server->sin_port = htons (atoi (port));
+   if (! fread (authentication, AUTH_KEY_LENGTH, 1, config))
+     {
+       message (TRUE, "%s: cannot read authentication info", progname);
+       exit (EXIT_FAILURE);
+     }
+   fclose (config);
+   emacs_pid = atoi (pid);
+   return TRUE;
  }
  
- /* The process id of Emacs. */
- int emacs_pid;
+ HSOCKET
+ set_tcp_socket ()
+ {
+   HSOCKET s;
+   struct sockaddr_in server;
+   struct linger l_arg = {1, 1};
+   char auth_string[AUTH_KEY_LENGTH + 1];
  
- /* File handles for communicating with Emacs. */
- FILE *out, *in;
+   if (! get_server_config (&server, auth_string))
+     return INVALID_SOCKET;
+   if (server.sin_addr.s_addr != inet_addr ("127.0.0.1"))
+     message (FALSE, "%s: connected to remote socket at %s\n",
+              progname, inet_ntoa (server.sin_addr));
+   /*
+    * Open up an AF_INET socket
+    */
+   if ((s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
+     {
+       message (TRUE, "%s: socket: %s\n", progname, strerror (errno));
+       return INVALID_SOCKET;
+     }
+   /*
+    * Set up the socket
+    */
+   if (connect (s, (struct sockaddr *) &server, sizeof server) < 0)
+     {
+       message (TRUE, "%s: connect: %s\n", progname, strerror (errno));
+       return INVALID_SOCKET;
+     }
+   setsockopt (s, SOL_SOCKET, SO_LINGER, (char *) &l_arg, sizeof l_arg);
+   /*
+    * Send the authentication
+    */
+   auth_string[AUTH_KEY_LENGTH] = '\0';
+   SEND_STRING ("-auth ");
+   SEND_STRING (auth_string);
+   SEND_STRING ("\n");
+   return s;
+ }
+ #if !defined (NO_SOCKETS_IN_FILE_SYSTEM)
+ /* Three possibilities:
+    2 - can't be `stat'ed              (sets errno)
+    1 - isn't owned by us
+    0 - success: none of the above */
+ static int
+ socket_status (socket_name)
+      char *socket_name;
+ {
+   struct stat statbfr;
+   if (stat (socket_name, &statbfr) == -1)
+     return 2;
+   if (statbfr.st_uid != geteuid ())
+     return 1;
  
\f
- #if !defined (HAVE_SOCKETS) || defined (NO_SOCKETS_IN_FILE_SYSTEM)
- int
- main (argc, argv)
-      int argc;
-      char **argv;
- {
-   fprintf (stderr, "%s: Sorry, the Emacs server is supported only\n",
-          argv[0]);
-   fprintf (stderr, "on systems with Berkeley sockets.\n");
-   fail ();
- }
- #else /* HAVE_SOCKETS */
+   return 0;
+ }
++\f
 +/* A signal handler that passes the signal to the Emacs process.
 +   Useful for SIGWINCH.  */
 +
 +SIGTYPE
 +pass_signal_to_emacs (int signalnum)
 +{
 +  int old_errno = errno;
 +
 +  if (emacs_pid)
 +    kill (emacs_pid, signalnum);
 +
 +  signal (signalnum, pass_signal_to_emacs);
 +  errno = old_errno;
 +}
 +
 +/* Signal handler for SIGCONT; notify the Emacs process that it can
 +   now resume our tty frame.  */
 +
 +SIGTYPE
 +handle_sigcont (int signalnum)
 +{
 +  int old_errno = errno;
 +
 +  if (tcgetpgrp (1) == getpgrp ())
 +    {
 +      /* We are in the foreground. */
 +      fprintf (out, "-resume \n");
 +      fflush (out);
 +      fsync (fileno (out));
 +    }
 +  else
 +    {
 +      /* We are in the background; cancel the continue. */
 +      kill (getpid (), SIGSTOP);
 +    }
 +
 +  signal (signalnum, handle_sigcont);
 +  errno = old_errno;
 +}
 +
 +/* Signal handler for SIGTSTP; notify the Emacs process that we are
 +   going to sleep.  Normally the suspend is initiated by Emacs via
 +   server-handle-suspend-tty, but if the server gets out of sync with
 +   reality, we may get a SIGTSTP on C-z.  Handling this signal and
 +   notifying Emacs about it should get things under control again. */
 +
 +SIGTYPE
 +handle_sigtstp (int signalnum)
 +{
 +  int old_errno = errno;
 +  sigset_t set;
 +  
 +  if (out)
 +    {
 +      fprintf (out, "-suspend \n");
 +      fflush (out);
 +      fsync (fileno (out));
 +    }
 +
 +  /* Unblock this signal and call the default handler by temprarily
 +     changing the handler and resignalling. */
 +  sigprocmask (SIG_BLOCK, NULL, &set);
 +  sigdelset (&set, signalnum);
 +  signal (signalnum, SIG_DFL);
 +  kill (getpid (), signalnum);
 +  sigprocmask (SIG_SETMASK, &set, NULL); /* Let's the above signal through. */
 +  signal (signalnum, handle_sigtstp);
 +
 +  errno = old_errno;
 +}
 +
 +/* Set up signal handlers before opening a frame on the current tty.  */
 +
 +void
 +init_signals (void)
 +{
 +  /* Set up signal handlers. */
 +  signal (SIGWINCH, pass_signal_to_emacs);
 +
 +  /* Don't pass SIGINT and SIGQUIT to Emacs, because it has no way of
 +     deciding which terminal the signal came from.  C-g is now a
 +     normal input event on secondary terminals.  */
 +#if 0
 +  signal (SIGINT, pass_signal_to_emacs);
 +  signal (SIGQUIT, pass_signal_to_emacs);
 +#endif
 +
 +  signal (SIGCONT, handle_sigcont);
 +  signal (SIGTSTP, handle_sigtstp);
 +  signal (SIGTTOU, handle_sigtstp);
 +}
 +
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <sys/un.h>
- #include <sys/stat.h>
- #include <errno.h>
- extern char *strerror ();
- extern int errno;
- /* Three possibilities:
-    2 - can't be `stat'ed              (sets errno)
-    1 - isn't owned by us
-    0 - success: none of the above */
- static int
- socket_status (socket_name)
-      char *socket_name;
- {
-   struct stat statbfr;
-   if (stat (socket_name, &statbfr) == -1)
-     return 2;
-   if (statbfr.st_uid != geteuid ())
-     return 1;
-   return 0;
- }
 +
- int
- main (argc, argv)
-      int argc;
-      char **argv;
 +
 +/* Returns 1 if PREFIX is a prefix of STRING. */
 +static int
 +strprefix (char *prefix, char *string)
 +{
 +  int i;
 +  if (! prefix)
 +    return 1;
 +
 +  if (!string)
 +    return 0;
 +
 +  for (i = 0; prefix[i]; i++)
 +    if (!string[i] || string[i] != prefix[i])
 +      return 0;
 +  return 1;
 +}
 +
++
+ HSOCKET
+ set_local_socket ()
  {
-   int s, i, needlf = 0;
+   HSOCKET s;
    struct sockaddr_un server;
-   char *cwd, *str;
-   char string[BUFSIZ];
-   main_argc = argc;
-   main_argv = argv;
-   progname = argv[0];
-   /* Process options.  */
-   decode_options (argc, argv);
-   if ((argc - optind < 1) && !eval && !tty && !window_system)
-     {
-       fprintf (stderr, "%s: file name or argument required\n", progname);
-       fprintf (stderr, "Try `%s --help' for more information\n", progname);
-       exit (EXIT_FAILURE);
-     }
  
    /*
     * Open up an AF_UNIX socket in this person's home directory
    {
      int sock_status = 0;
      int default_sock = !socket_name;
 -    int saved_errno;
 +    int saved_errno = 0;
 +
-      char *server_name = "server";
+     char *server_name = "server";
  
-      if (socket_name && !index (socket_name, '/') && !index (socket_name, '\\'))
-        { /* socket_name is a file name component.  */
+     if (socket_name && !index (socket_name, '/') && !index (socket_name, '\\'))
+       { /* socket_name is a file name component.  */
 -      server_name = socket_name;
 -      socket_name = NULL;
 -      default_sock = 1;       /* Try both UIDs.  */
 +      server_name = socket_name;
 +      socket_name = NULL;
 +      default_sock = 1;       /* Try both UIDs.  */
-        }
+       }
  
-      if (default_sock)
+     if (default_sock)
        {
 -      socket_name = alloca (100 + strlen (server_name));
 -      sprintf (socket_name, "/tmp/emacs%d/%s",
 -               (int) geteuid (), server_name);
 +      socket_name = alloca (100 + strlen (server_name));
 +      sprintf (socket_name, "/tmp/emacs%d/%s",
 +               (int) geteuid (), server_name);
        }
  
      if (strlen (socket_name) < sizeof (server.sun_path))
        strcpy (server.sun_path, socket_name);
      else
        {
-         fprintf (stderr, "%s: socket-name %s too long",
-                  argv[0], socket_name);
 -      message (TRUE, "%s: socket-name %s too long",
 -               progname, socket_name);
 -      exit (EXIT_FAILURE);
++        message (TRUE, "%s: socket-name %s too long",
++                 progname, socket_name);
 +        fail ();
        }
  
      /* See if the socket exists, and if it's owned by us. */
          }
        }
  
-      switch (sock_status)
-        {
-        case 1:
-        /* There's a socket, but it isn't owned by us.  This is OK if
-           we are root. */
-        if (0 != geteuid ())
-          {
-            fprintf (stderr, "%s: Invalid socket owner\n", argv[0]);
-            fail ();
-          }
-        break;
-        case 2:
-        /* `stat' failed */
-        if (saved_errno == ENOENT)
-          fprintf (stderr,
-                   "%s: can't find socket; have you started the server?\n\
+     switch (sock_status)
+       {
+       case 1:
 -        /* There's a socket, but it isn't owned by us.  This is OK if
 -           we are root. */
 -        if (0 != geteuid ())
 -          {
 -            message (TRUE, "%s: Invalid socket owner\n", progname);
++      /* There's a socket, but it isn't owned by us.  This is OK if
++         we are root. */
++      if (0 != geteuid ())
++        {
++          message (TRUE, "%s: Invalid socket owner\n", progname);
+           return INVALID_SOCKET;
 -          }
 -        break;
++        }
++      break;
+       case 2:
 -        /* `stat' failed */
 -        if (saved_errno == ENOENT)
 -          message (TRUE,
 -                   "%s: can't find socket; have you started the server?\n\
++      /* `stat' failed */
++      if (saved_errno == ENOENT)
++        message (TRUE,
++                 "%s: can't find socket; have you started the server?\n\
  To start the server in Emacs, type \"M-x server-start\".\n",
-                   argv[0]);
-        else
-          fprintf (stderr, "%s: can't stat %s: %s\n",
-                   argv[0], server.sun_path, strerror (saved_errno));
-        fail ();
-        break;
-        }
+                  progname);
 -        else
 -          message (TRUE, "%s: can't stat %s: %s\n",
++      else
++        message (TRUE, "%s: can't stat %s: %s\n",
+                  progname, server.sun_path, strerror (saved_errno));
 -        return INVALID_SOCKET;
++      return INVALID_SOCKET;
+       }
    }
  
    if (connect (s, (struct sockaddr *) &server, strlen (server.sun_path) + 2)
        < 0)
      {
-       fprintf (stderr, "%s: ", argv[0]);
-       perror ("connect");
-       fail ();
+       message (TRUE, "%s: connect: %s\n", progname, strerror (errno));
+       return INVALID_SOCKET;
      }
  
-   /* We use the stream OUT to send our commands to the server.  */
-   if ((out = fdopen (s, "r+")) == NULL)
+   return s;
+ }
+ #endif /* ! NO_SOCKETS_IN_FILE_SYSTEM */
+ HSOCKET
+ set_socket ()
+ {
+   HSOCKET s;
 -
++  
+   INITIALIZE ();
 -
++  
+ #ifndef NO_SOCKETS_IN_FILE_SYSTEM
+   /* Explicit --socket-name argument.  */
+   if (socket_name)
      {
-       fprintf (stderr, "%s: ", argv[0]);
-       perror ("fdopen");
-       fail ();
+       s = set_local_socket ();
+       if ((s != INVALID_SOCKET) || alternate_editor)
 -        return s;
 -
++      return s;
+       message (TRUE, "%s: error accessing socket \"%s\"",
 -               progname, socket_name);
++             progname, socket_name);
+       exit (EXIT_FAILURE);
      }
+ #endif
+   /* Explicit --server-file arg or EMACS_SERVER_FILE variable.  */
+   if (!server_file)
+     server_file = getenv ("EMACS_SERVER_FILE");
  
-   /* We use the stream IN to read the responses.
-      We used to use just one stream for both output and input
-      on the socket, but reversing direction works nonportably:
-      on some systems, the output appears as the first input;
-      on other systems it does not.  */
-   if ((in = fdopen (s, "r+")) == NULL)
+   if (server_file)
      {
-       fprintf (stderr, "%s: ", argv[0]);
-       perror ("fdopen");
-       fail ();
+       s = set_tcp_socket ();
+       if ((s != INVALID_SOCKET) || alternate_editor)
 -        return s;
 -
++      return s;
++ 
+       message (TRUE, "%s: error accessing server file \"%s\"",
 -               progname, server_file);
++             progname, server_file);
+       exit (EXIT_FAILURE);
      }
 -
++  
+ #ifndef NO_SOCKETS_IN_FILE_SYSTEM
+   /* Implicit local socket.  */
+   s = set_local_socket ();
+   if (s != INVALID_SOCKET)
+     return s;
+ #endif
  
- #ifdef HAVE_GETCWD
-   cwd = getcwd (string, sizeof string);
- #else
-   cwd = getwd (string);
+   /* Implicit server file.  */
+   server_file = "server";
+   s = set_tcp_socket ();
+   if ((s != INVALID_SOCKET) || alternate_editor)
+     return s;
+   /* No implicit or explicit socket, and no alternate editor.  */
+   message (TRUE, "%s: No socket or alternate editor.  Please use:\n\n"
+ #ifndef NO_SOCKETS_IN_FILE_SYSTEM
+ "\t--socket-name\n"
  #endif
 -  char *cwd;
+ "\t--server-file      (or environment variable EMACS_SERVER_FILE)\n\
+ \t--alternate-editor (or environment variable ALTERNATE_EDITOR)\n",
+            progname);
+   exit (EXIT_FAILURE);
+ }
+ int
+ main (argc, argv)
+      int argc;
+      char **argv;
+ {
+   HSOCKET s;
+   int i, rl, needlf = 0;
 -  if ((argc - optind < 1) && !eval)
++  char *cwd, *str;
+   char string[BUFSIZ+1];
++  main_argc = argc;
++  main_argv = argv;
+   progname = argv[0];
+   /* Process options.  */
+   decode_options (argc, argv);
 -      message (TRUE, "%s: file name or argument required\nTry `%s --help' for more information\n",
 -              progname, progname);
++  if ((argc - optind < 1) && !eval && !tty && !window_system)
+     {
 -    fail (argc, argv);
++      message (TRUE, "%s: file name or argument required\n"
++             "Try `%s --help' for more information\n",
++             progname, progname);
+       exit (EXIT_FAILURE);
+     }
+   if ((s = set_socket ()) == INVALID_SOCKET)
 -#ifdef HAVE_GETCWD
 -  cwd = getcwd (string, sizeof string);
 -#else
 -  cwd = getwd (string);
 -#endif
++    fail ();
++
++  cwd = get_current_dir_name ();
    if (cwd == 0)
      {
        /* getwd puts message in STRING if it fails.  */
 -      message (TRUE, "%s: %s (%s)\n", progname,
--#ifdef HAVE_GETCWD
-       fprintf (stderr, "%s: %s (%s)\n", argv[0],
-              "cannot get current working directory", strerror (errno));
 -             "Cannot get current working directory",
--#else
-       fprintf (stderr, "%s: %s (%s)\n", argv[0], string, strerror (errno));
 -             string,
--#endif
 -             strerror (errno));
 -      fail (argc, argv);
++      message (TRUE, "%s: %s\n", progname,
++             "Cannot get current working directory");
 +      fail ();
      }
  
 -   */
+ #ifdef WINDOWSNT
+   /*
+     Modern Windows restrict which processes can set the foreground window.
+     emacsclient can allow Emacs to grab the focus by calling the function
+     AllowSetForegroundWindow().  Unfortunately, older Windows (W95, W98
+     and NT) lack this function, so we have to check its availability.
-   fprintf (out, "-version %s ", VERSION);
++  */
+   if (emacs_pid)
+     {
+       HMODULE hUser32;
+       if (hUser32 = LoadLibrary ("user32.dll"))
+       {
+         FARPROC set_fg;
+         if (set_fg = GetProcAddress (hUser32, "AllowSetForegroundWindow"))
+           set_fg (emacs_pid);
+         FreeLibrary (hUser32);
+       }
+     }
+ #endif
 +  /* First of all, send our version number for verification. */
-           fprintf (out, "-env ");
-           quote_argument (environ[i], out);
-           fprintf (out, " ");
++  SEND_STRING ("-version ");
++  SEND_STRING (VERSION);
++  SEND_STRING (" ");
 +
 +  /* Send over our environment. */
 +  if (!current_frame)
 +    {
 +      extern char **environ;
 +      int i;
 +      for (i = 0; environ[i]; i++)
 +        {
 +          char *name = xstrdup (environ[i]);
 +          char *value = strchr (name, '=');
-       char *dir = get_current_dir_name ();
-       if (dir)
-         {
-           fprintf (out, "-dir ");          
-           quote_argument (dir, out);
-           fprintf (out, "/");
-           fprintf (out, " ");
-           free (dir);
-         }
++          SEND_STRING ("-env ");
++          SEND_QUOTED (environ[i]);
++          SEND_STRING (" ");
 +        }
 +    }
 +
 +  /* Send over our current directory. */
 +  if (!current_frame)
 +    {
++      SEND_STRING ("-dir ");          
++      SEND_QUOTED (cwd);
++      SEND_STRING ("/");
++      SEND_STRING (" ");
 +    }
 +
 + retry:
    if (nowait)
-     fprintf (out, "-nowait ");
+     SEND_STRING ("-nowait ");
  
 -  if (eval)
 -    SEND_STRING ("-eval ");
 -
 +  if (current_frame)
-     fprintf (out, "-current-frame ");
++    SEND_STRING ("-current-frame ");
 +  
    if (display)
      {
-       fprintf (out, "-display ");
-       quote_argument (display, out);
-       fprintf (out, " ");
+       SEND_STRING ("-display ");
+       SEND_QUOTED (display);
+       SEND_STRING (" ");
      }
  
-           fprintf (stderr, "%s: could not get terminal name\n", progname);
 +  if (tty)
 +    {
 +      char *tty_name = ttyname (fileno (stdin));
 +      char *type = getenv ("TERM");
 +
 +      if (! tty_name)
 +        {
-           fprintf (stderr, "%s: please set the TERM variable to your terminal type\n",
++          message (TRUE, "%s: could not get terminal name\n", progname);
 +          fail ();
 +        }
 +
 +      if (! type)
 +        {
-           fprintf (stderr, "%s: opening a frame in an Emacs term buffer"
++          message (TRUE, "%s: please set the TERM variable to your terminal type\n",
 +                   progname);
 +          fail ();
 +        }
 +
 +      if (! strcmp (type, "eterm"))
 +        {
 +          /* This causes nasty, MULTI_KBOARD-related input lockouts. */
-       fprintf (out, "-tty ");
-       quote_argument (tty_name, out);
-       fprintf (out, " ");
-       quote_argument (type, out);
-       fprintf (out, " ");
++          message (TRUE, "%s: opening a frame in an Emacs term buffer"
 +                   " is not supported\n", progname);
 +          fail ();
 +        }
 +
 +      init_signals ();
 +
-     fprintf (out, "-window-system ");
++      SEND_STRING ("-tty ");
++      SEND_QUOTED (tty_name);
++      SEND_STRING (" ");
++      SEND_QUOTED (type);
++      SEND_STRING (" ");
 +    }
 +
 +  if (window_system)
++    SEND_STRING ("-window-system ");
 +
    if ((argc - optind > 0))
      {
        for (i = optind; i < argc; i++)
        {
 +          int relative = 0;
 +
          if (eval)
 -          ; /* Don't prepend any cwd or anything like that.  */
 -        else if (*argv[i] == '+')
 -          {
 +            {
-               /* Don't prepend any cwd or anything like that.  */
-               fprintf (out, "-eval ");
-               quote_argument (argv[i], out);
-               fprintf (out, " ");
++              /* Don't prepend cwd or anything like that.  */
++              SEND_STRING ("-eval ");
++              SEND_QUOTED (argv[i]);
++              SEND_STRING (" ");
 +              continue;
 +            }
 +
 +          if (*argv[i] == '+')
 +            {
              char *p = argv[i] + 1;
              while (isdigit ((unsigned char) *p) || *p == ':') p++;
 -            if (*p != 0)
 -              {
 -                SEND_QUOTED (cwd);
 -                SEND_STRING ("/");
 -              }
 -          }
 +            if (*p == 0)
 +                {
-                   fprintf (out, "-position ");
-                   quote_argument (argv[i], out);
-                   fprintf (out, " ");
++                  SEND_STRING ("-position ");
++                  SEND_QUOTED (argv[i]);
++                  SEND_STRING (" ");
 +                  continue;
 +                }
 +              else
 +                relative = 1;
 +            }
-           else if (*argv[i] != '/')
+           else if (! file_name_absolute_p (argv[i]))
 -          {
 -            SEND_QUOTED (cwd);
 -            SEND_STRING ("/");
 -          }
 -
 -        SEND_QUOTED (argv[i]);
 -        SEND_STRING (" ");
 -      }
 +            relative = 1;
 +
-           fprintf (out, "-file ");
++          SEND_STRING ("-file ");
 +          if (relative)
 +            {
-               quote_argument (cwd, out);
-               fprintf (out, "/");
++              SEND_QUOTED (cwd);
++              SEND_STRING ("/");
 +            }
-           quote_argument (argv[i], out);
-           fprintf (out, " ");
++          SEND_QUOTED (argv[i]);
++          SEND_STRING (" ");
 +        }
      }
    else
      {
 -      while (fgets (string, BUFSIZ, stdin))
 -      {
 -        SEND_QUOTED (string);
 -      }
 -      SEND_STRING (" ");
 +      if (!tty && !window_system)
 +        {
 +          while ((str = fgets (string, BUFSIZ, stdin)))
 +            {
 +              if (eval)
-                 fprintf (out, "-eval ");
++                SEND_STRING ("-eval ");
 +              else
-                 fprintf (out, "-file ");
-               quote_argument (str, out);
++                SEND_STRING ("-file ");
++              SEND_QUOTED (out);
 +            }
-           fprintf (out, " ");
++          SEND_STRING (" ");
 +        }
      }
  
-   fprintf (out, "\n");
-   fflush (out);
-   fsync (fileno (out));
+   SEND_STRING ("\n");
  
 -  /* Maybe wait for an answer.   */
 -  if (!nowait)
 +  /* Wait for an answer. */
 +  if (!eval && !tty && !nowait)
      {
 -      if (!eval)
 +      printf ("Waiting for Emacs...");
 +      needlf = 2;
 +    }
 +  fflush (stdout);
 +  fsync (1);
 +
 +  /* Now, wait for an answer and print any messages.  */
-   while ((str = fgets (string, BUFSIZ, in)))
++  while ((rl = recv (s, string, BUFSIZ, 0)) > 0)
 +    {
-       char *p = str + strlen (str) - 1;
-       while (p > str && *p == '\n')
++      char *p;
++      string[rl] = '\0';
++
++      p = string + strlen (string) - 1;
++      while (p > string && *p == '\n')
 +        *p-- = 0;
 +
-       if (strprefix ("-good-version ", str))
++      if (strprefix ("-good-version ", string))
          {
 -          printf ("Waiting for Emacs...");
 -          needlf = 2;
 +          /* -good-version: The versions match. */
          }
-       else if (strprefix ("-emacs-pid ", str))
 -      fflush (stdout);
 -
 -      /* Now, wait for an answer and print any messages.  */
 -      while ((rl = recv (s, string, BUFSIZ, 0)) > 0)
++      else if (strprefix ("-emacs-pid ", string))
 +        {
 +          /* -emacs-pid PID: The process id of the Emacs process. */
 +          emacs_pid = strtol (string + strlen ("-emacs-pid"), NULL, 10);
 +        }
-       else if (strprefix ("-window-system-unsupported ", str))
++      else if (strprefix ("-window-system-unsupported ", string))
 +        {
 +          /* -window-system-unsupported: Emacs was compiled without X
 +              support.  Try again on the terminal. */
 +          window_system = 0;
 +          nowait = 0;
 +          tty = 1;
 +          goto retry;
 +        }
-       else if (strprefix ("-print ", str))
++      else if (strprefix ("-print ", string))
          {
 -        string[rl] = '\0';
 -          if (needlf == 2)
 +          /* -print STRING: Print STRING on the terminal. */
-           str = unquote_argument (str + strlen ("-print "));
++          str = unquote_argument (string + strlen ("-print "));
 +          if (needlf)
              printf ("\n");
 -        printf ("%s", string);
 -        needlf = string[0] == '\0' ? needlf : string[strlen (string) - 1] != '\n';
 +          printf ("%s", str);
 +          needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
 +        }
-       else if (strprefix ("-error ", str))
++      else if (strprefix ("-error ", string))
 +        {
 +          /* -error DESCRIPTION: Signal an error on the terminal. */
-           str = unquote_argument (str + strlen ("-error "));
++          str = unquote_argument (string + strlen ("-error "));
 +          if (needlf)
 +            printf ("\n");
-           printf ("*ERROR*: %s", str);
++          fprintf (stderr, "*ERROR*: %s", str);
 +          needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
 +        }
 +      else if (strprefix ("-suspend ", str))
 +        {
 +          /* -suspend: Suspend this terminal, i.e., stop the process. */
 +          if (needlf)
 +            printf ("\n");
 +          needlf = 0;
 +          kill (0, SIGSTOP);
 +        }
 +      else
 +        {
 +          /* Unknown command. */
 +          if (needlf)
 +            printf ("\n");
-           printf ("*ERROR*: Unknown message: %s", str);
-           needlf = str[0] == '\0' ? needlf : str[strlen (str) - 1] != '\n';
++          printf ("*ERROR*: Unknown message: %s", string);
++          needlf = string[0] == '\0' ? needlf : string[strlen (string) - 1] != '\n';
          }
 -
 -      if (needlf)
 -        printf ("\n");
 -      fflush (stdout);
      }
  
 +  if (needlf)
 +    printf ("\n");
 +  fflush (stdout);
 +  fsync (1);
 +
+   CLOSE_SOCKET (s);
    return EXIT_SUCCESS;
  }
  
- #endif /* HAVE_SOCKETS */
+ #endif /* HAVE_SOCKETS && HAVE_INET_SOCKETS */
 +\f
  #ifndef HAVE_STRERROR
  char *
  strerror (errnum)
diff --cc lib-src/etags.c
index 49a18be1df55a09296dfca97c29b887caa1591d4,c3578a4b1ad2d4c3928a5c9cc872801b2a04fcd2..26dac368b4d9b4d67ee10fcf6c71fda0b96abfef
@@@ -41,7 -41,7 +41,7 @@@
   * configuration file containing regexp definitions for etags.
   */
  
- char pot_etags_version[] = "@(#) pot revision number is 17.20";
 -char pot_etags_version[] = "@(#) pot revision number is $Revision: 17.22 $";
++char pot_etags_version[] = "@(#) pot revision number is $Revision: 3.61 $";
  
  #define       TRUE    1
  #define       FALSE   0
Simple merge
Simple merge
diff --cc lisp/faces.el
Simple merge
diff --cc lisp/files.el
Simple merge
Simple merge
Simple merge
Simple merge
index 8e5975e79cbc57472f4c2bc2031bacfec3eb90c0,8407815621f2917a405ebdc9e2d0342aa64980bb..f7d8d4612c1ca627c35c5219264dee6f17c60fd2
@@@ -81,7 -81,7 +81,7 @@@ Display alphabetical listing of ABBREV-
  ;;;***
  \f
  ;;;### (autoloads (ada-mode ada-add-extensions) "ada-mode" "progmodes/ada-mode.el"
- ;;;;;;  (17778 49121))
 -;;;;;;  (17759 28871))
++;;;;;;  (17778 50475))
  ;;; Generated autoloads from progmodes/ada-mode.el
  
  (autoload (quote ada-add-extensions) "ada-mode" "\
@@@ -142,7 -142,7 +142,7 @@@ If you use ada-xref.el
  ;;;***
  \f
  ;;;### (autoloads (ada-header) "ada-stmt" "progmodes/ada-stmt.el"
- ;;;;;;  (17390 27404))
 -;;;;;;  (17759 28871))
++;;;;;;  (17778 50475))
  ;;; Generated autoloads from progmodes/ada-stmt.el
  
  (autoload (quote ada-header) "ada-stmt" "\
@@@ -153,7 -153,7 +153,7 @@@ Insert a descriptive header at the top 
  ;;;***
  \f
  ;;;### (autoloads (ada-find-file) "ada-xref" "progmodes/ada-xref.el"
- ;;;;;;  (17778 48451))
 -;;;;;;  (17759 28871))
++;;;;;;  (17778 50475))
  ;;; Generated autoloads from progmodes/ada-xref.el
  
  (autoload (quote ada-find-file) "ada-xref" "\
@@@ -168,7 -168,7 +168,7 @@@ Completion is available
  ;;;;;;  change-log-mode add-change-log-entry-other-window add-change-log-entry
  ;;;;;;  find-change-log prompt-for-change-log-name add-log-mailing-address
  ;;;;;;  add-log-full-name add-log-current-defun-function) "add-log"
- ;;;;;;  "add-log.el" (17713 5989))
 -;;;;;;  "add-log.el" (17746 34860))
++;;;;;;  "add-log.el" (17778 50472))
  ;;; Generated autoloads from add-log.el
  
  (defvar add-log-current-defun-function nil "\
@@@ -524,7 -524,7 +524,7 @@@ A replacement function for `newline-and
  ;;;***
  \f
  ;;;### (autoloads (outlineify-sticky allout-mode) "allout" "allout.el"
- ;;;;;;  (17713 5989))
 -;;;;;;  (17759 28868))
++;;;;;;  (17778 50472))
  ;;; Generated autoloads from allout.el
  
  (put (quote allout-show-bodies) (quote safe-local-variable) (if (fboundp (quote booleanp)) (quote booleanp) (quote (lambda (x) (member x (quote (t nil)))))))
@@@ -983,7 -983,7 +983,7 @@@ ARG is positive, otherwise off
  \f
  ;;;### (autoloads (apropos-documentation apropos-value apropos apropos-documentation-property
  ;;;;;;  apropos-command apropos-variable apropos-read-pattern) "apropos"
- ;;;;;;  "apropos.el" (17713 5989))
 -;;;;;;  "apropos.el" (17746 34860))
++;;;;;;  "apropos.el" (17778 50472))
  ;;; Generated autoloads from apropos.el
  
  (autoload (quote apropos-read-pattern) "apropos" "\
@@@ -1422,7 -1406,7 +1422,7 @@@ This command is obsolete
  ;;;***
  \f
  ;;;### (autoloads (autoarg-kp-mode autoarg-mode) "autoarg" "autoarg.el"
- ;;;;;;  (17390 26935))
 -;;;;;;  (17504 41540))
++;;;;;;  (17778 50472))
  ;;; Generated autoloads from autoarg.el
  
  (defvar autoarg-mode nil "\
@@@ -1470,7 -1451,7 +1467,7 @@@ Toggle Autoarg-KP minor mode globally
  With ARG, turn Autoarg mode on if ARG is positive, off otherwise.
  \\<autoarg-kp-mode-map>
  This is similar to \\[autoarg-mode] but rebinds the keypad keys `kp-1'
--&c to supply digit arguments.
++etc. to supply digit arguments.
  
  \\{autoarg-kp-mode-map}
  
@@@ -1698,7 -1680,7 +1695,7 @@@ Vectors work just like lists.  Nested b
  ;;;***
  \f
  ;;;### (autoloads (display-battery-mode battery) "battery" "battery.el"
- ;;;;;;  (17505 62422))
 -;;;;;;  (17746 34860))
++;;;;;;  (17778 50472))
  ;;; Generated autoloads from battery.el
   (put 'battery-mode-line-string 'risky-local-variable t)
  
@@@ -1761,8 -1744,8 +1759,8 @@@ non-interactive use see also `benchmark
  
  ;;;***
  \f
- ;;;### (autoloads (bibtex-mode) "bibtex" "textmodes/bibtex.el" (17549
- ;;;;;;  4608))
 -;;;### (autoloads (bibtex-mode) "bibtex" "textmodes/bibtex.el" (17746
 -;;;;;;  34862))
++;;;### (autoloads (bibtex-mode) "bibtex" "textmodes/bibtex.el" (17778
++;;;;;;  50479))
  ;;; Generated autoloads from textmodes/bibtex.el
  
  (autoload (quote bibtex-mode) "bibtex" "\
@@@ -2508,7 -2491,7 +2506,7 @@@ Return a vector containing the lines fr
  ;;;***
  \f
  ;;;### (autoloads (bs-show bs-customize bs-cycle-previous bs-cycle-next)
- ;;;;;;  "bs" "bs.el" (17396 42170))
 -;;;;;;  "bs" "bs.el" (17759 28868))
++;;;;;;  "bs" "bs.el" (17778 50472))
  ;;; Generated autoloads from bs.el
  
  (autoload (quote bs-cycle-next) "bs" "\
@@@ -2638,7 -2621,7 +2636,7 @@@ Also see `make-text-button'
  ;;;;;;  batch-byte-compile-if-not-done display-call-tree byte-compile
  ;;;;;;  compile-defun byte-compile-file byte-recompile-directory
  ;;;;;;  byte-force-recompile byte-compile-warnings-safe-p) "bytecomp"
- ;;;;;;  "emacs-lisp/bytecomp.el" (17591 9570))
 -;;;;;;  "emacs-lisp/bytecomp.el" (17759 30016))
++;;;;;;  "emacs-lisp/bytecomp.el" (17778 50473))
  ;;; Generated autoloads from emacs-lisp/bytecomp.el
  (put 'byte-compile-dynamic 'safe-local-variable 'booleanp)
  (put 'byte-compile-dynamic-docstrings 'safe-local-variable 'booleanp)
@@@ -2742,7 -2725,7 +2740,7 @@@ and corresponding effects
  
  ;;;***
  \f
- ;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (17390 27324))
 -;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (17759 28868))
++;;;### (autoloads nil "cal-dst" "calendar/cal-dst.el" (17778 50472))
  ;;; Generated autoloads from calendar/cal-dst.el
  
  (put (quote calendar-daylight-savings-starts) (quote risky-local-variable) t)
@@@ -2874,7 -2857,7 +2872,7 @@@ See the documentation for `calculator-m
  ;;;;;;  mark-holidays-in-calendar view-calendar-holidays-initially
  ;;;;;;  calendar-remove-frame-by-deleting mark-diary-entries-in-calendar
  ;;;;;;  view-diary-entries-initially calendar-offset) "calendar"
- ;;;;;;  "calendar/calendar.el" (17713 5989))
 -;;;;;;  "calendar/calendar.el" (17732 62701))
++;;;;;;  "calendar/calendar.el" (17778 50296))
  ;;; Generated autoloads from calendar/calendar.el
  
  (defvar calendar-offset 0 "\
@@@ -3700,7 -3683,7 +3698,7 @@@ and exists only for compatibility reaso
  
  ;;;***
  \f
- ;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (17524 8597))
 -;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (17522 22309))
++;;;### (autoloads nil "cc-vars" "progmodes/cc-vars.el" (17778 50475))
  ;;; Generated autoloads from progmodes/cc-vars.el
  (put 'c-basic-offset 'safe-local-variable 'integerp)
  (put 'c-backslash-column 'safe-local-variable 'integerp)
@@@ -3991,7 -3974,7 +3989,7 @@@ to the action header
  ;;;;;;  checkdoc-comments checkdoc-continue checkdoc-start checkdoc-current-buffer
  ;;;;;;  checkdoc-eval-current-buffer checkdoc-message-interactive
  ;;;;;;  checkdoc-interactive checkdoc) "checkdoc" "emacs-lisp/checkdoc.el"
- ;;;;;;  (17713 5989))
 -;;;;;;  (17746 34861))
++;;;;;;  (17778 50473))
  ;;; Generated autoloads from emacs-lisp/checkdoc.el
  
  (autoload (quote checkdoc) "checkdoc" "\
@@@ -4431,7 -4414,7 +4429,7 @@@ read/written by MS-DOS software, or fo
  ;;;### (autoloads (comint-redirect-results-list-from-process comint-redirect-results-list
  ;;;;;;  comint-redirect-send-command-to-process comint-redirect-send-command
  ;;;;;;  comint-run make-comint make-comint-in-buffer) "comint" "comint.el"
- ;;;;;;  (17713 5989))
 -;;;;;;  (17759 29233))
++;;;;;;  (17778 50473))
  ;;; Generated autoloads from comint.el
  
  (defvar comint-output-filter-functions (quote (comint-postoutput-scroll-to-bottom comint-watch-for-password-prompt)) "\
@@@ -4559,7 -4542,7 +4557,7 @@@ on third call it again advances points 
  ;;;;;;  compilation-shell-minor-mode compilation-mode compilation-start
  ;;;;;;  compile compilation-disable-input compile-command compilation-search-path
  ;;;;;;  compilation-ask-about-save compilation-window-height compilation-mode-hook)
- ;;;;;;  "compile" "progmodes/compile.el" (17713 5991))
 -;;;;;;  "compile" "progmodes/compile.el" (17759 29277))
++;;;;;;  "compile" "progmodes/compile.el" (17778 50475))
  ;;; Generated autoloads from progmodes/compile.el
  
  (defvar compilation-mode-hook nil "\
@@@ -5223,7 -5206,7 +5221,7 @@@ Insert a copyright by $ORGANIZATION not
  ;;;***
  \f
  ;;;### (autoloads (cperl-perldoc-at-point cperl-perldoc cperl-mode)
- ;;;;;;  "cperl-mode" "progmodes/cperl-mode.el" (17778 49122))
 -;;;;;;  "cperl-mode" "progmodes/cperl-mode.el" (17759 28873))
++;;;;;;  "cperl-mode" "progmodes/cperl-mode.el" (17778 50475))
  ;;; Generated autoloads from progmodes/cperl-mode.el
  
  (autoload (quote cperl-mode) "cperl-mode" "\
@@@ -5559,7 -5542,7 +5557,7 @@@ Enable CUA selection mode without the C
  ;;;;;;  customize-face customize-changed-options customize-option-other-window
  ;;;;;;  customize-option customize-group-other-window customize-group
  ;;;;;;  customize-mode customize customize-save-variable customize-set-variable
- ;;;;;;  customize-set-value) "cus-edit" "cus-edit.el" (17713 5989))
 -;;;;;;  customize-set-value) "cus-edit" "cus-edit.el" (17759 28868))
++;;;;;;  customize-set-value) "cus-edit" "cus-edit.el" (17778 50473))
  ;;; Generated autoloads from cus-edit.el
   (add-hook 'same-window-regexps "\\`\\*Customiz.*\\*\\'")
  
@@@ -6430,7 -6411,7 +6428,7 @@@ the first time the mode is used
  ;;;***
  \f
  ;;;### (autoloads (describe-char describe-text-properties) "descr-text"
- ;;;;;;  "descr-text.el" (17390 26936))
 -;;;;;;  "descr-text.el" (17504 41540))
++;;;;;;  "descr-text.el" (17778 50473))
  ;;; Generated autoloads from descr-text.el
  
  (autoload (quote describe-text-properties) "descr-text" "\
@@@ -6770,7 -6751,7 +6768,7 @@@ With prefix arg, prompt for diff switch
  ;;;***
  \f
  ;;;### (autoloads (diff-minor-mode diff-mode) "diff-mode" "diff-mode.el"
- ;;;;;;  (17713 5989))
 -;;;;;;  (17672 28070))
++;;;;;;  (17778 50473))
  ;;; Generated autoloads from diff-mode.el
  
  (autoload (quote diff-mode) "diff-mode" "\
@@@ -6800,7 -6781,7 +6798,7 @@@ Minor mode for viewing/editing context 
  ;;;;;;  dired dired-copy-preserve-time dired-dwim-target dired-keep-marker-symlink
  ;;;;;;  dired-keep-marker-hardlink dired-keep-marker-copy dired-keep-marker-rename
  ;;;;;;  dired-trivial-filenames dired-ls-F-marks-symlinks dired-listing-switches)
- ;;;;;;  "dired" "dired.el" (17713 5989))
 -;;;;;;  "dired" "dired.el" (17746 34860))
++;;;;;;  "dired" "dired.el" (17778 50473))
  ;;; Generated autoloads from dired.el
  
  (defvar dired-listing-switches "-al" "\
@@@ -7005,7 -6986,7 +7003,7 @@@ Keybindings
  ;;;;;;  dired-run-shell-command dired-do-shell-command dired-clean-directory
  ;;;;;;  dired-do-print dired-do-touch dired-do-chown dired-do-chgrp
  ;;;;;;  dired-do-chmod dired-compare-directories dired-backup-diff
- ;;;;;;  dired-diff) "dired-aux" "dired-aux.el" (17778 48817))
 -;;;;;;  dired-diff) "dired-aux" "dired-aux.el" (17746 34860))
++;;;;;;  dired-diff) "dired-aux" "dired-aux.el" (17778 50473))
  ;;; Generated autoloads from dired-aux.el
  
  (autoload (quote dired-diff) "dired-aux" "\
@@@ -7469,7 -7450,7 +7467,7 @@@ redefine OBJECT if it is a symbol
  ;;;;;;  standard-display-graphic standard-display-g1 standard-display-ascii
  ;;;;;;  standard-display-default standard-display-8bit describe-current-display-table
  ;;;;;;  describe-display-table set-display-table-slot display-table-slot
- ;;;;;;  make-display-table) "disp-table" "disp-table.el" (17390 26937))
 -;;;;;;  make-display-table) "disp-table" "disp-table.el" (17504 41540))
++;;;;;;  make-display-table) "disp-table" "disp-table.el" (17778 50473))
  ;;; Generated autoloads from disp-table.el
  
  (autoload (quote make-display-table) "disp-table" "\
@@@ -7663,7 -7644,7 +7661,7 @@@ when pressed twice.  See variable `doub
  
  ;;;***
  \f
- ;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (17591 9445))
 -;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (17746 34862))
++;;;### (autoloads (dunnet) "dunnet" "play/dunnet.el" (17778 50475))
  ;;; Generated autoloads from play/dunnet.el
  
  (autoload (quote dunnet) "dunnet" "\
@@@ -7686,7 -7667,7 +7684,7 @@@ Play sounds in message buffers
  \f
  ;;;### (autoloads (easy-mmode-defsyntax easy-mmode-defmap easy-mmode-define-keymap
  ;;;;;;  define-global-minor-mode define-minor-mode) "easy-mmode"
- ;;;;;;  "emacs-lisp/easy-mmode.el" (17713 5989))
 -;;;;;;  "emacs-lisp/easy-mmode.el" (17656 34193))
++;;;;;;  "emacs-lisp/easy-mmode.el" (17778 50473))
  ;;; Generated autoloads from emacs-lisp/easy-mmode.el
  
  (defalias (quote easy-mmode-define-minor-mode) (quote define-minor-mode))
@@@ -7924,7 -7905,7 +7922,7 @@@ To implement dynamic menus, either cal
  ;;;;;;  ebnf-eps-directory ebnf-spool-region ebnf-spool-buffer ebnf-spool-file
  ;;;;;;  ebnf-spool-directory ebnf-print-region ebnf-print-buffer
  ;;;;;;  ebnf-print-file ebnf-print-directory ebnf-customize) "ebnf2ps"
- ;;;;;;  "progmodes/ebnf2ps.el" (17713 5991))
 -;;;;;;  "progmodes/ebnf2ps.el" (17759 28873))
++;;;;;;  "progmodes/ebnf2ps.el" (17778 50475))
  ;;; Generated autoloads from progmodes/ebnf2ps.el
  
  (autoload (quote ebnf-customize) "ebnf2ps" "\
@@@ -8335,7 -8316,7 +8333,7 @@@ Display statistics for a class tree
  ;;;***
  \f
  ;;;### (autoloads (electric-buffer-list) "ebuff-menu" "ebuff-menu.el"
- ;;;;;;  (17390 26937))
 -;;;;;;  (17504 41540))
++;;;;;;  (17778 50473))
  ;;; Generated autoloads from ebuff-menu.el
  
  (autoload (quote electric-buffer-list) "ebuff-menu" "\
@@@ -8446,7 -8427,7 +8444,7 @@@ Toggle edebugging of all forms
  ;;;;;;  ediff-merge-directory-revisions ediff-merge-directories-with-ancestor
  ;;;;;;  ediff-merge-directories ediff-directories3 ediff-directory-revisions
  ;;;;;;  ediff-directories ediff-buffers3 ediff-buffers ediff-backup
- ;;;;;;  ediff-files3 ediff-files) "ediff" "ediff.el" (17778 49123))
 -;;;;;;  ediff-files3 ediff-files) "ediff" "ediff.el" (17759 28868))
++;;;;;;  ediff-files3 ediff-files) "ediff" "ediff.el" (17778 50473))
  ;;; Generated autoloads from ediff.el
  
  (autoload (quote ediff-files) "ediff" "\
@@@ -8812,7 -8793,7 +8810,7 @@@ Turn on EDT Emulation
  ;;;***
  \f
  ;;;### (autoloads (electric-helpify with-electric-help) "ehelp" "ehelp.el"
- ;;;;;;  (17390 26937))
 -;;;;;;  (17504 41540))
++;;;;;;  (17778 50473))
  ;;; Generated autoloads from ehelp.el
  
  (autoload (quote with-electric-help) "ehelp" "\
@@@ -8951,7 -8932,7 +8949,7 @@@ displayed
  ;;;***
  \f
  ;;;### (autoloads (report-emacs-bug) "emacsbug" "mail/emacsbug.el"
- ;;;;;;  (17444 1970))
 -;;;;;;  (17746 34862))
++;;;;;;  (17778 50475))
  ;;; Generated autoloads from mail/emacsbug.el
  
  (autoload (quote report-emacs-bug) "emacsbug" "\
@@@ -9057,7 -9054,7 +9055,7 @@@ DISPLAY may be a display id, a frame, o
  ;;;***
  \f
  ;;;### (autoloads (enriched-decode enriched-encode enriched-mode)
- ;;;;;;  "enriched" "textmodes/enriched.el" (17390 26946))
 -;;;;;;  "enriched" "textmodes/enriched.el" (17746 34862))
++;;;;;;  "enriched" "textmodes/enriched.el" (17778 50479))
  ;;; Generated autoloads from textmodes/enriched.el
  
  (autoload (quote enriched-mode) "enriched" "\
@@@ -9087,8 -9084,8 +9085,8 @@@ Not documente
  
  ;;;***
  \f
--;;;### (autoloads (erc-handle-irc-url erc-select erc-select-read-args)
- ;;;;;;  "erc" "erc/erc.el" (17713 4881))
 -;;;;;;  "erc" "erc/erc.el" (17746 35371))
++;;;### (autoloads (erc-handle-irc-url erc erc-select-read-args) "erc"
++;;;;;;  "erc/erc.el" (17778 50473))
  ;;; Generated autoloads from erc/erc.el
  
  (autoload (quote erc-select-read-args) "erc" "\
@@@ -9096,7 -9093,7 +9094,7 @@@ Prompt the user for values of nick, ser
  
  \(fn)" nil nil)
  
--(autoload (quote erc-select) "erc" "\
++(autoload (quote erc) "erc" "\
  Select connection parameters and run ERC.
  Non-interactively, it takes keyword arguments
     (server (erc-compute-server))
  
  That is, if called with
  
--   (erc-select :server \"irc.freenode.net\" :full-name \"Harry S Truman\")
++   (erc :server \"irc.freenode.net\" :full-name \"Harry S Truman\")
  
  server and full-name will be set to those values, whereas
  `erc-compute-port', `erc-compute-nick' and `erc-compute-full-name' will
@@@ -9124,8 -9121,8 +9122,8 @@@ Otherwise, connect to HOST:PORT as USE
  
  ;;;***
  \f
- ;;;### (autoloads nil "erc-autoaway" "erc/erc-autoaway.el" (17591
- ;;;;;;  9873))
 -;;;### (autoloads nil "erc-autoaway" "erc/erc-autoaway.el" (17746
 -;;;;;;  34861))
++;;;### (autoloads nil "erc-autoaway" "erc/erc-autoaway.el" (17778
++;;;;;;  50473))
  ;;; Generated autoloads from erc/erc-autoaway.el
   (autoload 'erc-autoaway-mode "erc-autoaway")
  
  
  ;;;***
  \f
- ;;;### (autoloads nil "erc-compat" "erc/erc-compat.el" (17374 21559))
 -;;;### (autoloads nil "erc-compat" "erc/erc-compat.el" (17504 41540))
++;;;### (autoloads nil "erc-compat" "erc/erc-compat.el" (17778 50473))
  ;;; Generated autoloads from erc/erc-compat.el
   (autoload 'erc-define-minor-mode "erc-compat")
  
  ;;;***
  \f
  ;;;### (autoloads (erc-ctcp-query-DCC pcomplete/erc-mode/DCC erc-cmd-DCC)
- ;;;;;;  "erc-dcc" "erc/erc-dcc.el" (17396 42163))
 -;;;;;;  "erc-dcc" "erc/erc-dcc.el" (17746 34861))
++;;;;;;  "erc-dcc" "erc/erc-dcc.el" (17778 50473))
  ;;; Generated autoloads from erc/erc-dcc.el
  
  (autoload (quote erc-cmd-DCC) "erc-dcc" "\
@@@ -9238,8 -9235,8 +9236,8 @@@ Add EZBouncer convenience functions to 
  
  ;;;***
  \f
- ;;;### (autoloads (erc-fill) "erc-fill" "erc/erc-fill.el" (17396
- ;;;;;;  42158))
 -;;;### (autoloads (erc-fill) "erc-fill" "erc/erc-fill.el" (17504
 -;;;;;;  41540))
++;;;### (autoloads (erc-fill) "erc-fill" "erc/erc-fill.el" (17778
++;;;;;;  50473))
  ;;; Generated autoloads from erc/erc-fill.el
   (autoload 'erc-fill-mode "erc-fill" nil t)
  
@@@ -9319,7 -9316,7 +9317,7 @@@ to RFC and send the LIST header (#321) 
  ;;;***
  \f
  ;;;### (autoloads (erc-save-buffer-in-logs erc-logging-enabled) "erc-log"
- ;;;;;;  "erc/erc-log.el" (17713 4879))
 -;;;;;;  "erc/erc-log.el" (17623 45181))
++;;;;;;  "erc/erc-log.el" (17778 50473))
  ;;; Generated autoloads from erc/erc-log.el
   (autoload 'erc-log-mode "erc-log" nil t)
  
@@@ -9410,7 -9407,7 +9408,7 @@@ Show who's gone
  ;;;***
  \f
  ;;;### (autoloads (erc-server-select erc-determine-network) "erc-networks"
- ;;;;;;  "erc/erc-networks.el" (17396 42158))
 -;;;;;;  "erc/erc-networks.el" (17504 41540))
++;;;;;;  "erc/erc-networks.el" (17778 50473))
  ;;; Generated autoloads from erc/erc-networks.el
  
  (autoload (quote erc-determine-network) "erc-networks" "\
@@@ -9459,7 -9456,7 +9457,7 @@@ Not documente
  
  ;;;***
  \f
- ;;;### (autoloads nil "erc-replace" "erc/erc-replace.el" (17396 42158))
 -;;;### (autoloads nil "erc-replace" "erc/erc-replace.el" (17504 41540))
++;;;### (autoloads nil "erc-replace" "erc/erc-replace.el" (17778 50473))
  ;;; Generated autoloads from erc/erc-replace.el
   (autoload 'erc-replace-mode "erc-replace")
  
@@@ -9489,7 -9486,7 +9487,7 @@@ When called interactively, read the pas
  
  ;;;***
  \f
- ;;;### (autoloads nil "erc-sound" "erc/erc-sound.el" (17396 42158))
 -;;;### (autoloads nil "erc-sound" "erc/erc-sound.el" (17504 41540))
++;;;### (autoloads nil "erc-sound" "erc/erc-sound.el" (17778 50473))
  ;;; Generated autoloads from erc/erc-sound.el
   (autoload 'erc-sound-mode "erc-sound")
  
@@@ -9520,7 -9517,7 +9518,7 @@@ This will add a speedbar major display 
  
  ;;;***
  \f
- ;;;### (autoloads nil "erc-track" "erc/erc-track.el" (17591 9873))
 -;;;### (autoloads nil "erc-track" "erc/erc-track.el" (17592 59703))
++;;;### (autoloads nil "erc-track" "erc/erc-track.el" (17778 50473))
  ;;; Generated autoloads from erc/erc-track.el
   (autoload 'erc-track-mode "erc-track" nil t)
   (autoload 'erc-track-when-inactive-mode "erc-track" nil t)
  ;;;***
  \f
  ;;;### (autoloads (erc-truncate-buffer erc-truncate-buffer-to-size)
- ;;;;;;  "erc-truncate" "erc/erc-truncate.el" (17396 42158))
 -;;;;;;  "erc-truncate" "erc/erc-truncate.el" (17746 34861))
++;;;;;;  "erc-truncate" "erc/erc-truncate.el" (17778 50473))
  ;;; Generated autoloads from erc/erc-truncate.el
   (autoload 'erc-truncate-mode "erc-truncate" nil t)
  
@@@ -10317,7 -10314,7 +10315,7 @@@ file modes
  ;;;***
  \f
  ;;;### (autoloads (expand-jump-to-next-slot expand-jump-to-previous-slot
- ;;;;;;  expand-add-abbrevs) "expand" "expand.el" (17390 26939))
 -;;;;;;  expand-add-abbrevs) "expand" "expand.el" (17746 34860))
++;;;;;;  expand-add-abbrevs) "expand" "expand.el" (17778 50473))
  ;;; Generated autoloads from expand.el
  
  (autoload (quote expand-add-abbrevs) "expand" "\
@@@ -10360,7 -10357,7 +10358,7 @@@ This is used only in conjunction with `
  
  ;;;***
  \f
- ;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (17390 27324))
 -;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (17759 28873))
++;;;### (autoloads (f90-mode) "f90" "progmodes/f90.el" (17778 50475))
  ;;; Generated autoloads from progmodes/f90.el
  
  (autoload (quote f90-mode) "f90" "\
@@@ -10427,7 -10424,7 +10425,7 @@@ with no args, if that value is non-nil
  ;;;;;;  facemenu-remove-all facemenu-remove-face-props facemenu-set-read-only
  ;;;;;;  facemenu-set-intangible facemenu-set-invisible facemenu-set-face-from-menu
  ;;;;;;  facemenu-set-background facemenu-set-foreground facemenu-set-face)
- ;;;;;;  "facemenu" "facemenu.el" (17778 48817))
 -;;;;;;  "facemenu" "facemenu.el" (17718 30634))
++;;;;;;  "facemenu" "facemenu.el" (17778 50473))
  ;;; Generated autoloads from facemenu.el
   (define-key global-map "\M-o" 'facemenu-keymap)
   (autoload 'facemenu-keymap "facemenu" "Keymap for face-changing commands." t 'keymap)
@@@ -10636,7 -10593,7 +10634,7 @@@ Unconditionally turn on Fast Lock mode
  \f
  ;;;### (autoloads (feedmail-queue-reminder feedmail-run-the-queue
  ;;;;;;  feedmail-run-the-queue-global-prompt feedmail-run-the-queue-no-prompts
- ;;;;;;  feedmail-send-it) "feedmail" "mail/feedmail.el" (17713 5990))
 -;;;;;;  feedmail-send-it) "feedmail" "mail/feedmail.el" (17746 34862))
++;;;;;;  feedmail-send-it) "feedmail" "mail/feedmail.el" (17778 50475))
  ;;; Generated autoloads from mail/feedmail.el
  
  (autoload (quote feedmail-send-it) "feedmail" "\
@@@ -10690,7 -10647,7 +10688,7 @@@ you can set `feedmail-queue-reminder-al
  ;;;***
  \f
  ;;;### (autoloads (ffap-bindings dired-at-point ffap-at-mouse ffap-menu
- ;;;;;;  find-file-at-point ffap-next) "ffap" "ffap.el" (17713 5989))
 -;;;;;;  find-file-at-point ffap-next) "ffap" "ffap.el" (17746 34860))
++;;;;;;  find-file-at-point ffap-next) "ffap" "ffap.el" (17778 50473))
  ;;; Generated autoloads from ffap.el
  
  (autoload (quote ffap-next) "ffap" "\
@@@ -10820,7 -10777,7 +10818,7 @@@ Set up hooks, load the cache file -- i
  
  ;;;***
  \f
- ;;;### (autoloads nil "fill" "textmodes/fill.el" (17713 5992))
 -;;;### (autoloads nil "fill" "textmodes/fill.el" (17746 34862))
++;;;### (autoloads nil "fill" "textmodes/fill.el" (17778 50479))
  ;;; Generated autoloads from textmodes/fill.el
  (put 'colon-double-space 'safe-local-variable 'booleanp)
  
@@@ -10983,7 -10940,7 +10981,7 @@@ Visit the file you click on in another 
  ;;;;;;  find-variable find-variable-noselect find-function-other-frame
  ;;;;;;  find-function-other-window find-function find-function-noselect
  ;;;;;;  find-function-search-for-symbol find-library) "find-func"
- ;;;;;;  "emacs-lisp/find-func.el" (17713 5989))
 -;;;;;;  "emacs-lisp/find-func.el" (17746 34861))
++;;;;;;  "emacs-lisp/find-func.el" (17778 50473))
  ;;; Generated autoloads from emacs-lisp/find-func.el
  
  (autoload (quote find-library) "find-func" "\
@@@ -11218,7 -11175,7 +11216,7 @@@ Not documente
  ;;;***
  \f
  ;;;### (autoloads (flymake-mode-off flymake-mode-on flymake-mode)
- ;;;;;;  "flymake" "progmodes/flymake.el" (17778 48451))
 -;;;;;;  "flymake" "progmodes/flymake.el" (17715 55646))
++;;;;;;  "flymake" "progmodes/flymake.el" (17778 50475))
  ;;; Generated autoloads from progmodes/flymake.el
  
  (autoload (quote flymake-mode) "flymake" "\
@@@ -11242,7 -11199,7 +11240,7 @@@ Turn flymake mode off
  \f
  ;;;### (autoloads (flyspell-buffer flyspell-region flyspell-mode-off
  ;;;;;;  turn-off-flyspell turn-on-flyspell flyspell-mode flyspell-prog-mode)
- ;;;;;;  "flyspell" "textmodes/flyspell.el" (17778 49123))
 -;;;;;;  "flyspell" "textmodes/flyspell.el" (17759 28874))
++;;;;;;  "flyspell" "textmodes/flyspell.el" (17778 50479))
  ;;; Generated autoloads from textmodes/flyspell.el
  
  (autoload (quote flyspell-prog-mode) "flyspell" "\
@@@ -11311,7 -11268,7 +11309,7 @@@ Flyspell whole buffer
  \f
  ;;;### (autoloads (follow-delete-other-windows-and-split follow-mode
  ;;;;;;  turn-off-follow-mode turn-on-follow-mode) "follow" "follow.el"
- ;;;;;;  (17490 7930))
 -;;;;;;  (17746 34860))
++;;;;;;  (17778 50473))
  ;;; Generated autoloads from follow.el
  
  (autoload (quote turn-on-follow-mode) "follow" "\
@@@ -11444,7 -11401,7 +11442,7 @@@ Visit a file in Forms mode in other win
  ;;;***
  \f
  ;;;### (autoloads (fortran-mode fortran-tab-mode-default) "fortran"
- ;;;;;;  "progmodes/fortran.el" (17374 21266))
 -;;;;;;  "progmodes/fortran.el" (17658 57872))
++;;;;;;  "progmodes/fortran.el" (17778 50475))
  ;;; Generated autoloads from progmodes/fortran.el
  
  (defvar fortran-tab-mode-default nil "\
@@@ -11580,7 -11537,7 +11578,7 @@@ and choose the directory as the fortune
  ;;;***
  \f
  ;;;### (autoloads (gdb-enable-debug gdba) "gdb-ui" "progmodes/gdb-ui.el"
- ;;;;;;  (17778 49122))
 -;;;;;;  (17759 28873))
++;;;;;;  (17778 50475))
  ;;; Generated autoloads from progmodes/gdb-ui.el
  
  (autoload (quote gdba) "gdb-ui" "\
@@@ -11719,7 -11676,7 +11717,7 @@@ regular expression that can be used as 
  ;;;***
  \f
  ;;;### (autoloads (glasses-mode) "glasses" "progmodes/glasses.el"
- ;;;;;;  (17407 3111))
 -;;;;;;  (17504 41540))
++;;;;;;  (17778 50476))
  ;;; Generated autoloads from progmodes/glasses.el
  
  (autoload (quote glasses-mode) "glasses" "\
@@@ -11779,37 -11736,10 +11777,10 @@@ DEFAULT-MAP specifies the default key m
  ;;;***
  \f
  ;;;### (autoloads (gnus gnus-other-frame gnus-slave gnus-no-server
- ;;;;;;  gnus-slave-no-server gnus-select-method gnus-getenv-nntpserver)
- ;;;;;;  "gnus" "gnus/gnus.el" (17778 49126))
 -;;;;;;  gnus-slave-no-server) "gnus" "gnus/gnus.el" (17759 28869))
++;;;;;;  gnus-slave-no-server) "gnus" "gnus/gnus.el" (17778 50473))
  ;;; Generated autoloads from gnus/gnus.el
- (autoload (quote gnus-getenv-nntpserver) "gnus" "\
- Find default nntp server.
- Check the NNTPSERVER environment variable and the
- `gnus-nntpserver-file' file.
- \(fn)" nil nil)
- (defvar gnus-select-method (condition-case nil (nconc (list (quote nntp) (or (condition-case nil (gnus-getenv-nntpserver) (error nil)) (when (and gnus-default-nntp-server (not (string= gnus-default-nntp-server ""))) gnus-default-nntp-server) "news")) (if (or (null gnus-nntp-service) (equal gnus-nntp-service "nntp")) nil (list gnus-nntp-service))) (error nil)) "\
- Default method for selecting a newsgroup.
- This variable should be a list, where the first element is how the
- news is to be fetched, the second is the address.
- For instance, if you want to get your news via \"flab.flab.edu\" using
- NNTP, you could say:
- \(setq gnus-select-method '(nntp \"flab.flab.edu\"))
- If you want to use your local spool, say:
- \(setq gnus-select-method (list 'nnspool (system-name)))
- If you use this variable, you must set `gnus-nntp-server' to nil.
- There is a lot more to know about select methods and virtual servers -
- see the manual for details.")
- (custom-autoload (quote gnus-select-method) "gnus" t)
+ (when (fboundp 'custom-autoload)
+  (custom-autoload 'gnus-select-method "gnus"))
  
  (autoload (quote gnus-slave-no-server) "gnus" "\
  Read network news as a slave, without connecting to the local server.
@@@ -11859,7 -11789,7 +11830,7 @@@ prompt the user for the name of an NNT
  ;;;;;;  gnus-agent-get-undownloaded-list gnus-agent-delete-group
  ;;;;;;  gnus-agent-rename-group gnus-agent-possibly-save-gcc gnus-agentize
  ;;;;;;  gnus-slave-unplugged gnus-plugged gnus-unplugged) "gnus-agent"
- ;;;;;;  "gnus/gnus-agent.el" (17549 5046))
 -;;;;;;  "gnus/gnus-agent.el" (17732 62702))
++;;;;;;  "gnus/gnus-agent.el" (17778 50473))
  ;;; Generated autoloads from gnus/gnus-agent.el
  
  (autoload (quote gnus-unplugged) "gnus-agent" "\
@@@ -11950,7 -11880,7 +11921,7 @@@ If CLEAN, obsolete (ignore)
  ;;;***
  \f
  ;;;### (autoloads (gnus-article-prepare-display) "gnus-art" "gnus/gnus-art.el"
- ;;;;;;  (17713 5989))
 -;;;;;;  (17746 34861))
++;;;;;;  (17778 50473))
  ;;; Generated autoloads from gnus/gnus-art.el
  
  (autoload (quote gnus-article-prepare-display) "gnus-art" "\
@@@ -12052,7 -11982,7 +12023,7 @@@ Checking delayed messages is skipped i
  ;;;***
  \f
  ;;;### (autoloads (gnus-user-format-function-D gnus-user-format-function-d)
- ;;;;;;  "gnus-diary" "gnus/gnus-diary.el" (17591 9282))
 -;;;;;;  "gnus-diary" "gnus/gnus-diary.el" (17746 34861))
++;;;;;;  "gnus-diary" "gnus/gnus-diary.el" (17778 50473))
  ;;; Generated autoloads from gnus/gnus-diary.el
  
  (autoload (quote gnus-user-format-function-d) "gnus-diary" "\
@@@ -12131,7 -12061,7 +12102,7 @@@ FILE should be a PNG file that's 48x48 
  ;;;***
  \f
  ;;;### (autoloads (gnus-fetch-group-other-frame gnus-fetch-group)
- ;;;;;;  "gnus-group" "gnus/gnus-group.el" (17778 49126))
 -;;;;;;  "gnus-group" "gnus/gnus-group.el" (17731 48936))
++;;;;;;  "gnus-group" "gnus/gnus-group.el" (17778 50473))
  ;;; Generated autoloads from gnus/gnus-group.el
  
  (autoload (quote gnus-fetch-group) "gnus-group" "\
@@@ -12514,8 -12444,8 +12485,8 @@@ Update the format specification near po
  ;;;***
  \f
  ;;;### (autoloads (gnus-fixup-nnimap-unread-after-getting-new-news
- ;;;;;;  gnus-declare-backend) "gnus-start" "gnus/gnus-start.el" (17591
- ;;;;;;  9890))
 -;;;;;;  gnus-declare-backend) "gnus-start" "gnus/gnus-start.el" (17686
 -;;;;;;  35982))
++;;;;;;  gnus-declare-backend) "gnus-start" "gnus/gnus-start.el" (17778
++;;;;;;  50473))
  ;;; Generated autoloads from gnus/gnus-start.el
  
  (autoload (quote gnus-declare-backend) "gnus-start" "\
@@@ -12541,7 -12471,7 +12512,7 @@@ Add the window configuration CONF to `g
  
  ;;;***
  \f
- ;;;### (autoloads (gomoku) "gomoku" "play/gomoku.el" (17383 38807))
 -;;;### (autoloads (gomoku) "gomoku" "play/gomoku.el" (17504 41540))
++;;;### (autoloads (gomoku) "gomoku" "play/gomoku.el" (17778 50475))
  ;;; Generated autoloads from play/gomoku.el
  
  (autoload (quote gomoku) "gomoku" "\
@@@ -12749,7 -12679,7 +12720,7 @@@ the form \"WINDOW-ID PIXMAP-ID\".  Valu
  ;;;***
  \f
  ;;;### (autoloads (gdb-script-mode bashdb jdb pdb perldb xdb dbx
- ;;;;;;  sdb gdb) "gud" "progmodes/gud.el" (17713 5991))
 -;;;;;;  sdb gdb) "gud" "progmodes/gud.el" (17661 56350))
++;;;;;;  sdb gdb) "gud" "progmodes/gud.el" (17778 50476))
  ;;; Generated autoloads from progmodes/gud.el
  
  (autoload (quote gdb) "gud" "\
@@@ -12759,8 -12689,8 +12730,12 @@@ directory and source-file directory fo
  default this command starts GDB using a graphical interface.  See
  `gdba' for more information.
  
--To run GDB in text command mode, set `gud-gdb-command-name' to
--\"gdb --fullname\" and include the pathname, if necessary.
++To run GDB in text command mode, replace the GDB \"--annotate=3\"
++option with \"--fullname\" either in the minibuffer for the
++current Emacs session, or the custom variable
++`gud-gdb-command-name' for all future sessions.  You need to use
++text command mode to debug multiple programs within one Emacs
++session.
  
  \(fn COMMAND-LINE)" t nil)
  
@@@ -12805,7 -12735,7 +12780,7 @@@ and source-file directory for your debu
  (autoload (quote jdb) "gud" "\
  Run jdb with command line COMMAND-LINE in a buffer.
  The buffer is named \"*gud*\" if no initial class is given or
--\"*gud-<initial-class-basename>*\" if there is.        If the \"-classpath\"
++\"*gud-<initial-class-basename>*\" if there is.  If the \"-classpath\"
  switch is given, omit all whitespace between it and its value.
  
  See `gud-jdb-use-classpath' and `gud-jdb-classpath' documentation for
@@@ -12835,8 -12765,8 +12810,8 @@@ Major mode for editing GDB script
  
  ;;;***
  \f
- ;;;### (autoloads (handwrite) "handwrite" "play/handwrite.el" (17383
- ;;;;;;  38807))
 -;;;### (autoloads (handwrite) "handwrite" "play/handwrite.el" (17759
 -;;;;;;  28871))
++;;;### (autoloads (handwrite) "handwrite" "play/handwrite.el" (17778
++;;;;;;  50475))
  ;;; Generated autoloads from play/handwrite.el
  
  (autoload (quote handwrite) "handwrite" "\
@@@ -12854,7 -12784,7 +12829,7 @@@ Variables: handwrite-linespace     (def
  ;;;***
  \f
  ;;;### (autoloads (hanoi-unix-64 hanoi-unix hanoi) "hanoi" "play/hanoi.el"
- ;;;;;;  (17591 9622))
 -;;;;;;  (17746 34862))
++;;;;;;  (17778 50475))
  ;;; Generated autoloads from play/hanoi.el
  
  (autoload (quote hanoi) "hanoi" "\
@@@ -13013,19 -12943,10 +12988,10 @@@ different regions.  With numeric argume
  \f
  ;;;### (autoloads (describe-categories describe-syntax describe-variable
  ;;;;;;  variable-at-point describe-function-1 describe-simplify-lib-file-name
- ;;;;;;  help-C-file-name describe-function help-with-tutorial) "help-fns"
- ;;;;;;  "help-fns.el" (17778 48452))
+ ;;;;;;  help-C-file-name describe-function) "help-fns" "help-fns.el"
 -;;;;;;  (17736 44182))
++;;;;;;  (17778 50473))
  ;;; Generated autoloads from help-fns.el
  
- (autoload (quote help-with-tutorial) "help-fns" "\
- Select the Emacs learn-by-doing tutorial.
- If there is a tutorial version written in the language
- of the selected language environment, that version is used.
- If there's no tutorial in that language, `TUTORIAL' is selected.
- With ARG, you are asked to choose which language.
- \(fn &optional ARG)" t nil)
  (autoload (quote describe-function) "help-fns" "\
  Display the full documentation of FUNCTION (a symbol).
  
@@@ -13081,7 -13001,7 +13047,7 @@@ BUFFER should be a buffer or a buffer n
  ;;;***
  \f
  ;;;### (autoloads (three-step-help) "help-macro" "help-macro.el"
- ;;;;;;  (17390 26939))
 -;;;;;;  (17504 41540))
++;;;;;;  (17778 50473))
  ;;; Generated autoloads from help-macro.el
  
  (defvar three-step-help nil "\
@@@ -13196,7 -13116,7 +13162,7 @@@ Provide help for current mode
  ;;;***
  \f
  ;;;### (autoloads (hexlify-buffer hexl-find-file hexl-mode) "hexl"
- ;;;;;;  "hexl.el" (17591 9619))
 -;;;;;;  "hexl.el" (17746 34860))
++;;;;;;  "hexl.el" (17778 50473))
  ;;; Generated autoloads from hexl.el
  
  (autoload (quote hexl-mode) "hexl" "\
@@@ -13474,7 -13393,7 +13440,7 @@@ how the hiding is done
  ;;;***
  \f
  ;;;### (autoloads (hs-minor-mode) "hideshow" "progmodes/hideshow.el"
- ;;;;;;  (17390 27408))
 -;;;;;;  (17504 41540))
++;;;;;;  (17778 50476))
  ;;; Generated autoloads from progmodes/hideshow.el
  
  (defvar hs-special-modes-alist (quote ((c-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning) (c++-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning) (bibtex-mode ("^@\\S(*\\(\\s(\\)" 1)) (java-mode "{" "}" "/[*/]" nil hs-c-like-adjust-block-beginning))) "\
@@@ -13812,35 -13731,8 +13778,35 @@@ The optional LABEL is used to label th
  
  ;;;***
  \f
 -;;;### (autoloads (html2text) "html2text" "gnus/html2text.el" (17746
 -;;;;;;  34861))
 +;;;### (autoloads (hscroll-global-mode hscroll-mode turn-on-hscroll)
 +;;;;;;  "hscroll" "obsolete/hscroll.el" (17383 38806))
 +;;; Generated autoloads from obsolete/hscroll.el
 +
 +(autoload (quote turn-on-hscroll) "hscroll" "\
 +This function is obsolete.
 +Emacs now does hscrolling automatically, if `truncate-lines' is non-nil.
 +Also see `automatic-hscrolling'.
 +
 +\(fn)" nil nil)
 +
 +(autoload (quote hscroll-mode) "hscroll" "\
 +This function is obsolete.
 +Emacs now does hscrolling automatically, if `truncate-lines' is non-nil.
 +Also see `automatic-hscrolling'.
 +
 +\(fn &optional ARG)" t nil)
 +
 +(autoload (quote hscroll-global-mode) "hscroll" "\
 +This function is obsolete.
 +Emacs now does hscrolling automatically, if `truncate-lines' is non-nil.
 +Also see `automatic-hscrolling'.
 +
 +\(fn &optional ARG)" t nil)
 +
 +;;;***
 +\f
- ;;;### (autoloads (html2text) "html2text" "gnus/html2text.el" (17396
- ;;;;;;  42171))
++;;;### (autoloads (html2text) "html2text" "gnus/html2text.el" (17778
++;;;;;;  50473))
  ;;; Generated autoloads from gnus/html2text.el
  
  (autoload (quote html2text) "html2text" "\
@@@ -14421,8 -14313,8 +14387,8 @@@ buffer `*icalendar-errors*'
  
  ;;;***
  \f
- ;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (17713
- ;;;;;;  5990))
 -;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (17686
 -;;;;;;  53336))
++;;;### (autoloads (icomplete-mode) "icomplete" "icomplete.el" (17778
++;;;;;;  50473))
  ;;; Generated autoloads from icomplete.el
  
  (defvar icomplete-mode nil "\
@@@ -14483,7 -14375,7 +14449,7 @@@ with no args, if that value is non-nil
  ;;;***
  \f
  ;;;### (autoloads (idlwave-shell) "idlw-shell" "progmodes/idlw-shell.el"
- ;;;;;;  (17611 8436))
 -;;;;;;  (17596 14703))
++;;;;;;  (17778 50476))
  ;;; Generated autoloads from progmodes/idlw-shell.el
  
  (autoload (quote idlwave-shell) "idlw-shell" "\
@@@ -14509,11 -14401,11 +14475,11 @@@ See also the variable `idlwave-shell-pr
  ;;;***
  \f
  ;;;### (autoloads (idlwave-mode) "idlwave" "progmodes/idlwave.el"
- ;;;;;;  (17713 5991))
 -;;;;;;  (17746 34862))
++;;;;;;  (17778 50476))
  ;;; Generated autoloads from progmodes/idlwave.el
  
  (autoload (quote idlwave-mode) "idlwave" "\
--Major mode for editing IDL source files (version 6.0_em22).
++Major mode for editing IDL source files (version 6.1_em22).
  
  The main features of this mode are
  
  ;;;;;;  ido-find-alternate-file ido-find-file-other-window ido-find-file
  ;;;;;;  ido-find-file-in-dir ido-switch-buffer-other-frame ido-insert-buffer
  ;;;;;;  ido-kill-buffer ido-display-buffer ido-switch-buffer-other-window
 -;;;;;;  ido-switch-buffer ido-mode ido-mode) "ido" "ido.el" (17759
 -;;;;;;  28868))
 +;;;;;;  ido-switch-buffer ido-mode ido-mode) "ido" "ido.el" (17778
- ;;;;;;  48452))
++;;;;;;  50473))
  ;;; Generated autoloads from ido.el
  
  (defvar ido-mode nil "\
@@@ -14919,7 -14811,7 +14885,7 @@@ Switches to the buffer `*ielm*', or cre
  ;;;***
  \f
  ;;;### (autoloads (iimage-mode turn-on-iimage-mode) "iimage" "iimage.el"
- ;;;;;;  (17390 26940))
 -;;;;;;  (17504 41540))
++;;;;;;  (17778 50473))
  ;;; Generated autoloads from iimage.el
  
  (autoload (quote turn-on-iimage-mode) "iimage" "\
@@@ -15592,7 -15483,7 +15558,7 @@@ This will add a speedbar major display 
  \f
  ;;;### (autoloads (info-complete-file info-complete-symbol info-lookup-file
  ;;;;;;  info-lookup-symbol info-lookup-reset) "info-look" "info-look.el"
- ;;;;;;  (17713 5990))
 -;;;;;;  (17746 34860))
++;;;;;;  (17778 50473))
  ;;; Generated autoloads from info-look.el
  
  (autoload (quote info-lookup-reset) "info-look" "\
@@@ -15873,7 -15733,7 +15839,7 @@@ Add submenus to the File menu, to conve
  ;;;;;;  ispell-region ispell-change-dictionary ispell-kill-ispell
  ;;;;;;  ispell-help ispell-pdict-save ispell-word ispell-local-dictionary-alist
  ;;;;;;  ispell-personal-dictionary) "ispell" "textmodes/ispell.el"
- ;;;;;;  (17713 5992))
 -;;;;;;  (17746 34863))
++;;;;;;  (17778 50479))
  ;;; Generated autoloads from textmodes/ispell.el
  (put 'ispell-check-comments 'safe-local-variable (lambda (a) (memq a '(nil t exclusive))))
  
@@@ -16394,7 -16253,7 +16360,7 @@@ and the return value is the length of t
  ;;;### (autoloads (kmacro-end-call-mouse kmacro-end-and-call-macro
  ;;;;;;  kmacro-end-or-call-macro kmacro-start-macro-or-insert-counter
  ;;;;;;  kmacro-call-macro kmacro-end-macro kmacro-start-macro) "kmacro"
- ;;;;;;  "kmacro.el" (17713 5734))
 -;;;;;;  "kmacro.el" (17652 14942))
++;;;;;;  "kmacro.el" (17778 50473))
  ;;; Generated autoloads from kmacro.el
   (global-set-key "\C-x(" 'kmacro-start-macro)
   (global-set-key "\C-x)" 'kmacro-end-macro)
@@@ -16539,7 -16398,7 +16505,7 @@@ Not documente
  ;;;***
  \f
  ;;;### (autoloads (lm lm-test-run) "landmark" "play/landmark.el"
- ;;;;;;  (17591 9445))
 -;;;;;;  (17580 16977))
++;;;;;;  (17778 50475))
  ;;; Generated autoloads from play/landmark.el
  
  (defalias (quote landmark-repeat) (quote lm-test-run))
@@@ -16782,7 -16573,7 +16748,7 @@@ A major mode to edit GNU ld script file
  ;;;***
  \f
  ;;;### (autoloads (ledit-from-lisp-mode ledit-mode) "ledit" "ledit.el"
- ;;;;;;  (17390 26941))
 -;;;;;;  (17504 41540))
++;;;;;;  (17778 50475))
  ;;; Generated autoloads from ledit.el
  
  (defconst ledit-save-files t "\
@@@ -16803,6 -16594,6 +16769,7 @@@ Like Lisp mode, plus these special comm
    \\[ledit-go-to-lisp] -- transfer to Lisp job and transmit saved text.
    \\[ledit-go-to-liszt] -- transfer to Liszt (Lisp compiler) job
           and transmit saved text.
++
  \\{ledit-mode-map}
  To make Lisp mode automatically change to Ledit mode,
  do (setq lisp-mode-hook 'ledit-from-lisp-mode)
@@@ -16829,8 -16620,8 +16796,8 @@@ generations (this defaults to 1)
  
  ;;;***
  \f
- ;;;### (autoloads (unload-feature) "loadhist" "loadhist.el" (17713
- ;;;;;;  2476))
 -;;;### (autoloads (unload-feature) "loadhist" "loadhist.el" (17746
 -;;;;;;  34860))
++;;;### (autoloads (unload-feature) "loadhist" "loadhist.el" (17778
++;;;;;;  50475))
  ;;; Generated autoloads from loadhist.el
  
  (autoload (quote unload-feature) "loadhist" "\
@@@ -16853,7 -16644,7 +16820,7 @@@ such as redefining an Emacs function
  ;;;***
  \f
  ;;;### (autoloads (locate-with-filter locate locate-ls-subdir-switches)
- ;;;;;;  "locate" "locate.el" (17713 5990))
 -;;;;;;  "locate" "locate.el" (17668 1406))
++;;;;;;  "locate" "locate.el" (17778 50475))
  ;;; Generated autoloads from locate.el
  
  (defvar locate-ls-subdir-switches "-al" "\
@@@ -16932,8 -16723,8 +16899,8 @@@ Major mode for browsing CVS log output
  
  ;;;***
  \f
- ;;;### (autoloads (longlines-mode) "longlines" "longlines.el" (17713
- ;;;;;;  5990))
 -;;;### (autoloads (longlines-mode) "longlines" "longlines.el" (17710
 -;;;;;;  3074))
++;;;### (autoloads (longlines-mode) "longlines" "longlines.el" (17778
++;;;;;;  50475))
  ;;; Generated autoloads from longlines.el
  
  (autoload (quote longlines-mode) "longlines" "\
@@@ -17101,7 -16892,7 +17068,7 @@@ definitions to shadow the loaded ones f
  ;;;***
  \f
  ;;;### (autoloads (apply-macro-to-region-lines kbd-macro-query insert-kbd-macro
- ;;;;;;  name-last-kbd-macro) "macros" "macros.el" (17390 26942))
 -;;;;;;  name-last-kbd-macro) "macros" "macros.el" (17504 41540))
++;;;;;;  name-last-kbd-macro) "macros" "macros.el" (17778 50475))
  ;;; Generated autoloads from macros.el
  
  (autoload (quote name-last-kbd-macro) "macros" "\
@@@ -17568,8 -17359,8 +17535,8 @@@ yourself the value of `master-of' by ca
  
  ;;;***
  \f
- ;;;### (autoloads (menu-bar-mode) "menu-bar" "menu-bar.el" (17713
- ;;;;;;  5990))
 -;;;### (autoloads (menu-bar-mode) "menu-bar" "menu-bar.el" (17759
 -;;;;;;  28868))
++;;;### (autoloads (menu-bar-mode) "menu-bar" "menu-bar.el" (17778
++;;;;;;  50475))
  ;;; Generated autoloads from menu-bar.el
  
  (put (quote menu-bar-mode) (quote standard-value) (quote (t)))
@@@ -17604,7 -17395,7 +17571,7 @@@ turn on menu bars; otherwise, turn off 
  ;;;;;;  message-cite-function message-yank-prefix message-citation-line-function
  ;;;;;;  message-send-mail-function message-user-organization-file
  ;;;;;;  message-signature-separator message-from-style) "message"
- ;;;;;;  "gnus/message.el" (17778 49126))
 -;;;;;;  "gnus/message.el" (17759 28869))
++;;;;;;  "gnus/message.el" (17778 50473))
  ;;; Generated autoloads from gnus/message.el
  
  (defvar message-from-style (quote default) "\
@@@ -18017,7 -17808,7 +17984,7 @@@ delete the draft message
  
  ;;;***
  \f
- ;;;### (autoloads (mh-version) "mh-e" "mh-e/mh-e.el" (17591 9293))
 -;;;### (autoloads (mh-version) "mh-e" "mh-e/mh-e.el" (17759 28870))
++;;;### (autoloads (mh-version) "mh-e" "mh-e/mh-e.el" (17778 50475))
  ;;; Generated autoloads from mh-e/mh-e.el
  
  (put (quote mh-progs) (quote risky-local-variable) t)
@@@ -18260,7 -18050,7 +18227,7 @@@ Insert file contents of URL using `mm-u
  ;;;***
  \f
  ;;;### (autoloads (mm-uu-dissect-text-parts mm-uu-dissect) "mm-uu"
- ;;;;;;  "gnus/mm-uu.el" (17778 48450))
 -;;;;;;  "gnus/mm-uu.el" (17715 55646))
++;;;;;;  "gnus/mm-uu.el" (17778 50473))
  ;;; Generated autoloads from gnus/mm-uu.el
  
  (autoload (quote mm-uu-dissect) "mm-uu" "\
@@@ -18297,7 -18087,7 +18264,7 @@@ Not documente
  \f
  ;;;### (autoloads (mml2015-self-encrypt mml2015-sign mml2015-encrypt
  ;;;;;;  mml2015-verify-test mml2015-verify mml2015-decrypt-test mml2015-decrypt)
- ;;;;;;  "mml2015" "gnus/mml2015.el" (17496 39167))
 -;;;;;;  "mml2015" "gnus/mml2015.el" (17504 41540))
++;;;;;;  "mml2015" "gnus/mml2015.el" (17778 50473))
  ;;; Generated autoloads from gnus/mml2015.el
  
  (autoload (quote mml2015-decrypt) "mml2015" "\
@@@ -18901,7 -18693,7 +18868,7 @@@ Open a network connection to HOST on PO
  ;;;;;;  uncomment-region comment-kill comment-set-column comment-indent
  ;;;;;;  comment-indent-default comment-normalize-vars comment-multi-line
  ;;;;;;  comment-padding comment-style comment-column) "newcomment"
- ;;;;;;  "newcomment.el" (17713 5990))
 -;;;;;;  "newcomment.el" (17707 61789))
++;;;;;;  "newcomment.el" (17778 50475))
  ;;; Generated autoloads from newcomment.el
  
  (defalias (quote indent-for-comment) (quote comment-indent))
@@@ -19139,7 -18931,7 +19106,7 @@@ Switch to newsticker buffer.  You may w
  ;;;***
  \f
  ;;;### (autoloads (nndiary-generate-nov-databases) "nndiary" "gnus/nndiary.el"
- ;;;;;;  (17383 38805))
 -;;;;;;  (17746 34862))
++;;;;;;  (17778 50473))
  ;;; Generated autoloads from gnus/nndiary.el
  
  (autoload (quote nndiary-generate-nov-databases) "nndiary" "\
@@@ -19200,7 -18992,7 +19167,7 @@@ Generate NOV databases in all nnml dire
  ;;;***
  \f
  ;;;### (autoloads (nnsoup-revert-variables nnsoup-set-variables nnsoup-pack-replies)
- ;;;;;;  "nnsoup" "gnus/nnsoup.el" (17383 38805))
 -;;;;;;  "nnsoup" "gnus/nnsoup.el" (17746 34862))
++;;;;;;  "nnsoup" "gnus/nnsoup.el" (17778 50473))
  ;;; Generated autoloads from gnus/nnsoup.el
  
  (autoload (quote nnsoup-pack-replies) "nnsoup" "\
@@@ -19221,7 -19013,7 +19188,7 @@@ Revert posting and mailing methods to t
  ;;;***
  \f
  ;;;### (autoloads (disable-command enable-command disabled-command-function)
- ;;;;;;  "novice" "novice.el" (17713 5990))
 -;;;;;;  "novice" "novice.el" (17665 54360))
++;;;;;;  "novice" "novice.el" (17778 50475))
  ;;; Generated autoloads from novice.el
  
  (defvar disabled-command-function (quote disabled-command-function) "\
@@@ -19429,9 -19199,10 +19396,10 @@@ The Custom feature is intended to make 
  ;;;### (autoloads (org-export-icalendar-combine-agenda-files org-export-icalendar-all-agenda-files
  ;;;;;;  org-export-icalendar-this-file orgtbl-mode turn-on-orgtbl
  ;;;;;;  org-remember-handler org-remember-apply-template org-remember-annotation
- ;;;;;;  org-store-link org-tags-view org-diary org-todo-list org-agenda-list
- ;;;;;;  org-agenda org-global-cycle org-cycle org-mode) "org" "textmodes/org.el"
- ;;;;;;  (17713 5992))
+ ;;;;;;  org-store-link org-tags-view org-diary org-cycle-agenda-files
+ ;;;;;;  org-todo-list org-agenda-list org-batch-agenda org-agenda
+ ;;;;;;  org-global-cycle org-cycle org-mode) "org" "textmodes/org.el"
 -;;;;;;  (17759 28874))
++;;;;;;  (17778 50479))
  ;;; Generated autoloads from textmodes/org.el
  
  (autoload (quote org-mode) "org" "\
@@@ -19754,7 -19541,7 +19738,7 @@@ See the command `outline-mode' for mor
  
  ;;;***
  \f
- ;;;### (autoloads (show-paren-mode) "paren" "paren.el" (17390 26944))
 -;;;### (autoloads (show-paren-mode) "paren" "paren.el" (17504 41540))
++;;;### (autoloads (show-paren-mode) "paren" "paren.el" (17778 50475))
  ;;; Generated autoloads from paren.el
  
  (defvar show-paren-mode nil "\
@@@ -20124,7 -19909,7 +20107,7 @@@ Setup shell-mode to use pcomplete
  \f
  ;;;### (autoloads (cvs-dired-use-hook cvs-dired-action cvs-status
  ;;;;;;  cvs-update cvs-examine cvs-quickdir cvs-checkout) "pcvs"
- ;;;;;;  "pcvs.el" (17713 5990))
 -;;;;;;  "pcvs.el" (17759 28868))
++;;;;;;  "pcvs.el" (17778 50475))
  ;;; Generated autoloads from pcvs.el
  
  (autoload (quote cvs-checkout) "pcvs" "\
@@@ -20521,7 -20306,7 +20504,7 @@@ pong-mode keybindings:\\<pong-mode-map
  ;;;***
  \f
  ;;;### (autoloads (pp-eval-last-sexp pp-eval-expression pp pp-buffer
- ;;;;;;  pp-to-string) "pp" "emacs-lisp/pp.el" (17778 48817))
 -;;;;;;  pp-to-string) "pp" "emacs-lisp/pp.el" (17746 34861))
++;;;;;;  pp-to-string) "pp" "emacs-lisp/pp.el" (17778 50473))
  ;;; Generated autoloads from emacs-lisp/pp.el
  
  (autoload (quote pp-to-string) "pp" "\
@@@ -20582,7 -20367,7 +20565,7 @@@ Ignores leading comment characters
  ;;;;;;  pr-ps-buffer-print pr-ps-buffer-using-ghostscript pr-ps-buffer-preview
  ;;;;;;  pr-ps-directory-ps-print pr-ps-directory-print pr-ps-directory-using-ghostscript
  ;;;;;;  pr-ps-directory-preview pr-interface) "printing" "printing.el"
- ;;;;;;  (17713 5990))
 -;;;;;;  (17746 34861))
++;;;;;;  (17778 50475))
  ;;; Generated autoloads from printing.el
  
  (autoload (quote pr-interface) "printing" "\
@@@ -21193,7 -20978,7 +21176,7 @@@ With prefix argument \\[universal-prefi
  
  ;;;***
  \f
- ;;;### (autoloads nil "ps-bdf" "ps-bdf.el" (17390 26944))
 -;;;### (autoloads nil "ps-bdf" "ps-bdf.el" (17504 41540))
++;;;### (autoloads nil "ps-bdf" "ps-bdf.el" (17778 50476))
  ;;; Generated autoloads from ps-bdf.el
  
  (defvar bdf-directory-list (if (memq system-type (quote (ms-dos windows-nt))) (list (expand-file-name "fonts/bdf" installation-directory)) (quote ("/usr/local/share/emacs/fonts/bdf"))) "\
@@@ -21252,7 -21037,7 +21235,7 @@@ Typing \\<ps-run-mode-map>\\[ps-run-got
  ;;;### (autoloads (ps-mule-begin-page ps-mule-begin-job ps-mule-encode-header-string
  ;;;;;;  ps-mule-initialize ps-mule-plot-composition ps-mule-plot-string
  ;;;;;;  ps-mule-set-ascii-font ps-mule-prepare-ascii-font ps-multibyte-buffer)
- ;;;;;;  "ps-mule" "ps-mule.el" (17390 26944))
 -;;;;;;  "ps-mule" "ps-mule.el" (17504 41540))
++;;;;;;  "ps-mule" "ps-mule.el" (17778 50476))
  ;;; Generated autoloads from ps-mule.el
  
  (defvar ps-multibyte-buffer nil "\
@@@ -21373,8 -21158,8 +21356,8 @@@ Not documente
  ;;;;;;  ps-spool-region ps-spool-buffer-with-faces ps-spool-buffer
  ;;;;;;  ps-print-region-with-faces ps-print-region ps-print-buffer-with-faces
  ;;;;;;  ps-print-buffer ps-print-customize ps-print-color-p ps-paper-type
- ;;;;;;  ps-page-dimensions-database) "ps-print" "ps-print.el" (17713
- ;;;;;;  5991))
 -;;;;;;  ps-page-dimensions-database) "ps-print" "ps-print.el" (17686
 -;;;;;;  35929))
++;;;;;;  ps-page-dimensions-database) "ps-print" "ps-print.el" (17778
++;;;;;;  50476))
  ;;; Generated autoloads from ps-print.el
  
  (defvar ps-page-dimensions-database (list (list (quote a4) (/ (* 72 21.0) 2.54) (/ (* 72 29.7) 2.54) "A4") (list (quote a3) (/ (* 72 29.7) 2.54) (/ (* 72 42.0) 2.54) "A3") (list (quote letter) (* 72 8.5) (* 72 11.0) "Letter") (list (quote legal) (* 72 8.5) (* 72 14.0) "Legal") (list (quote letter-small) (* 72 7.68) (* 72 10.16) "LetterSmall") (list (quote tabloid) (* 72 11.0) (* 72 17.0) "Tabloid") (list (quote ledger) (* 72 17.0) (* 72 11.0) "Ledger") (list (quote statement) (* 72 5.5) (* 72 8.5) "Statement") (list (quote executive) (* 72 7.5) (* 72 10.0) "Executive") (list (quote a4small) (* 72 7.47) (* 72 10.85) "A4Small") (list (quote b4) (* 72 10.125) (* 72 14.33) "B4") (list (quote b5) (* 72 7.16) (* 72 10.125) "B5")) "\
@@@ -21571,7 -21356,7 +21554,7 @@@ If EXTENSION is any other symbol, it i
  ;;;***
  \f
  ;;;### (autoloads (jython-mode python-mode run-python) "python" "progmodes/python.el"
- ;;;;;;  (17778 49122))
 -;;;;;;  (17759 28873))
++;;;;;;  (17778 50476))
  ;;; Generated autoloads from progmodes/python.el
  
  (add-to-list (quote interpreter-mode-alist) (quote ("jython" . jython-mode)))
@@@ -21973,7 -21758,7 +21956,7 @@@ Display `quickurl-list' as a formatted 
  ;;;***
  \f
  ;;;### (autoloads (rcirc-track-minor-mode rcirc-connect rcirc) "rcirc"
- ;;;;;;  "net/rcirc.el" (17713 5990))
 -;;;;;;  "net/rcirc.el" (17672 28071))
++;;;;;;  "net/rcirc.el" (17778 50475))
  ;;; Generated autoloads from net/rcirc.el
  
  (autoload (quote rcirc) "rcirc" "\
@@@ -22018,7 -21803,7 +22001,7 @@@ See \\[compile]
  ;;;***
  \f
  ;;;### (autoloads (re-builder) "re-builder" "emacs-lisp/re-builder.el"
- ;;;;;;  (17505 62391))
 -;;;;;;  (17759 28868))
++;;;;;;  (17778 50473))
  ;;; Generated autoloads from emacs-lisp/re-builder.el
  
  (defalias (quote regexp-builder) (quote re-builder))
@@@ -22253,7 -22038,7 +22236,7 @@@ This enforces rescanning the buffer on 
  ;;;***
  \f
  ;;;### (autoloads (reftex-citation) "reftex-cite" "textmodes/reftex-cite.el"
- ;;;;;;  (17405 10316))
 -;;;;;;  (17746 34863))
++;;;;;;  (17778 50479))
  ;;; Generated autoloads from textmodes/reftex-cite.el
  
  (autoload (quote reftex-citation) "reftex-cite" "\
@@@ -22356,11 -22141,11 +22339,11 @@@ of master file
  ;;;***
  \f
  ;;;### (autoloads (regexp-opt-depth regexp-opt) "regexp-opt" "emacs-lisp/regexp-opt.el"
- ;;;;;;  (17390 26938))
 -;;;;;;  (17504 41540))
++;;;;;;  (17778 50473))
  ;;; Generated autoloads from emacs-lisp/regexp-opt.el
  
  (autoload (quote regexp-opt) "regexp-opt" "\
--Return a regexp to match a string in STRINGS.
++Return a regexp to match a string in the list STRINGS.
  Each string should be unique in STRINGS and should not contain any regexps,
  quoted or not.  If optional PAREN is non-nil, ensure that the returned regexp
  is enclosed by at least one regexp grouping construct.
@@@ -22460,8 -22245,8 +22443,8 @@@ first comment line visible (if point i
  
  ;;;***
  \f
- ;;;### (autoloads (resume-suspend-hook) "resume" "resume.el" (17390
- ;;;;;;  26945))
 -;;;### (autoloads (resume-suspend-hook) "resume" "resume.el" (17746
 -;;;;;;  34861))
++;;;### (autoloads (resume-suspend-hook) "resume" "resume.el" (17778
++;;;;;;  50476))
  ;;; Generated autoloads from resume.el
  
  (autoload (quote resume-suspend-hook) "resume" "\
@@@ -22572,8 -22358,8 +22555,8 @@@ variable
  ;;;;;;  rmail-mail-new-frame rmail-primary-inbox-list rmail-delete-after-output
  ;;;;;;  rmail-highlight-face rmail-highlighted-headers rmail-retry-ignored-headers
  ;;;;;;  rmail-displayed-headers rmail-ignored-headers rmail-dont-reply-to-names
- ;;;;;;  rmail-movemail-variant-p) "rmail" "mail/rmail.el" (17713
- ;;;;;;  5990))
 -;;;;;;  rmail-movemail-variant-p) "rmail" "mail/rmail.el" (17746
 -;;;;;;  34862))
++;;;;;;  rmail-movemail-variant-p) "rmail" "mail/rmail.el" (17778
++;;;;;;  50475))
  ;;; Generated autoloads from mail/rmail.el
  
  (autoload (quote rmail-movemail-variant-p) "rmail" "\
@@@ -22903,7 -22689,7 +22886,7 @@@ If FILE-NAME is empty, remove any exist
  \f
  ;;;### (autoloads (rmail-output-body-to-file rmail-output rmail-fields-not-to-output
  ;;;;;;  rmail-output-to-rmail-file rmail-output-file-alist) "rmailout"
- ;;;;;;  "mail/rmailout.el" (17390 26943))
 -;;;;;;  "mail/rmailout.el" (17759 28870))
++;;;;;;  "mail/rmailout.el" (17778 50475))
  ;;; Generated autoloads from mail/rmailout.el
  
  (defvar rmail-output-file-alist nil "\
@@@ -23118,89 -22891,45 +23101,89 @@@ If NOQUERY is non-nil, we do not query 
  ;;;***
  \f
  ;;;### (autoloads (toggle-rot13-mode rot13-other-window rot13-region
- ;;;;;;  rot13-string rot13) "rot13" "rot13.el" (17390 26945))
 -;;;;;;  rot13-string rot13) "rot13" "rot13.el" (17504 41540))
++;;;;;;  rot13-string rot13) "rot13" "rot13.el" (17778 50476))
  ;;; Generated autoloads from rot13.el
  
  (autoload (quote rot13) "rot13" "\
--Return Rot13 encryption of OBJECT, a buffer or string.
++Return ROT13 encryption of OBJECT, a buffer or string.
  
  \(fn OBJECT &optional START END)" nil nil)
  
  (autoload (quote rot13-string) "rot13" "\
--Return Rot13 encryption of STRING.
++Return ROT13 encryption of STRING.
  
  \(fn STRING)" nil nil)
  
  (autoload (quote rot13-region) "rot13" "\
--Rot13 encrypt the region between START and END in current buffer.
++ROT13 encrypt the region between START and END in current buffer.
  
  \(fn START END)" t nil)
  
  (autoload (quote rot13-other-window) "rot13" "\
--Display current buffer in rot 13 in another window.
++Display current buffer in ROT13 in another window.
  The text itself is not modified, only the way it is displayed is affected.
  
--To terminate the rot13 display, delete that window.  As long as that window
++To terminate the ROT13 display, delete that window.  As long as that window
  is not deleted, any buffer displayed in it will become instantly encoded
--in rot 13.
++in ROT13.
  
  See also `toggle-rot13-mode'.
  
  \(fn)" t nil)
  
  (autoload (quote toggle-rot13-mode) "rot13" "\
--Toggle the use of rot 13 encoding for the current window.
++Toggle the use of ROT13 encoding for the current window.
  
  \(fn)" t nil)
  
  ;;;***
  \f
 -;;;### (autoloads (ruler-mode) "ruler-mode" "ruler-mode.el" (17746
 -;;;;;;  34861))
 +;;;### (autoloads (resize-minibuffer-mode resize-minibuffer-frame-exactly
 +;;;;;;  resize-minibuffer-frame-max-height resize-minibuffer-frame
 +;;;;;;  resize-minibuffer-window-exactly resize-minibuffer-window-max-height
 +;;;;;;  resize-minibuffer-mode) "rsz-mini" "obsolete/rsz-mini.el"
 +;;;;;;  (17383 38807))
 +;;; Generated autoloads from obsolete/rsz-mini.el
 +
 +(defvar resize-minibuffer-mode nil "\
 +*This variable is obsolete.")
 +
 +(custom-autoload (quote resize-minibuffer-mode) "rsz-mini")
 +
 +(defvar resize-minibuffer-window-max-height nil "\
 +*This variable is obsolete.")
 +
 +(custom-autoload (quote resize-minibuffer-window-max-height) "rsz-mini")
 +
 +(defvar resize-minibuffer-window-exactly t "\
 +*This variable is obsolete.")
 +
 +(custom-autoload (quote resize-minibuffer-window-exactly) "rsz-mini")
 +
 +(defvar resize-minibuffer-frame nil "\
 +*This variable is obsolete.")
 +
 +(custom-autoload (quote resize-minibuffer-frame) "rsz-mini")
 +
 +(defvar resize-minibuffer-frame-max-height nil "\
 +*This variable is obsolete.")
 +
 +(custom-autoload (quote resize-minibuffer-frame-max-height) "rsz-mini")
 +
 +(defvar resize-minibuffer-frame-exactly t "\
 +*This variable is obsolete.")
 +
 +(custom-autoload (quote resize-minibuffer-frame-exactly) "rsz-mini")
 +
 +(autoload (quote resize-minibuffer-mode) "rsz-mini" "\
 +This function is obsolete.
 +
 +\(fn &optional PREFIX)" t nil)
 +
 +;;;***
 +\f
- ;;;### (autoloads (ruler-mode) "ruler-mode" "ruler-mode.el" (17390
- ;;;;;;  26945))
++;;;### (autoloads (ruler-mode) "ruler-mode" "ruler-mode.el" (17778
++;;;;;;  50476))
  ;;; Generated autoloads from ruler-mode.el
  
  (autoload (quote ruler-mode) "ruler-mode" "\
@@@ -23626,7 -23330,7 +23609,7 @@@ Interesting variables
  ;;;***
  \f
  ;;;### (autoloads (scroll-all-mode) "scroll-all" "scroll-all.el"
- ;;;;;;  (17390 26945))
 -;;;;;;  (17504 41540))
++;;;;;;  (17778 50476))
  ;;; Generated autoloads from scroll-all.el
  
  (defvar scroll-all-mode nil "\
@@@ -23972,8 -23675,8 +23954,8 @@@ Like `mail' command, but display mail b
  
  ;;;***
  \f
 -;;;### (autoloads (server-mode server-start) "server" "server.el"
 -;;;;;;  (17759 28868))
 +;;;### (autoloads (server-save-buffers-kill-terminal server-mode
- ;;;;;;  server-start) "server" "server.el" (17713 6546))
++;;;;;;  server-start) "server" "server.el" (17778 59051))
  ;;; Generated autoloads from server.el
  
  (autoload (quote server-start) "server" "\
@@@ -24005,19 -23707,9 +23987,19 @@@ Server mode runs a process that accept
  
  \(fn &optional ARG)" t nil)
  
 +(autoload (quote server-save-buffers-kill-terminal) "server" "\
 +Offer to save each buffer, then kill PROC.
 +
 +With prefix arg, silently save all file-visiting buffers, then kill.
 +
 +If emacsclient was started with a list of filenames to edit, then
 +only these files will be asked to be saved.
 +
 +\(fn PROC &optional ARG)" nil nil)
 +
  ;;;***
  \f
- ;;;### (autoloads (ses-mode) "ses" "ses.el" (17713 5991))
 -;;;### (autoloads (ses-mode) "ses" "ses.el" (17759 28868))
++;;;### (autoloads (ses-mode) "ses" "ses.el" (17778 50477))
  ;;; Generated autoloads from ses.el
  
  (autoload (quote ses-mode) "ses" "\
@@@ -24183,7 -23875,7 +24165,7 @@@ If BINARY is non-nil, return a string i
  ;;;***
  \f
  ;;;### (autoloads (list-load-path-shadows) "shadow" "emacs-lisp/shadow.el"
- ;;;;;;  (17390 26938))
 -;;;;;;  (17746 34861))
++;;;;;;  (17778 50473))
  ;;; Generated autoloads from emacs-lisp/shadow.el
  
  (autoload (quote list-load-path-shadows) "shadow" "\
@@@ -24230,8 -23922,8 +24212,8 @@@ buffer called `*Shadows*'.  Shadowings 
  ;;;***
  \f
  ;;;### (autoloads (shadow-initialize shadow-define-regexp-group shadow-define-literal-group
- ;;;;;;  shadow-define-cluster) "shadowfile" "shadowfile.el" (17390
- ;;;;;;  26945))
 -;;;;;;  shadow-define-cluster) "shadowfile" "shadowfile.el" (17746
 -;;;;;;  34861))
++;;;;;;  shadow-define-cluster) "shadowfile" "shadowfile.el" (17778
++;;;;;;  50477))
  ;;; Generated autoloads from shadowfile.el
  
  (autoload (quote shadow-define-cluster) "shadowfile" "\
@@@ -24353,7 -24045,7 +24335,7 @@@ Turning on Sieve mode runs `sieve-mode-
  
  ;;;***
  \f
- ;;;### (autoloads nil "simple" "simple.el" (17778 48817))
 -;;;### (autoloads nil "simple" "simple.el" (17746 34861))
++;;;### (autoloads nil "simple" "simple.el" (17778 50477))
  ;;; Generated autoloads from simple.el
  (put 'fill-prefix 'safe-local-variable 'string-or-null-p)
  
@@@ -24556,7 -24248,7 +24538,7 @@@ interactively. If there's no argument, 
  ;;;***
  \f
  ;;;### (autoloads (smtpmail-send-queued-mail smtpmail-send-it) "smtpmail"
- ;;;;;;  "mail/smtpmail.el" (17778 48817))
 -;;;;;;  "mail/smtpmail.el" (17718 30637))
++;;;;;;  "mail/smtpmail.el" (17778 50475))
  ;;; Generated autoloads from mail/smtpmail.el
  
  (autoload (quote smtpmail-send-it) "smtpmail" "\
@@@ -24775,7 -24467,7 +24757,7 @@@ Pick your favourite shortcuts
  \f
  ;;;### (autoloads (reverse-region sort-columns sort-regexp-fields
  ;;;;;;  sort-fields sort-numeric-fields sort-pages sort-paragraphs
- ;;;;;;  sort-lines sort-subr) "sort" "sort.el" (17466 28166))
 -;;;;;;  sort-lines sort-subr) "sort" "sort.el" (17746 34861))
++;;;;;;  sort-lines sort-subr) "sort" "sort.el" (17778 50477))
  ;;; Generated autoloads from sort.el
  
  (autoload (quote sort-subr) "sort" "\
@@@ -24973,7 -24665,7 +24955,7 @@@ Spam reports will be queued with the me
  ;;;***
  \f
  ;;;### (autoloads (speedbar-get-focus speedbar-frame-mode) "speedbar"
- ;;;;;;  "speedbar.el" (17549 4607))
 -;;;;;;  "speedbar.el" (17746 34861))
++;;;;;;  "speedbar.el" (17778 50477))
  ;;; Generated autoloads from speedbar.el
  
  (defalias (quote speedbar) (quote speedbar-frame-mode))
@@@ -25616,7 -25308,7 +25598,7 @@@ Studlify-case the current buffer
  
  ;;;***
  \f
- ;;;### (autoloads (locate-library) "subr" "subr.el" (17778 49122))
 -;;;### (autoloads (locate-library) "subr" "subr.el" (17759 28868))
++;;;### (autoloads (locate-library) "subr" "subr.el" (17778 50477))
  ;;; Generated autoloads from subr.el
  
  (autoload (quote locate-library) "subr" "\
@@@ -25670,7 -25362,7 +25652,7 @@@ before, and `sc-post-hook' is run afte
  
  ;;;***
  \f
- ;;;### (autoloads (t-mouse-mode) "t-mouse" "t-mouse.el" (17713 2480))
 -;;;### (autoloads (t-mouse-mode) "t-mouse" "t-mouse.el" (17746 34861))
++;;;### (autoloads (t-mouse-mode) "t-mouse" "t-mouse.el" (17778 50477))
  ;;; Generated autoloads from t-mouse.el
  
  (defvar t-mouse-mode nil "\
@@@ -25692,7 -25384,7 +25674,7 @@@ Turn it on to use Emacs mouse commands
  
  ;;;***
  \f
- ;;;### (autoloads (tabify untabify) "tabify" "tabify.el" (17611 9419))
 -;;;### (autoloads (tabify untabify) "tabify" "tabify.el" (17610 3931))
++;;;### (autoloads (tabify untabify) "tabify" "tabify.el" (17778 50477))
  ;;; Generated autoloads from tabify.el
  
  (autoload (quote untabify) "tabify" "\
@@@ -25727,7 -25419,7 +25709,7 @@@ The variable `tab-width' controls the s
  ;;;;;;  table-recognize table-insert-row-column table-insert-column
  ;;;;;;  table-insert-row table-insert table-point-left-cell-hook
  ;;;;;;  table-point-entered-cell-hook table-load-hook table-cell-map-hook)
- ;;;;;;  "table" "textmodes/table.el" (17778 48451))
 -;;;;;;  "table" "textmodes/table.el" (17746 34863))
++;;;;;;  "table" "textmodes/table.el" (17778 50479))
  ;;; Generated autoloads from textmodes/table.el
  
  (defvar table-cell-map-hook nil "\
@@@ -26323,14 -26015,9 +26305,14 @@@ Connect to display DISPLAY for the Emac
  
  \(fn DISPLAY)" t nil)
  
 +(autoload (quote talk) "talk" "\
 +Connect to the Emacs talk group from the current X display or tty frame.
 +
 +\(fn)" t nil)
 +
  ;;;***
  \f
- ;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (17549 4608))
 -;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (17527 7050))
++;;;### (autoloads (tar-mode) "tar-mode" "tar-mode.el" (17778 50477))
  ;;; Generated autoloads from tar-mode.el
  
  (autoload (quote tar-mode) "tar-mode" "\
@@@ -26432,8 -26119,8 +26414,8 @@@ Normally input is edited in Emacs and s
  
  ;;;***
  \f
- ;;;### (autoloads (ansi-term term make-term) "term" "term.el" (17569
- ;;;;;;  17797))
 -;;;### (autoloads (ansi-term term make-term) "term" "term.el" (17566
 -;;;;;;  60306))
++;;;### (autoloads (ansi-term term make-term) "term" "term.el" (17778
++;;;;;;  50478))
  ;;; Generated autoloads from term.el
  
  (autoload (quote make-term) "term" "\
@@@ -26461,8 -26148,8 +26443,8 @@@ Start a terminal-emulator in a new buff
  
  ;;;***
  \f
- ;;;### (autoloads (terminal-emulator) "terminal" "terminal.el" (17390
- ;;;;;;  26946))
 -;;;### (autoloads (terminal-emulator) "terminal" "terminal.el" (17746
 -;;;;;;  34861))
++;;;### (autoloads (terminal-emulator) "terminal" "terminal.el" (17778
++;;;;;;  50479))
  ;;; Generated autoloads from terminal.el
  
  (autoload (quote terminal-emulator) "terminal" "\
@@@ -26842,7 -26529,7 +26824,7 @@@ Major mode to edit DocTeX files
  ;;;***
  \f
  ;;;### (autoloads (texi2info texinfo-format-region texinfo-format-buffer)
- ;;;;;;  "texinfmt" "textmodes/texinfmt.el" (17591 9719))
 -;;;;;;  "texinfmt" "textmodes/texinfmt.el" (17746 34863))
++;;;;;;  "texinfmt" "textmodes/texinfmt.el" (17778 50479))
  ;;; Generated autoloads from textmodes/texinfmt.el
  
  (autoload (quote texinfo-format-buffer) "texinfmt" "\
@@@ -27013,7 -26700,7 +26995,7 @@@ Minor mode for automatically correct Th
  \f
  ;;;### (autoloads (list-at-point number-at-point symbol-at-point
  ;;;;;;  sexp-at-point thing-at-point bounds-of-thing-at-point forward-thing)
- ;;;;;;  "thingatpt" "thingatpt.el" (17713 5993))
 -;;;;;;  "thingatpt" "thingatpt.el" (17675 64484))
++;;;;;;  "thingatpt" "thingatpt.el" (17778 50479))
  ;;; Generated autoloads from thingatpt.el
  
  (autoload (quote forward-thing) "thingatpt" "\
@@@ -27341,7 -27028,7 +27323,7 @@@ If DATE is malformed, return a time val
  ;;;***
  \f
  ;;;### (autoloads (time-stamp-toggle-active time-stamp) "time-stamp"
- ;;;;;;  "time-stamp.el" (17490 7930))
 -;;;;;;  "time-stamp.el" (17504 41540))
++;;;;;;  "time-stamp.el" (17778 50479))
  ;;; Generated autoloads from time-stamp.el
  (put 'time-stamp-format 'safe-local-variable 'stringp)
  (put 'time-stamp-line-limit 'safe-local-variable 'integerp)
@@@ -27608,9 -27295,10 +27590,9 @@@ PATTERN regexp
  ;;;***
  \f
  ;;;### (autoloads (tmm-prompt tmm-menubar-mouse tmm-menubar) "tmm"
- ;;;;;;  "tmm.el" (17611 51386))
 -;;;;;;  "tmm.el" (17504 41540))
++;;;;;;  "tmm.el" (17778 50479))
  ;;; Generated autoloads from tmm.el
   (define-key global-map "\M-`" 'tmm-menubar)
 - (define-key global-map [f10] 'tmm-menubar)
   (define-key global-map [menu-bar mouse-1] 'tmm-menubar-mouse)
  
  (autoload (quote tmm-menubar) "tmm" "\
@@@ -27782,7 -27464,7 +27764,7 @@@ holds a keymap
  ;;;***
  \f
  ;;;### (autoloads (tpu-edt-on tpu-edt-mode) "tpu-edt" "emulation/tpu-edt.el"
- ;;;;;;  (17390 26938))
 -;;;;;;  (17746 34861))
++;;;;;;  (17778 50473))
  ;;; Generated autoloads from emulation/tpu-edt.el
  
  (defvar tpu-edt-mode nil "\
@@@ -27881,7 -27562,7 +27862,7 @@@ BUFFER defaults to `trace-buffer'
  ;;;### (autoloads (tramp-unload-tramp tramp-completion-handle-file-name-completion
  ;;;;;;  tramp-completion-handle-file-name-all-completions tramp-unload-file-name-handlers
  ;;;;;;  tramp-file-name-handler tramp-completion-file-name-regexp
- ;;;;;;  tramp-file-name-regexp) "tramp" "net/tramp.el" (17713 5990))
 -;;;;;;  tramp-file-name-regexp) "tramp" "net/tramp.el" (17759 28871))
++;;;;;;  tramp-file-name-regexp) "tramp" "net/tramp.el" (17778 50475))
  ;;; Generated autoloads from net/tramp.el
  
  (defvar tramp-unified-filenames (not (featurep (quote xemacs))) "\
@@@ -28138,6 -27819,31 +28119,31 @@@ easy-to-use form
  
  \(fn)" t nil)
  
 -;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (17735
 -;;;;;;  57938))
+ ;;;***
\f
++;;;### (autoloads (help-with-tutorial) "tutorial" "tutorial.el" (17778
++;;;;;;  50471))
+ ;;; Generated autoloads from tutorial.el
+ (autoload (quote help-with-tutorial) "tutorial" "\
+ Select the Emacs learn-by-doing tutorial.
+ If there is a tutorial version written in the language
+ of the selected language environment, that version is used.
+ If there's no tutorial in that language, `TUTORIAL' is selected.
+ With ARG, you are asked to choose which language.
+ If DONT-ASK-FOR-REVERT is non-nil the buffer is reverted without
+ any question when restarting the tutorial.
+ If any of the standard Emacs key bindings that are used in the
+ tutorial have been changed then an explanatory note about this is
+ shown in the beginning of the tutorial buffer.
+ When the tutorial buffer is killed the content and the point
+ position in the buffer is saved so that the tutorial may be
+ resumed later.
+ \(fn &optional ARG DONT-ASK-FOR-REVERT)" t nil)
  ;;;***
  \f
  ;;;### (autoloads (2C-split 2C-associate-buffer 2C-two-columns) "two-column"
@@@ -28448,7 -28154,7 +28454,7 @@@ of symbols with local bindings
  ;;;***
  \f
  ;;;### (autoloads (url-retrieve-synchronously url-retrieve) "url"
- ;;;;;;  "url/url.el" (17778 49132))
 -;;;;;;  "url/url.el" (17746 34863))
++;;;;;;  "url/url.el" (17778 50479))
  ;;; Generated autoloads from url/url.el
  
  (autoload (quote url-retrieve) "url" "\
@@@ -28594,7 -28300,7 +28600,7 @@@ Handle file: and ftp: URLs
  ;;;***
  \f
  ;;;### (autoloads (url-open-stream url-gateway-nslookup-host) "url-gw"
- ;;;;;;  "url/url-gw.el" (17778 49132))
 -;;;;;;  "url/url-gw.el" (17759 30290))
++;;;;;;  "url/url-gw.el" (17778 50299))
  ;;; Generated autoloads from url/url-gw.el
  
  (autoload (quote url-gateway-nslookup-host) "url-gw" "\
@@@ -28658,7 -28364,7 +28664,7 @@@ Not documente
  ;;;***
  \f
  ;;;### (autoloads (url-http-options url-http-file-attributes url-http-file-exists-p
- ;;;;;;  url-http) "url-http" "url/url-http.el" (17778 49132))
 -;;;;;;  url-http) "url-http" "url/url-http.el" (17759 28874))
++;;;;;;  url-http) "url-http" "url/url-http.el" (17778 50479))
  ;;; Generated autoloads from url/url-http.el
  
  (autoload (quote url-http) "url-http" "\
@@@ -28854,7 -28560,7 +28860,7 @@@ Not documente
  ;;;***
  \f
  ;;;### (autoloads (url-generic-parse-url url-recreate-url) "url-parse"
- ;;;;;;  "url/url-parse.el" (17713 5994))
 -;;;;;;  "url/url-parse.el" (17759 28874))
++;;;;;;  "url/url-parse.el" (17778 50479))
  ;;; Generated autoloads from url/url-parse.el
  
  (autoload (quote url-recreate-url) "url-parse" "\
@@@ -28888,7 -28594,7 +28894,7 @@@ Setup variables that expose info about 
  ;;;;;;  url-strip-leading-spaces url-eat-trailing-space url-get-normalized-date
  ;;;;;;  url-lazy-message url-normalize-url url-insert-entities-in-string
  ;;;;;;  url-parse-args url-debug url-debug) "url-util" "url/url-util.el"
- ;;;;;;  (17713 2482))
 -;;;;;;  (17615 40606))
++;;;;;;  (17778 50479))
  ;;; Generated autoloads from url/url-util.el
  
  (defvar url-debug nil "\
@@@ -29017,7 -28723,7 +29023,7 @@@ This uses `url-current-object', set loc
  ;;;***
  \f
  ;;;### (autoloads (ask-user-about-supersession-threat ask-user-about-lock)
- ;;;;;;  "userlock" "userlock.el" (17390 26947))
 -;;;;;;  "userlock" "userlock.el" (17504 41540))
++;;;;;;  "userlock" "userlock.el" (17778 50479))
  ;;; Generated autoloads from userlock.el
  
  (autoload (quote ask-user-about-lock) "userlock" "\
@@@ -29432,20 -29138,25 +29438,25 @@@ find any project directory." (let ((pro
  
  ;;;***
  \f
- ;;;### (autoloads nil "vc-svn" "vc-svn.el" (17778 49122))
 -;;;### (autoloads nil "vc-svn" "vc-svn.el" (17746 41336))
++;;;### (autoloads nil "vc-svn" "vc-svn.el" (17778 50479))
  ;;; Generated autoloads from vc-svn.el
   (defun vc-svn-registered (f)
-   (when (file-readable-p (expand-file-name
-                         ".svn/entries" (file-name-directory f)))
+   (let ((admin-dir (cond ((and (eq system-type 'windows-nt)
+                              (getenv "SVN_ASP_DOT_NET_HACK"))
+                         "_svn")
+                        (t ".svn"))))
+     (when (file-readable-p (expand-file-name
+                           (concat admin-dir "/entries")
+                           (file-name-directory f)))
        (load "vc-svn")
-       (vc-svn-registered f)))
+       (vc-svn-registered f))))
  
  (add-to-list (quote completion-ignored-extensions) ".svn/")
  
  ;;;***
  \f
  ;;;### (autoloads (vhdl-mode) "vhdl-mode" "progmodes/vhdl-mode.el"
- ;;;;;;  (17713 2482))
 -;;;;;;  (17759 28874))
++;;;;;;  (17778 50476))
  ;;; Generated autoloads from progmodes/vhdl-mode.el
  
  (autoload (quote vhdl-mode) "vhdl-mode" "\
@@@ -30297,8 -30008,8 +30308,8 @@@ Exit View mode and make the current buf
  
  ;;;***
  \f
- ;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (17390
- ;;;;;;  26938))
 -;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (17746
 -;;;;;;  34861))
++;;;### (autoloads (vip-mode vip-setup) "vip" "emulation/vip.el" (17778
++;;;;;;  50473))
  ;;; Generated autoloads from emulation/vip.el
  
  (autoload (quote vip-setup) "vip" "\
@@@ -30314,7 -30025,7 +30325,7 @@@ Turn on VIP emulation of VI
  ;;;***
  \f
  ;;;### (autoloads (viper-mode toggle-viper-mode) "viper" "emulation/viper.el"
- ;;;;;;  (17778 49123))
 -;;;;;;  (17746 34861))
++;;;;;;  (17778 50473))
  ;;; Generated autoloads from emulation/viper.el
  
  (autoload (quote toggle-viper-mode) "viper" "\
@@@ -30485,7 -30197,7 +30496,7 @@@ and off otherwise
  ;;;;;;  whitespace-buffer whitespace-toggle-ateol-check whitespace-toggle-spacetab-check
  ;;;;;;  whitespace-toggle-indent-check whitespace-toggle-trailing-check
  ;;;;;;  whitespace-toggle-leading-check) "whitespace" "whitespace.el"
- ;;;;;;  (17713 5311))
 -;;;;;;  (17746 34861))
++;;;;;;  (17778 50479))
  ;;; Generated autoloads from whitespace.el
  
  (autoload (quote whitespace-toggle-leading-check) "whitespace" "\
@@@ -30603,8 -30315,8 +30614,8 @@@ With arg, turn widget mode on if and on
  ;;;***
  \f
  ;;;### (autoloads (widget-setup widget-insert widget-delete widget-create
- ;;;;;;  widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (17713
- ;;;;;;  5994))
 -;;;;;;  widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (17746
 -;;;;;;  34861))
++;;;;;;  widget-prompt-value widgetp) "wid-edit" "wid-edit.el" (17778
++;;;;;;  50479))
  ;;; Generated autoloads from wid-edit.el
  
  (autoload (quote widgetp) "wid-edit" "\
@@@ -30992,14 -30703,14 +31003,14 @@@ Zone out, completely
  ;;;;;;  "calc/calc-vec.el" "calc/calc-yank.el" "calc/calcalg2.el"
  ;;;;;;  "calc/calcalg3.el" "calc/calccomp.el" "calc/calcsel2.el"
  ;;;;;;  "calendar/cal-bahai.el" "calendar/cal-china.el" "calendar/cal-coptic.el"
- ;;;;;;  "calendar/cal-french.el" "calendar/cal-islam.el" "calendar/cal-iso.el"
- ;;;;;;  "calendar/cal-julian.el" "calendar/cal-mayan.el" "calendar/cal-menu.el"
- ;;;;;;  "calendar/cal-move.el" "calendar/cal-persia.el" "calendar/cal-tex.el"
- ;;;;;;  "calendar/cal-x.el" "case-table.el" "cdl.el" "cus-dep.el"
- ;;;;;;  "cus-load.el" "cus-start.el" "custom.el" "dframe.el" "dos-fns.el"
- ;;;;;;  "dos-vars.el" "dos-w32.el" "ediff-diff.el" "ediff-init.el"
- ;;;;;;  "ediff-merg.el" "ediff-ptch.el" "ediff-vers.el" "ediff-wind.el"
- ;;;;;;  "electric.el" "emacs-lisp/assoc.el" "emacs-lisp/authors.el"
+ ;;;;;;  "calendar/cal-french.el" "calendar/cal-html.el" "calendar/cal-islam.el"
+ ;;;;;;  "calendar/cal-iso.el" "calendar/cal-julian.el" "calendar/cal-mayan.el"
+ ;;;;;;  "calendar/cal-menu.el" "calendar/cal-move.el" "calendar/cal-persia.el"
+ ;;;;;;  "calendar/cal-tex.el" "calendar/cal-x.el" "case-table.el"
 -;;;;;;  "cdl.el" "cus-dep.el" "cus-start.el" "custom.el" "dframe.el"
 -;;;;;;  "dos-fns.el" "dos-vars.el" "dos-w32.el" "ediff-diff.el" "ediff-init.el"
 -;;;;;;  "ediff-merg.el" "ediff-ptch.el" "ediff-vers.el" "ediff-wind.el"
 -;;;;;;  "electric.el" "emacs-lisp/assoc.el" "emacs-lisp/authors.el"
++;;;;;;  "cdl.el" "cus-dep.el" "cus-load.el" "cus-start.el" "custom.el"
++;;;;;;  "dframe.el" "dos-fns.el" "dos-vars.el" "dos-w32.el" "ediff-diff.el"
++;;;;;;  "ediff-init.el" "ediff-merg.el" "ediff-ptch.el" "ediff-vers.el"
++;;;;;;  "ediff-wind.el" "electric.el" "emacs-lisp/assoc.el" "emacs-lisp/authors.el"
  ;;;;;;  "emacs-lisp/bindat.el" "emacs-lisp/byte-opt.el" "emacs-lisp/byte-run.el"
  ;;;;;;  "emacs-lisp/cl-compat.el" "emacs-lisp/cl-extra.el" "emacs-lisp/cl-macs.el"
  ;;;;;;  "emacs-lisp/cl-seq.el" "emacs-lisp/cl-specs.el" "emacs-lisp/cust-print.el"
  ;;;;;;  "term/vt100.el" "term/vt102.el" "term/vt125.el" "term/vt200.el"
  ;;;;;;  "term/vt201.el" "term/vt220.el" "term/vt240.el" "term/vt300.el"
  ;;;;;;  "term/vt320.el" "term/vt400.el" "term/vt420.el" "term/w32-win.el"
- ;;;;;;  "term/wyse50.el" "term/x-win.el" "term/xterm.el" "termdev.el"
- ;;;;;;  "textmodes/bib-mode.el" "textmodes/makeinfo.el" "textmodes/page-ext.el"
- ;;;;;;  "textmodes/page.el" "textmodes/refbib.el" "textmodes/refer.el"
- ;;;;;;  "textmodes/reftex-auc.el" "textmodes/reftex-dcr.el" "textmodes/reftex-ref.el"
- ;;;;;;  "textmodes/reftex-sel.el" "textmodes/reftex-toc.el" "textmodes/texnfo-upd.el"
- ;;;;;;  "textmodes/text-mode.el" "timezone.el" "tooltip.el" "tree-widget.el"
- ;;;;;;  "uniquify.el" "url/url-about.el" "url/url-cookie.el" "url/url-dired.el"
- ;;;;;;  "url/url-expand.el" "url/url-ftp.el" "url/url-history.el"
- ;;;;;;  "url/url-imap.el" "url/url-methods.el" "url/url-nfs.el" "url/url-proxy.el"
- ;;;;;;  "url/url-vars.el" "url/vc-dav.el" "vc-hooks.el" "vcursor.el"
- ;;;;;;  "version.el" "vms-patch.el" "vmsproc.el" "vt-control.el"
- ;;;;;;  "vt100-led.el" "w32-fns.el" "w32-vars.el" "widget.el" "window.el"
- ;;;;;;  "x-dnd.el") (17778 50114 410901))
 -;;;;;;  "term/wyse50.el" "textmodes/bib-mode.el" "textmodes/makeinfo.el"
++;;;;;;  "term/wyse50.el" "termdev.el" "textmodes/bib-mode.el" "textmodes/makeinfo.el"
+ ;;;;;;  "textmodes/page-ext.el" "textmodes/page.el" "textmodes/refbib.el"
+ ;;;;;;  "textmodes/refer.el" "textmodes/reftex-auc.el" "textmodes/reftex-dcr.el"
+ ;;;;;;  "textmodes/reftex-ref.el" "textmodes/reftex-sel.el" "textmodes/reftex-toc.el"
+ ;;;;;;  "textmodes/texnfo-upd.el" "textmodes/text-mode.el" "timezone.el"
+ ;;;;;;  "tooltip.el" "tree-widget.el" "uniquify.el" "url/url-about.el"
+ ;;;;;;  "url/url-cookie.el" "url/url-dired.el" "url/url-expand.el"
+ ;;;;;;  "url/url-ftp.el" "url/url-history.el" "url/url-imap.el" "url/url-methods.el"
+ ;;;;;;  "url/url-nfs.el" "url/url-proxy.el" "url/url-vars.el" "url/vc-dav.el"
+ ;;;;;;  "vc-hooks.el" "vcursor.el" "version.el" "vms-patch.el" "vmsproc.el"
+ ;;;;;;  "vt-control.el" "vt100-led.el" "w32-fns.el" "w32-vars.el"
 -;;;;;;  "widget.el" "window.el" "x-dnd.el") (17759 32231 360716))
++;;;;;;  "widget.el" "window.el" "x-dnd.el") (17778 59104 269580))
  
  ;;;***
  \f
Simple merge
Simple merge
diff --cc lisp/server.el
index 73d36ca4b189649f3e4084abd67e33832a6ee937,3ae585e9bc4b4153a457463c2dbf3acfc5bfc7d2..7a4179e85f61b02bcf7cffb79ee0b6a3833c9deb
@@@ -161,197 -197,86 +197,203 @@@ are done with it in the server."
  
  (defvar server-name "server")
  
 -(defvar server-socket-dir
 -  (format "/tmp/emacs%d" (user-uid)))
 +(defvar server-socket-dir nil
 +  "The directory in which to place the server socket.
 +Initialized by `server-start'.")
 +
 +(defun server-client (proc)
 +  "Return the Emacs client corresponding to PROC.
 +PROC must be a process object.
 +The car of the result is PROC; the cdr is an association list.
 +See `server-client-get' and `server-client-set'."
 +  (assq proc server-clients))
 +
 +(defun server-client-get (client property)
 +  "Get the value of PROPERTY in CLIENT.
 +CLIENT may be a process object, or a client returned by `server-client'.
 +Return nil if CLIENT has no such property."
 +  (or (listp client) (setq client (server-client client)))
 +  (cdr (assq property (cdr client))))
 +
 +(defun server-client-set (client property value)
 +  "Set the PROPERTY to VALUE in CLIENT, and return VALUE.
 +CLIENT may be a process object, or a client returned by `server-client'."
 +  (let (p proc)
 +    (if (listp client)
 +      (setq proc (car client))
 +      (setq proc client
 +          client (server-client client)))
 +    (setq p (assq property client))
 +    (cond
 +     (p (setcdr p value))
 +     (client (setcdr client (cons (cons property value) (cdr client))))
 +     (t (setq server-clients
 +            `((,proc (,property . ,value)) . ,server-clients))))
 +    value))
 +
 +(defun server-clients-with (property value)
 +  "Return a list of clients with PROPERTY set to VALUE."
 +  (let (result)
 +    (dolist (client server-clients result)
 +      (when (equal value (server-client-get client property))
 +      (setq result (cons (car client) result))))))
 +
 +(defun server-add-client (proc)
 +  "Create a client for process PROC, if it doesn't already have one.
 +New clients have no properties."
 +  (unless (server-client proc)
 +    (setq server-clients (cons (cons proc nil)
 +                             server-clients))))
 +
 +(defun server-getenv-from (env variable)
 +  "Get the value of VARIABLE in ENV.
 +VARIABLE should be a string.  Value is nil if VARIABLE is
 +undefined in ENV.  Otherwise, value is a string.
 +
 +ENV should be in the same format as `process-environment'."
 +  (let (entry result)
 +    (while (and env (null result))
 +      (setq entry (car env)
 +          env (cdr env))
 +      (if (and (> (length entry) (length variable))
 +             (eq ?= (aref entry (length variable)))
 +             (equal variable (substring entry 0 (length variable))))
 +        (setq result (substring entry (+ (length variable) 1)))))
 +    result))
 +
 +(defmacro server-with-environment (env vars &rest body)
 +  "Evaluate BODY with environment variables VARS set to those in ENV.
 +The environment variables are then restored to their previous values.
 +
 +VARS should be a list of strings.
 +ENV should be in the same format as `process-environment'."
 +  (declare (indent 2))
 +  (let ((oldvalues (make-symbol "oldvalues"))
 +      (var (make-symbol "var"))
 +      (value (make-symbol "value"))
 +      (pair (make-symbol "pair")))
 +    `(let (,oldvalues)
 +       (dolist (,var ,vars)
 +       (let ((,value (server-getenv-from ,env ,var)))
 +         (setq ,oldvalues (cons (cons ,var (getenv ,var)) ,oldvalues))
 +         (setenv ,var ,value)))
 +       (unwind-protect
 +         (progn ,@body)
 +       (dolist (,pair ,oldvalues)
 +         (setenv (car ,pair) (cdr ,pair)))))))
 +
 +(defun server-delete-client (client &optional noframe)
 +  "Delete CLIENT, including its buffers, terminals and frames.
 +If NOFRAME is non-nil, let the frames live.  (To be used from
 +`delete-frame-functions'.)"
 +  (server-log (concat "server-delete-client" (if noframe " noframe"))
 +            client)
 +  ;; Force a new lookup of client (prevents infinite recursion).
 +  (setq client (server-client
 +              (if (listp client) (car client) client)))
 +  (let ((proc (car client))
 +      (buffers (server-client-get client 'buffers)))
 +    (when client
 +
 +      ;; Kill the client's buffers.
 +      (dolist (buf buffers)
 +      (when (buffer-live-p buf)
 +        (with-current-buffer buf
 +          ;; Kill the buffer if necessary.
 +          (when (and (equal server-buffer-clients
 +                            (list proc))
 +                     (or (and server-kill-new-buffers
 +                              (not server-existing-buffer))
 +                         (server-temp-file-p))
 +                     (not (buffer-modified-p)))
 +            (let (flag)
 +              (unwind-protect
 +                  (progn (setq server-buffer-clients nil)
 +                         (kill-buffer (current-buffer))
 +                         (setq flag t))
 +                (unless flag
 +                  ;; Restore clients if user pressed C-g in `kill-buffer'.
 +                  (setq server-buffer-clients (list proc)))))))))
 +
 +      ;; Delete the client's frames.
 +      (unless noframe
 +      (dolist (frame (frame-list))
 +        (when (and (frame-live-p frame)
 +                   (equal proc (frame-parameter frame 'client)))
 +          ;; Prevent `server-handle-delete-frame' from calling us
 +          ;; recursively.
 +          (set-frame-parameter frame 'client nil)
 +          (delete-frame frame))))
 +
 +      (setq server-clients (delq client server-clients))
 +
 +      ;; Delete the client's tty.
 +      (let ((terminal (server-client-get client 'terminal)))
 +      (when (eq (terminal-live-p terminal) t)
 +        (delete-terminal terminal)))
 +
 +      ;; Delete the client's process.
 +      (if (eq (process-status (car client)) 'open)
 +        (delete-process (car client)))
 +
 +      (server-log "Deleted" proc))))
  
  (defun server-log (string &optional client)
 -  "If a *server* buffer exists, write STRING to it for logging purposes."
 +  "If a *server* buffer exists, write STRING to it for logging purposes.
 +If CLIENT is non-nil, add a description of it to the logged
 +message."
-   (if (get-buffer "*server*")
-       (with-current-buffer "*server*"
-       (goto-char (point-max))
-       (insert (current-time-string)
-               (cond
-                ((null client) " ")
-                ((listp client) (format " %s: " (car client)))
-                (t (format " %s: " client)))
-               string)
-       (or (bolp) (newline)))))
+   (when (get-buffer "*server*")
+     (with-current-buffer "*server*"
+       (goto-char (point-max))
+       (insert (current-time-string)
 -            (if client (format " %s:" client) " ")
++            (cond
++             ((null client) " ")
++             ((listp client) (format " %s: " (car client)))
++             (t (format " %s: " client)))
+             string)
+       (or (bolp) (newline)))))
  
  (defun server-sentinel (proc msg)
 -  (let ((client (assq proc server-clients)))
 -    ;; Remove PROC from the list of clients.
 -    (when client
 -      (setq server-clients (delq client server-clients))
 -      (dolist (buf (cdr client))
 -      (with-current-buffer buf
 -        ;; Remove PROC from the clients of each buffer.
 -        (setq server-buffer-clients (delq proc server-buffer-clients))
 -        ;; Kill the buffer if necessary.
 -        (when (and (null server-buffer-clients)
 -                   (or (and server-kill-new-buffers
 -                            (not server-existing-buffer))
 -                       (server-temp-file-p)))
 -          (kill-buffer (current-buffer)))))))
 +  "The process sentinel for Emacs server connections."
    ;; If this is a new client process, set the query-on-exit flag to nil
    ;; for this process (it isn't inherited from the server process).
    (when (and (eq (process-status proc) 'open)
             (process-query-on-exit-flag proc))
      (set-process-query-on-exit-flag proc nil))
 -  (server-log (format "Status changed to %s" (process-status proc)) proc))
 -
 -(defun server-select-display (display)
 -  ;; If the current frame is on `display' we're all set.
 -  (unless (equal (frame-parameter (selected-frame) 'display) display)
 -    ;; Otherwise, look for an existing frame there and select it.
 -    (dolist (frame (frame-list))
 -      (when (equal (frame-parameter frame 'display) display)
 -      (select-frame frame)))
 -    ;; If there's no frame on that display yet, create and select one.
 -    (unless (equal (frame-parameter (selected-frame) 'display) display)
 -      (let* ((buffer (generate-new-buffer " *server-dummy*"))
 -             (frame (make-frame-on-display
 -                     display
 -                     ;; Make it display (and remember) some dummy buffer, so
 -                     ;; we can detect later if the frame is in use or not.
 -                     `((server-dummmy-buffer . ,buffer)
 -                       ;; This frame may be deleted later (see
 -                       ;; server-unselect-display) so we want it to be as
 -                       ;; unobtrusive as possible.
 -                       (visibility . nil)))))
 -        (select-frame frame)
 -        (set-window-buffer (selected-window) buffer)))))
 -
 -(defun server-unselect-display (frame)
 -  ;; If the temporary frame is in use (displays something real), make it
 -  ;; visible.  If not (which can happen if the user's customizations call
 -  ;; pop-to-buffer etc.), delete it to avoid preserving the connection after
 -  ;; the last real frame is deleted.
 -  (if (and (eq (frame-first-window frame)
 -               (next-window (frame-first-window frame) 'nomini))
 -           (eq (window-buffer (frame-first-window frame))
 -               (frame-parameter frame 'server-dummy-buffer)))
 -      ;; The temp frame still only shows one buffer, and that is the
 -      ;; internal temp buffer.
 -      (delete-frame frame)
 -    (set-frame-parameter frame 'visibility t))
 -  (kill-buffer (frame-parameter frame 'server-dummy-buffer))
 -  (set-frame-parameter frame 'server-dummy-buffer nil))
+   ;; Delete the associated connection file, if applicable.
+   ;; This is actually problematic: the file may have been overwritten by
+   ;; another Emacs server in the mean time, so it's not ours any more.
+   ;; (and (process-contact proc :server)
+   ;;      (eq (process-status proc) 'closed)
+   ;;      (ignore-errors (delete-file (process-get proc :server-file))))
 +  (server-log (format "Status changed to %s: %s" (process-status proc) msg) proc)
 +  (server-delete-client proc))
 +
 +(defun server-handle-delete-frame (frame)
 +  "Delete the client connection when the emacsclient frame is deleted."
 +  (let ((proc (frame-parameter frame 'client)))
 +    (when (and (frame-live-p frame)
 +             proc
 +             ;; See if this is the last frame for this client.
 +             (>= 1 (let ((frame-num 0))
 +                    (dolist (f (frame-list))
 +                      (when (eq proc (frame-parameter f 'client))
 +                        (setq frame-num (1+ frame-num))))
 +                    frame-num)))
 +      (server-log (format "server-handle-delete-frame, frame %s" frame) proc)
 +      (server-delete-client proc 'noframe)))) ; Let delete-frame delete the frame later.
 +
 +(defun server-handle-suspend-tty (terminal)
 +  "Notify the emacsclient process to suspend itself when its tty device is suspended."
 +  (dolist (proc (server-clients-with 'terminal terminal))
 +    (server-log (format "server-handle-suspend-tty, terminal %s" terminal) proc)
 +    (condition-case err
 +      (server-send-string proc "-suspend \n")
 +      (file-error (condition-case nil (server-delete-client proc) (error nil))))))
  
  (defun server-unquote-arg (arg)
 +  "Remove &-quotation from ARG.
 +See `server-quote-arg' and `server-process-filter'."
    (replace-regexp-in-string
     "&." (lambda (s)
          (case (aref s 1)
@@@ -401,54 -307,67 +444,85 @@@ Creates the directory if necessary and 
  (defun server-start (&optional leave-dead)
    "Allow this Emacs process to be a server for client processes.
  This starts a server communications subprocess through which
 -client \"editors\" can send your editing commands to this Emacs job.
 -To use the server, set up the program `emacsclient' in the
 +client \"editors\" can send your editing commands to this Emacs
 +job.  To use the server, set up the program `emacsclient' in the
  Emacs distribution as your standard \"editor\".
  
 -Prefix arg means just kill any existing server communications subprocess."
 +Prefix arg LEAVE-DEAD means just kill any existing server
 +communications subprocess."
    (interactive "P")
 -  (when server-process
 -    ;; kill it dead!
 -    (ignore-errors (delete-process server-process)))
 -  ;; If this Emacs already had a server, clear out associated status.
 -  (while server-clients
 -    (let ((buffer (nth 1 (car server-clients))))
 -      (server-buffer-done buffer)))
 -  ;; Now any previous server is properly stopped.
 -  (unless leave-dead
 -    (let* ((server-dir (if server-use-tcp server-auth-dir server-socket-dir))
 -           (server-file (expand-file-name server-name server-dir)))
 -      ;; Make sure there is a safe directory in which to place the socket.
 -      (server-ensure-safe-dir server-dir)
 -      ;; Remove any leftover socket or authentication file.
 -      (ignore-errors (delete-file server-file))
 -      (when server-process
 -        (server-log (message "Restarting server")))
 -      (letf (((default-file-modes) ?\700))
 -        (setq server-process
 -              (apply #'make-network-process
 -                     :name server-name
 -                     :server t
 -                     :noquery t
 -                     :sentinel 'server-sentinel
 -                     :filter 'server-process-filter
 -                     ;; We must receive file names without being decoded.
 -                     ;; Those are decoded by server-process-filter according
 -                     ;; to file-name-coding-system.
 -                     :coding 'raw-text
 -                     ;; The rest of the args depends on the kind of socket used.
 -                     (if server-use-tcp
 -                         (list :family nil
 -                               :service t
 -                               :host (or server-host 'local)
 -                               :plist '(:authenticated nil))
 -                       (list :family 'local
 -                             :service server-file
 -                             :plist '(:authenticated t)))))
 -        (unless server-process (error "Could not start server process"))
 -        (when server-use-tcp
 -          (let ((auth-key
 -                 (loop
 -                    ;; The auth key is a 64-byte string of random chars in the
 -                    ;; range `!'..`~'.
 -                    for i below 64
 -                    collect (+ 33 (random 94)) into auth
 -                    finally return (concat auth))))
 -            (process-put server-process :auth-key auth-key)
 -            (with-temp-file server-file
 -              (set-buffer-multibyte nil)
 -              (setq buffer-file-coding-system 'no-conversion)
 -              (insert (format-network-address
 -                       (process-contact server-process :local))
 -                      " " (int-to-string (emacs-pid))
 -                      "\n" auth-key))))))))
 +  (when (or
 +       (not server-clients)
 +       (yes-or-no-p
 +        "The current server still has clients; delete them? "))
 +    ;; It is safe to get the user id now.
 +    (setq server-socket-dir (or server-socket-dir
 +                              (format "/tmp/emacs%d" (user-uid))))
-     ;; kill it dead!
-     (if server-process
-       (condition-case () (delete-process server-process) (error nil)))
++    (when server-process
++      ;; kill it dead!
++      (ignore-errors (delete-process server-process)))
 +    ;; Delete the socket files made by previous server invocations.
 +    (condition-case ()
 +      (delete-file (expand-file-name server-name server-socket-dir))
 +      (error nil))
 +    ;; If this Emacs already had a server, clear out associated status.
 +    (while server-clients
 +      (server-delete-client (car server-clients)))
 +    ;; Now any previous server is properly stopped.
 +    (if leave-dead
 +      (progn
 +        (server-log (message "Server stopped"))
 +        (setq server-process nil))
-       ;; Make sure there is a safe directory in which to place the socket.
-       (server-ensure-safe-dir server-socket-dir)
-       (if server-process
-         (server-log (message "Restarting server"))
-       (server-log (message "Starting server")))
-       (letf (((default-file-modes) ?\700))
-       (add-hook 'suspend-tty-functions 'server-handle-suspend-tty)
-       (add-hook 'delete-frame-functions 'server-handle-delete-frame)
-       (add-hook 'kill-buffer-query-functions 'server-kill-buffer-query-function)
-       (add-hook 'kill-emacs-query-functions 'server-kill-emacs-query-function)
-       (setq server-process
-             (make-network-process
-              :name "server" :family 'local :server t :noquery t
-              :service (expand-file-name server-name server-socket-dir)
-              :sentinel 'server-sentinel :filter 'server-process-filter
-              ;; We must receive file names without being decoded.
-              ;; Those are decoded by server-process-filter according
-              ;; to file-name-coding-system.
-              :coding 'raw-text))))))
++      (let* ((server-dir (if server-use-tcp server-auth-dir server-socket-dir))
++           (server-file (expand-file-name server-name server-dir)))
++      ;; Make sure there is a safe directory in which to place the socket.
++      (server-ensure-safe-dir server-dir)
++      ;; Remove any leftover socket or authentication file.
++      (ignore-errors (delete-file server-file))
++      (when server-process
++        (server-log (message "Restarting server")))
++      (letf (((default-file-modes) ?\700))
++        (add-hook 'suspend-tty-functions 'server-handle-suspend-tty)
++        (add-hook 'delete-frame-functions 'server-handle-delete-frame)
++        (add-hook 'kill-buffer-query-functions 'server-kill-buffer-query-function)
++        (add-hook 'kill-emacs-query-functions 'server-kill-emacs-query-function)
++        (setq server-process
++              (apply #'make-network-process
++                     :name server-name
++                     :server t
++                     :noquery t
++                     :sentinel 'server-sentinel
++                     :filter 'server-process-filter
++                     ;; We must receive file names without being decoded.
++                     ;; Those are decoded by server-process-filter according
++                     ;; to file-name-coding-system.
++                     :coding 'raw-text
++                     ;; The rest of the args depends on the kind of socket used.
++                     (if server-use-tcp
++                         (list :family nil
++                               :service t
++                               :host (or server-host 'local)
++                               :plist '(:authenticated nil))
++                       (list :family 'local
++                             :service server-file
++                             :plist '(:authenticated t)))))
++        (unless server-process (error "Could not start server process"))
++        (when server-use-tcp
++          (let ((auth-key
++                 (loop
++                  ;; The auth key is a 64-byte string of random chars in the
++                  ;; range `!'..`~'.
++                  for i below 64
++                  collect (+ 33 (random 94)) into auth
++                  finally return (concat auth))))
++            (process-put server-process :auth-key auth-key)
++            (with-temp-file server-file
++              (set-buffer-multibyte nil)
++              (setq buffer-file-coding-system 'no-conversion)
++              (insert (format-network-address
++                       (process-contact server-process :local))
++                      " " (int-to-string (emacs-pid))
++                      "\n" auth-key)))))))))
  
  ;;;###autoload
  (define-minor-mode server-mode
@@@ -463,388 -382,133 +537,416 @@@ Server mode runs a process that accept
    ;; nothing if there is one (for multiple Emacs sessions)?
    (server-start (not server-mode)))
  \f
- (defun server-process-filter (proc string)
+ (defun* server-process-filter (proc string)
    "Process a request from the server to edit some files.
 -PROC is the server process.  Format of STRING is \"PATH PATH PATH... \\n\"."
 +PROC is the server process.  STRING consists of a sequence of
 +commands prefixed by a dash.  Some commands have arguments; these
 +are &-quoted and need to be decoded by `server-unquote-arg'.  The
 +filter parses and executes these commands.
 +
 +To illustrate the protocol, here is an example command that
 +emacsclient sends to create a new X frame (note that the whole
 +sequence is sent on a single line):
 +
 +      -version 21.3.50 xterm
 +      -env HOME /home/lorentey
 +      -env DISPLAY :0.0
 +      ... lots of other -env commands
 +      -display :0.0
 +      -window-system
 +
 +The server normally sends back the single command `-good-version'
 +as a response.
 +
 +The following commands are accepted by the server:
 +
++`-auth AUTH-STRING'
++  Authenticate the client using the secret authentication string
++  AUTH_STRING.
++
 +`-version CLIENT-VERSION'
 +  Check version numbers between server and client, and signal an
 +  error if there is a mismatch.  The server replies with
 +  `-good-version' to confirm the match.
 +
 +`-env NAME=VALUE'
 +  An environment variable on the client side.
 +
 +`-dir DIRNAME'
 +  The current working directory of the client process.
 +
 +`-current-frame'
 +  Forbid the creation of new frames.
 +
 +`-nowait'
 +  Request that the next frame created should not be
 +  associated with this client.
 +
 +`-display DISPLAY'
 +  Set the display name to open X frames on.
 +
 +`-position LINE[:COLUMN]'
 +  Go to the given line and column number
 +  in the next file opened.
 +
 +`-file FILENAME'
 +  Load the given file in the current frame.
 +
 +`-eval EXPR'
 +  Evaluate EXPR as a Lisp expression and return the
 +  result in -print commands.
 +
 +`-window-system'
 +  Open a new X frame.
 +
 +`-tty DEVICENAME TYPE'
 +  Open a new tty frame at the client.
 +
 +`-suspend'
 +  Suspend this tty frame.  The client sends this string in
 +  response to SIGTSTP and SIGTTOU.  The server must cease all I/O
 +  on this tty until it gets a -resume command.
 +
 +`-resume'
 +  Resume this tty frame. The client sends this string when it
 +  gets the SIGCONT signal and it is the foreground process on its
 +  controlling tty.
 +
 +`-ignore COMMENT'
 +  Do nothing, but put the comment in the server
 +  log.  Useful for debugging.
 +
 +
 +The following commands are accepted by the client:
 +
 +`-good-version'
 +  Signals a version match between the client and the server.
 +
 +`-emacs-pid PID'
 +  Describes the process id of the Emacs process;
 +  used to forward window change signals to it.
 +
 +`-window-system-unsupported'
 +  Signals that the server does not
 +  support creating X frames; the client must try again with a tty
 +  frame.
 +
 +`-print STRING'
 +  Print STRING on stdout.  Used to send values
 +  returned by -eval.
 +
 +`-error DESCRIPTION'
 +  Signal an error (but continue processing).
 +
 +`-suspend'
 +  Suspend this terminal, i.e., stop the client process.  Sent
 +  when the user presses C-z."
 +  (server-log (concat "Received " string) proc)
+   ;; First things first: let's check the authentication
+   (unless (process-get proc :authenticated)
+     (if (and (string-match "-auth \\(.*?\\)\n" string)
 -             (equal (match-string 1 string) (process-get proc :auth-key)))
 -        (progn
 -          (setq string (substring string (match-end 0)))
 -          (process-put proc :authenticated t)
 -          (server-log "Authentication successful" proc))
++           (equal (match-string 1 string) (process-get proc :auth-key)))
++      (progn
++        (setq string (substring string (match-end 0)))
++        (process-put proc :authenticated t)
++        (server-log "Authentication successful" proc))
+       (server-log "Authentication failed" proc)
 -      (process-send-string proc "Authentication failed")
++      (server-send-string
++       proc (concat "-error " (server-quote-arg "Authentication failed")))
+       (delete-process proc)
+       ;; We return immediately
+       (return-from server-process-filter)))
 -  (server-log string proc)
 -  (let ((prev (process-get proc :previous-string)))
 -    (when prev
 -      (setq string (concat prev string))
 -      (process-put proc :previous-string nil)))
+   (when (> (recursion-depth) 0)
+     ;; We're inside a minibuffer already, so if the emacs-client is trying
+     ;; to open a frame on a new display, we might end up with an unusable
+     ;; frame because input from that display will be blocked (until exiting
+     ;; the minibuffer).  Better exit this minibuffer right away.
+     ;; Similarly with recursive-edits such as the splash screen.
+     (process-put proc :previous-string string)
+     (run-with-timer 0 nil (lexical-let ((proc proc))
 -                            (lambda () (server-process-filter proc ""))))
++                          (lambda () (server-process-filter proc ""))))
+     (top-level))
 -  ;; If the input is multiple lines,
 -  ;; process each line individually.
 -  (while (string-match "\n" string)
 -    (let ((request (substring string 0 (match-beginning 0)))
 -        (coding-system (and default-enable-multibyte-characters
 -                            (or file-name-coding-system
 -                                default-file-name-coding-system)))
 -        client nowait eval
 -        (files nil)
 -        (lineno 1)
 -        (tmp-frame nil) ;; Sometimes used to embody the selected display.
 -        (columnno 0))
 -      ;; Remove this line from STRING.
 -      (setq string (substring string (match-end 0)))
 -      (setq client (cons proc nil))
 -      (while (string-match "[^ ]* " request)
 -      (let ((arg (substring request (match-beginning 0) (1- (match-end 0)))))
 -        (setq request (substring request (match-end 0)))
 -        (cond
 -            ((equal "-nowait" arg) (setq nowait t))
 -            ((equal "-eval" arg) (setq eval t))
 -            ((and (equal "-display" arg) (string-match "\\([^ ]*\\) " request))
 -             (let ((display (server-unquote-arg (match-string 1 request))))
 -               (setq request (substring request (match-end 0)))
 -               (condition-case err
 -                   (setq tmp-frame (server-select-display display))
 -                 (error (process-send-string proc (nth 1 err))
 -                        (setq request "")))))
 -            ;; ARG is a line number option.
 -            ((string-match "\\`\\+[0-9]+\\'" arg)
 -             (setq lineno (string-to-number (substring arg 1))))
 -            ;; ARG is line number:column option.
 -            ((string-match "\\`+\\([0-9]+\\):\\([0-9]+\\)\\'" arg)
 -             (setq lineno (string-to-number (match-string 1 arg))
 -                   columnno (string-to-number (match-string 2 arg))))
 -            (t
 -             ;; Undo the quoting that emacsclient does
 -             ;; for certain special characters.
 -             (setq arg (server-unquote-arg arg))
 -             ;; Now decode the file name if necessary.
 -             (when coding-system
 -               (setq arg (decode-coding-string arg coding-system)))
 -             (if eval
 -                 (let* (errorp
 -                        (v (condition-case errobj
 -                               (eval (car (read-from-string arg)))
 -                             (error (setq errorp t) errobj))))
 -                   (when v
 -                     (with-temp-buffer
 -                       (let ((standard-output (current-buffer)))
 -                         (when errorp (princ "error: "))
 -                         (pp v)
 -                         (ignore-errors
 -                           (process-send-region proc (point-min) (point-max)))
 -                         ))))
 -               ;; ARG is a file name.
 -               ;; Collapse multiple slashes to single slashes.
 -               (setq arg (command-line-normalize-file-name arg))
 -               (push (list arg lineno columnno) files))
 -             (setq lineno 1)
 -             (setq columnno 0)))))
 -      (when files
 -      (run-hooks 'pre-command-hook)
 -      (server-visit-files files client nowait)
 -      (run-hooks 'post-command-hook))
 -      ;; CLIENT is now a list (CLIENTNUM BUFFERS...)
 -      (if (null (cdr client))
 -        ;; This client is empty; get rid of it immediately.
 -        (progn
 -          (delete-process proc)
 -          (server-log "Close empty client" proc))
 -      ;; We visited some buffer for this client.
 -      (or nowait (push client server-clients))
 -      (unless (or isearch-mode (minibufferp))
 -        (server-switch-buffer (nth 1 client))
 -        (run-hooks 'server-switch-hook)
 -        (unless nowait
 -          (message "%s" (substitute-command-keys
 -                           "When done with a buffer, type \\[server-edit]")))))
 -      (when (frame-live-p tmp-frame)
 -        ;; Delete tmp-frame or make it visible depending on whether it's
 -        ;; been used or not.
 -        (server-unselect-display tmp-frame))))
 -  ;; Save for later any partial line that remains.
 -  (when (> (length string) 0)
 -    (process-put proc :previous-string string)))
 +  (let ((prev (process-get proc 'previous-string)))
 +    (when prev
 +      (setq string (concat prev string))
 +      (process-put proc 'previous-string nil)))
 +  (condition-case err
 +      (progn
 +      (server-add-client proc)
 +      ;; If the input is multiple lines,
 +      ;; process each line individually.
 +      (while (string-match "\n" string)
 +        (let ((request (substring string 0 (match-beginning 0)))
 +              (coding-system (and default-enable-multibyte-characters
 +                                  (or file-name-coding-system
 +                                      default-file-name-coding-system)))
 +              (client (server-client proc))
 +              current-frame
 +              nowait ; t if emacsclient does not want to wait for us.
 +              frame ; The frame that was opened for the client (if any).
 +              display              ; Open the frame on this display.
 +              dontkill       ; t if the client should not be killed.
 +              env
 +              dir
 +              (files nil)
 +              (lineno 1)
 +              (columnno 0))
 +          ;; Remove this line from STRING.
 +          (setq string (substring string (match-end 0)))
 +          (while (string-match " *[^ ]* " request)
 +            (let ((arg (substring request (match-beginning 0) (1- (match-end 0)))))
 +              (setq request (substring request (match-end 0)))
 +              (cond
 +               ;; -version CLIENT-VERSION:
 +               ;; Check version numbers, signal an error if there is a mismatch.
 +               ((and (equal "-version" arg)
 +                     (string-match "\\([0-9.]+\\) " request))
 +                (let* ((client-version (match-string 1 request))
 +                       (truncated-emacs-version
 +                        (substring emacs-version 0 (length client-version))))
 +                  (setq request (substring request (match-end 0)))
 +                  (if (equal client-version truncated-emacs-version)
 +                      (progn
 +                        (server-send-string proc "-good-version \n")
 +                        (server-client-set client 'version client-version))
 +                    (error (concat "Version mismatch: Emacs is "
 +                                   truncated-emacs-version
 +                                   ", emacsclient is " client-version)))))
 +
 +               ;; -nowait:  Emacsclient won't wait for a result.
 +               ((equal "-nowait" arg) (setq nowait t))
 +
 +               ;; -current-frame:  Don't create frames.
 +               ((equal "-current-frame" arg) (setq current-frame t))
 +
 +               ;; -display DISPLAY:
 +               ;; Open X frames on the given display instead of the default.
 +               ((and (equal "-display" arg) (string-match "\\([^ ]*\\) " request))
 +                (setq display (match-string 1 request)
 +                      request (substring request (match-end 0))))
 +
 +               ;; -window-system:  Open a new X frame.
 +               ((equal "-window-system" arg)
 +                (unless (server-client-get client 'version)
 +                  (error "Protocol error; make sure to use the correct version of emacsclient"))
 +                (unless current-frame
 +                  (if (fboundp 'x-create-frame)
 +                      (let ((params (if nowait
 +                                        ;; Flag frame as client-created, but use a dummy client.
 +                                        ;; This will prevent the frame from being deleted when
 +                                        ;; emacsclient quits while also preventing
 +                                        ;; `server-save-buffers-kill-terminal' from unexpectedly
 +                                        ;; killing emacs on that frame.
 +                                        (list (cons 'client 'nowait) (cons 'environment env))
 +                                      (list (cons 'client proc) (cons 'environment env)))))
 +                        (setq frame (make-frame-on-display
 +                                     (or display
 +                                         (frame-parameter nil 'display)
 +                                         (getenv "DISPLAY")
 +                                         (error "Please specify display"))
 +                                     params))
 +                        (server-log (format "%s created" frame) proc)
 +                        ;; XXX We need to ensure the parameters are
 +                        ;; really set because Emacs forgets unhandled
 +                        ;; initialization parameters for X frames at
 +                        ;; the moment.
 +                        (modify-frame-parameters frame params)
 +                        (select-frame frame)
 +                        (server-client-set client 'frame frame)
 +                        (server-client-set client 'terminal (frame-terminal frame))
 +
 +                        ;; Display *scratch* by default.
 +                        (switch-to-buffer (get-buffer-create "*scratch*") 'norecord)
 +                        (if dir (setq default-directory dir))
 +
 +                        (setq dontkill t))
 +                    ;; This emacs does not support X.
 +                    (server-log "Window system unsupported" proc)
 +                    (server-send-string proc "-window-system-unsupported \n")
 +                    (setq dontkill t))))
 +
 +               ;; -resume:  Resume a suspended tty frame.
 +               ((equal "-resume" arg)
 +                (let ((terminal (server-client-get client 'terminal)))
 +                  (setq dontkill t)
 +                  (when (eq (terminal-live-p terminal) t)
 +                    (resume-tty terminal))))
 +
 +               ;; -suspend:  Suspend the client's frame.  (In case we
 +               ;; get out of sync, and a C-z sends a SIGTSTP to
 +               ;; emacsclient.)
 +               ((equal "-suspend" arg)
 +                (let ((terminal (server-client-get client 'terminal)))
 +                  (setq dontkill t)
 +                  (when (eq (terminal-live-p terminal) t)
 +                    (suspend-tty terminal))))
 +
 +               ;; -ignore COMMENT:  Noop; useful for debugging emacsclient.
 +               ;; (The given comment appears in the server log.)
 +               ((and (equal "-ignore" arg) (string-match "\\([^ ]*\\) " request))
 +                (setq dontkill t
 +                      request (substring request (match-end 0))))
 +
 +               ;; -tty DEVICE-NAME TYPE:  Open a new tty frame at the client.
 +               ((and (equal "-tty" arg) (string-match "\\([^ ]*\\) \\([^ ]*\\) " request))
 +                (let ((tty (server-unquote-arg (match-string 1 request)))
 +                      (type (server-unquote-arg (match-string 2 request))))
 +                  (setq request (substring request (match-end 0)))
 +                  (unless (server-client-get client 'version)
 +                    (error "Protocol error; make sure you use the correct version of emacsclient"))
 +                  (unless current-frame
 +                    (server-with-environment env
 +                        '("LANG" "LC_CTYPE" "LC_ALL"
 +                          ;; For tgetent(3); list according to ncurses(3).
 +                          "BAUDRATE" "COLUMNS" "ESCDELAY" "HOME" "LINES"
 +                          "NCURSES_ASSUMED_COLORS" "NCURSES_NO_PADDING"
 +                          "NCURSES_NO_SETBUF" "TERM" "TERMCAP" "TERMINFO"
 +                          "TERMINFO_DIRS" "TERMPATH")
 +                      (setq frame (make-frame-on-tty tty type
 +                                                     ;; Ignore nowait here; we always need to clean
 +                                                     ;; up opened ttys when the client dies.
 +                                                     `((client . ,proc)
 +                                                       (environment . ,env)))))
 +                    (select-frame frame)
 +                    (server-client-set client 'frame frame)
 +                    (server-client-set client 'tty (terminal-name frame))
 +                    (server-client-set client 'terminal (frame-terminal frame))
 +
 +                    ;; Display *scratch* by default.
 +                    (switch-to-buffer (get-buffer-create "*scratch*") 'norecord)
 +                    (if dir (setq default-directory dir))
 +
 +                    ;; Reply with our pid.
 +                    (server-send-string proc (concat "-emacs-pid " (number-to-string (emacs-pid)) "\n"))
 +                    (setq dontkill t))))
 +
 +               ;; -position LINE:  Go to the given line in the next file.
 +               ((and (equal "-position" arg) (string-match "\\(\\+[0-9]+\\) " request))
 +                (setq lineno (string-to-number (substring (match-string 1 request) 1))
 +                      request (substring request (match-end 0))))
 +
 +               ;; -position LINE:COLUMN:  Set point to the given position in the next file.
 +               ((and (equal "-position" arg) (string-match "\\+\\([0-9]+\\):\\([0-9]+\\) " request))
 +                (setq lineno (string-to-number (match-string 1 request))
 +                      columnno (string-to-number (match-string 2 request))
 +                      request (substring request (match-end 0))))
 +
 +               ;; -file FILENAME:  Load the given file.
 +               ((and (equal "-file" arg) (string-match "\\([^ ]+\\) " request))
 +                (let ((file (server-unquote-arg (match-string 1 request))))
 +                  (setq request (substring request (match-end 0)))
 +                  (if coding-system
 +                      (setq file (decode-coding-string file coding-system)))
 +                  (setq file (command-line-normalize-file-name file))
 +                  (push (list file lineno columnno) files)
 +                  (server-log (format "New file: %s (%d:%d)" file lineno columnno) proc))
 +                (setq lineno 1
 +                      columnno 0))
 +
 +               ;; -eval EXPR:  Evaluate a Lisp expression.
 +               ((and (equal "-eval" arg) (string-match "\\([^ ]+\\) " request))
 +                (let ((expr (server-unquote-arg (match-string 1 request))))
 +                  (setq request (substring request (match-end 0)))
 +                  (if coding-system
 +                      (setq expr (decode-coding-string expr coding-system)))
 +                  (let ((v (eval (car (read-from-string expr)))))
 +                    (when (and (not frame) v)
 +                      (with-temp-buffer
 +                        (let ((standard-output (current-buffer)))
 +                          (pp v)
 +                          (server-send-string
 +                           proc (format "-print %s\n"
 +                                        (server-quote-arg
 +                                         (buffer-substring-no-properties (point-min)
 +                                                                         (point-max)))))))))
 +                  (setq lineno 1
 +                        columnno 0)))
 +
 +               ;; -env NAME=VALUE:  An environment variable.
 +               ((and (equal "-env" arg) (string-match "\\([^ ]+\\) " request))
 +                (let ((var (server-unquote-arg (match-string 1 request))))
 +                  ;; XXX Variables should be encoded as in getenv/setenv.
 +                  (setq request (substring request (match-end 0)))
 +                  (setq env (cons var env))))
 +
 +               ;; -dir DIRNAME:  The cwd of the emacsclient process.
 +               ((and (equal "-dir" arg) (string-match "\\([^ ]+\\) " request))
 +                (setq dir (server-unquote-arg (match-string 1 request)))
 +                (setq request (substring request (match-end 0)))
 +                (if coding-system
 +                    (setq dir (decode-coding-string dir coding-system)))
 +                (setq dir (command-line-normalize-file-name dir)))
 +
 +               ;; Unknown command.
 +               (t (error "Unknown command: %s" arg)))))
 +
 +          (let (buffers)
 +            (when files
 +              (run-hooks 'pre-command-hook)
 +              (setq buffers (server-visit-files files client nowait))
 +              (run-hooks 'post-command-hook))
 +
 +            (when frame
 +              (with-selected-frame frame
 +                (display-startup-echo-area-message)
 +                (unless inhibit-splash-screen
 +                  (condition-case err
 +                      ;; This looks scary because `fancy-splash-screens'
 +                      ;; will call `recursive-edit' from a process filter.
 +                      ;; However, that should be safe to do now.
 +                      (display-splash-screen t)
 +                    ;; `recursive-edit' will throw an error if Emacs is
 +                    ;; already doing a recursive edit elsewhere.  Catch it
 +                    ;; here so that we can finish normally.
 +                    (error nil)))))
 +
 +            ;; Delete the client if necessary.
 +            (cond
 +             (nowait
 +              ;; Client requested nowait; return immediately.
 +              (server-log "Close nowait client" proc)
 +              (server-delete-client proc))
 +             ((and (not dontkill) (null buffers))
 +              ;; This client is empty; get rid of it immediately.
 +              (server-log "Close empty client" proc)
 +              (server-delete-client proc)))
 +            (cond
 +             ((or isearch-mode (minibufferp))
 +              nil)
 +             ((and frame (null buffers))
 +              (message "%s" (substitute-command-keys
 +                             "When done with this frame, type \\[delete-frame]")))
 +             ((not (null buffers))
 +              (server-switch-buffer (car buffers))
 +              (run-hooks 'server-switch-hook)
 +              (unless nowait
 +                (message "%s" (substitute-command-keys
 +                               "When done with a buffer, type \\[server-edit]"))))))))
 +
 +      ;; Save for later any partial line that remains.
 +      (when (> (length string) 0)
 +        (process-put proc 'previous-string string)))
 +    ;; condition-case
 +    (error (ignore-errors
 +           (server-send-string
 +            proc (concat "-error " (server-quote-arg (error-message-string err))))
 +           (setq string "")
 +           (server-log (error-message-string err) proc)
 +           (delete-process proc)))))
  
  (defun server-goto-line-column (file-line-col)
 +  "Move point to the position indicated in FILE-LINE-COL.
 +FILE-LINE-COL should be a three-element list as described in
 +`server-visit-files'."
    (goto-line (nth 1 file-line-col))
    (let ((column-number (nth 2 file-line-col)))
 -    (when (> column-number 0)
 -      (move-to-column (1- column-number)))))
 +    (if (> column-number 0)
 +      (move-to-column (1- column-number)))))
  
  (defun server-visit-files (files client &optional nowait)
 -  "Find FILES and return the list CLIENT with the buffers nconc'd.
 +  "Find FILES and return a list of buffers created.
  FILES is an alist whose elements are (FILENAME LINENUMBER COLUMNNUMBER).
 +CLIENT is the client that requested this operation.
  NOWAIT non-nil means this client is not waiting for the results,
  so don't mark these buffers specially, just visit them normally."
    ;; Bind last-nonmenu-event to force use of keyboard, not mouse, for queries.
        ;; If there is an existing buffer modified or the file is
        ;; modified, revert it.  If there is an existing buffer with
        ;; deleted file, offer to write it.
-       (let* ((filen (car file))
+       (let* ((minibuffer-auto-raise (or server-raise-frame
 -                                          minibuffer-auto-raise))
++                                        minibuffer-auto-raise))
+              (filen (car file))
               (obuf (get-file-buffer filen)))
          (add-to-history 'file-name-history filen)
          (if (and obuf (set-buffer obuf))
              (progn
                (cond ((file-exists-p filen)
-                      (if (not (verify-visited-file-modtime obuf))
-                          (revert-buffer t nil)))
+                      (when (not (verify-visited-file-modtime obuf))
 -                         (revert-buffer t nil)))
++                       (revert-buffer t nil)))
                      (t
-                      (if (y-or-n-p
-                           (concat "File no longer exists: " filen
-                                   ", write buffer to file? "))
-                          (write-file filen))))
+                      (when (y-or-n-p
 -                              (concat "File no longer exists: "
 -                                      filen
 -                                      ", write buffer to file? "))
 -                         (write-file filen))))
 -              (setq server-existing-buffer t)
++                            (concat "File no longer exists: " filen
++                                    ", write buffer to file? "))
++                       (write-file filen))))
 +              (unless server-buffer-clients
 +                (setq server-existing-buffer t))
                (server-goto-line-column file))
            (set-buffer (find-file-noselect filen))
            (server-goto-line-column file)
@@@ -895,51 -557,54 +999,51 @@@ or nil.  KILLED is t if we killed BUFFE
  a temp file).
  FOR-KILLING if non-nil indicates that we are called from `kill-buffer'."
    (let ((next-buffer nil)
 -      (killed nil)
 -      (old-clients server-clients))
 -    (while old-clients
 -      (let ((client (car old-clients)))
 +      (killed nil))
 +    (dolist (client server-clients)
 +      (let ((buffers (server-client-get client 'buffers)))
        (or next-buffer
 -          (setq next-buffer (nth 1 (memq buffer client))))
 -      (delq buffer client)
 -      ;; Delete all dead buffers from CLIENT.
 -      (let ((tail client))
 -        (while tail
 -          (and (bufferp (car tail))
 -               (null (buffer-name (car tail)))
 -               (delq (car tail) client))
 -          (setq tail (cdr tail))))
 -      ;; If client now has no pending buffers,
 -      ;; tell it that it is done, and forget it entirely.
 -      (unless (cdr client)
 -        (delete-process (car client))
 -        (server-log "Close" (car client))
 -        (setq server-clients (delq client server-clients))))
 -      (setq old-clients (cdr old-clients)))
 +          (setq next-buffer (nth 1 (memq buffer buffers))))
 +      (when buffers                   ; Ignore bufferless clients.
 +        (setq buffers (delq buffer buffers))
 +        ;; Delete all dead buffers from CLIENT.
 +        (dolist (b buffers)
 +          (and (bufferp b)
 +               (not (buffer-live-p b))
 +               (setq buffers (delq b buffers))))
 +        (server-client-set client 'buffers buffers)
 +        ;; If client now has no pending buffers,
 +        ;; tell it that it is done, and forget it entirely.
 +        (unless buffers
 +          (server-log "Close" client)
 +          (server-delete-client client)))))
-     (if (and (bufferp buffer) (buffer-name buffer))
-       ;; We may or may not kill this buffer;
-       ;; if we do, do not call server-buffer-done recursively
-       ;; from kill-buffer-hook.
-       (let ((server-kill-buffer-running t))
-         (with-current-buffer buffer
-           (setq server-buffer-clients nil)
-           (run-hooks 'server-done-hook))
-         ;; Notice whether server-done-hook killed the buffer.
-         (if (null (buffer-name buffer))
+     (when (and (bufferp buffer) (buffer-name buffer))
+       ;; We may or may not kill this buffer;
+       ;; if we do, do not call server-buffer-done recursively
+       ;; from kill-buffer-hook.
+       (let ((server-kill-buffer-running t))
+       (with-current-buffer buffer
+         (setq server-buffer-clients nil)
+         (run-hooks 'server-done-hook))
+       ;; Notice whether server-done-hook killed the buffer.
+       (if (null (buffer-name buffer))
+           (setq killed t)
+         ;; Don't bother killing or burying the buffer
+         ;; when we are called from kill-buffer.
+         (unless for-killing
+           (when (and (not killed)
+                      server-kill-new-buffers
+                      (with-current-buffer buffer
+                        (not server-existing-buffer)))
              (setq killed t)
-           ;; Don't bother killing or burying the buffer
-           ;; when we are called from kill-buffer.
-           (unless for-killing
-             (when (and (not killed)
-                        server-kill-new-buffers
-                        (with-current-buffer buffer
-                          (not server-existing-buffer)))
-               (setq killed t)
-               (bury-buffer buffer)
-               (kill-buffer buffer))
-             (unless killed
-               (if (server-temp-file-p buffer)
-                   (progn
-                     (kill-buffer buffer)
-                     (setq killed t))
-                 (bury-buffer buffer)))))))
+             (bury-buffer buffer)
+             (kill-buffer buffer))
+           (unless killed
+             (if (server-temp-file-p buffer)
+                 (progn
+                   (kill-buffer buffer)
+                   (setq killed t))
+               (bury-buffer buffer)))))))
      (list next-buffer killed)))
  
  (defun server-temp-file-p (&optional buffer)
@@@ -987,15 -646,21 +1091,15 @@@ specifically for the clients and did no
        (yes-or-no-p (format "Buffer `%s' still has clients; kill it? "
                           (buffer-name (current-buffer))))))
  
 -(add-hook 'kill-buffer-query-functions
 -        'server-kill-buffer-query-function)
 -
  (defun server-kill-emacs-query-function ()
 -  (let (live-client
 -      (tail server-clients))
 -    ;; See if any clients have any buffers that are still alive.
 -    (while tail
 -      (when (memq t (mapcar 'stringp (mapcar 'buffer-name (cdr (car tail)))))
 -      (setq live-client t))
 -      (setq tail (cdr tail)))
 -    (or (not live-client)
 -      (yes-or-no-p "Server buffers still have clients; exit anyway? "))))
 -
 -(add-hook 'kill-emacs-query-functions 'server-kill-emacs-query-function)
 +  "Ask before exiting Emacs it has live clients."
 +  (or (not server-clients)
 +      (let (live-client)
 +      (dolist (client server-clients live-client)
-         (if (memq t (mapcar 'buffer-live-p (server-client-get
-                                             client 'buffers)))
-             (setq live-client t))))
++        (when (memq t (mapcar 'buffer-live-p (server-client-get
++                                              client 'buffers)))
++          (setq live-client t))))
 +      (yes-or-no-p "This Emacs session has clients; exit anyway? ")))
  
  (defvar server-kill-buffer-running nil
    "Non-nil while `server-kill-buffer' or `server-buffer-done' is running.")
@@@ -1093,26 -746,10 +1195,28 @@@ done that.
                (switch-to-buffer next-buffer)
              ;; After all the above, we might still have ended up with
              ;; a minibuffer/dedicated-window (if there's no other).
-             (error (pop-to-buffer next-buffer)))))))))
+             (error (pop-to-buffer next-buffer)))))))
+     (when server-raise-frame
+       (select-frame-set-input-focus (window-frame (selected-window))))))
  
 +;;;###autoload
 +(defun server-save-buffers-kill-terminal (proc &optional arg)
 +  "Offer to save each buffer, then kill PROC.
 +
 +With prefix arg, silently save all file-visiting buffers, then kill.
 +
 +If emacsclient was started with a list of filenames to edit, then
 +only these files will be asked to be saved."
 +  (let ((buffers (server-client-get proc 'buffers)))
 +    ;; If client is bufferless, emulate a normal Emacs session
 +    ;; exit and offer to save all buffers.  Otherwise, offer to
 +    ;; save only the buffers belonging to the client.
 +    (save-some-buffers arg
 +                     (if buffers
 +                         (lambda () (memq (current-buffer) buffers))
 +                       t))
 +    (server-delete-client proc)))
 +
  (define-key ctl-x-map "#" 'server-edit)
  
  (defun server-unload-hook ()
diff --cc lisp/simple.el
Simple merge
diff --cc lisp/startup.el
Simple merge
diff --cc lisp/subr.el
Simple merge
Simple merge
index e574c34543f1b08fd3cb1f00dabe561d4b12b208,fac25d866994d3f20bd51979fc8cb90a2c27b31e..fd21c77bbf9f2b303d58cc9608d0c8aea4a9eb60
  
  ;;; Code:
  
 +(defvar xterm-function-map (make-sparse-keymap)
 +  "Function key map overrides for xterm.")
 +
 +;; xterm from X.org 6.8.2 uses these key definitions.
 +(define-key xterm-function-map "\eOP" [f1])
 +(define-key xterm-function-map "\eOQ" [f2])
 +(define-key xterm-function-map "\eOR" [f3])
 +(define-key xterm-function-map "\eOS" [f4])
 +(define-key xterm-function-map "\e[15~" [f5])
 +(define-key xterm-function-map "\e[17~" [f6])
 +(define-key xterm-function-map "\e[18~" [f7])
 +(define-key xterm-function-map "\e[19~" [f8])
 +(define-key xterm-function-map "\e[20~" [f9])
 +(define-key xterm-function-map "\e[21~" [f10])
 +(define-key xterm-function-map "\e[23~" [f11])
 +(define-key xterm-function-map "\e[24~" [f12])
 +
 +(define-key xterm-function-map "\eO2P" [S-f1])
 +(define-key xterm-function-map "\eO2Q" [S-f2])
 +(define-key xterm-function-map "\eO2R" [S-f3])
 +(define-key xterm-function-map "\eO2S" [S-f4])
++(define-key xterm-function-map "\e[1;2P" [S-f1])
++(define-key xterm-function-map "\e[1;2Q" [S-f2])
++(define-key xterm-function-map "\e[1;2R" [S-f3])
++(define-key xterm-function-map "\e[1;2S" [S-f4])
 +(define-key xterm-function-map "\e[15;2~" [S-f5])
 +(define-key xterm-function-map "\e[17;2~" [S-f6])
 +(define-key xterm-function-map "\e[18;2~" [S-f7])
 +(define-key xterm-function-map "\e[19;2~" [S-f8])
 +(define-key xterm-function-map "\e[20;2~" [S-f9])
 +(define-key xterm-function-map "\e[21;2~" [S-f10])
 +(define-key xterm-function-map "\e[23;2~" [S-f11])
 +(define-key xterm-function-map "\e[24;2~" [S-f12])
 +
 +(define-key xterm-function-map "\eO5P" [C-f1])
 +(define-key xterm-function-map "\eO5Q" [C-f2])
 +(define-key xterm-function-map "\eO5R" [C-f3])
 +(define-key xterm-function-map "\eO5S" [C-f4])
 +(define-key xterm-function-map "\e[15;5~" [C-f5])
 +(define-key xterm-function-map "\e[17;5~" [C-f6])
 +(define-key xterm-function-map "\e[18;5~" [C-f7])
 +(define-key xterm-function-map "\e[19;5~" [C-f8])
 +(define-key xterm-function-map "\e[20;5~" [C-f9])
 +(define-key xterm-function-map "\e[21;5~" [C-f10])
 +(define-key xterm-function-map "\e[23;5~" [C-f11])
 +(define-key xterm-function-map "\e[24;5~" [C-f12])
 +
 +(define-key xterm-function-map "\eO6P" [C-S-f1])
 +(define-key xterm-function-map "\eO6Q" [C-S-f2])
 +(define-key xterm-function-map "\eO6R" [C-S-f3])
 +(define-key xterm-function-map "\eO6S" [C-S-f4])
 +(define-key xterm-function-map "\e[15;6~" [C-S-f5])
 +(define-key xterm-function-map "\e[17;6~" [C-S-f6])
 +(define-key xterm-function-map "\e[18;6~" [C-S-f7])
 +(define-key xterm-function-map "\e[19;6~" [C-S-f8])
 +(define-key xterm-function-map "\e[20;6~" [C-S-f9])
 +(define-key xterm-function-map "\e[21;6~" [C-S-f10])
 +(define-key xterm-function-map "\e[23;6~" [C-S-f11])
 +(define-key xterm-function-map "\e[24;6~" [C-S-f12])
 +
 +(define-key xterm-function-map "\eO3P" [A-f1])
 +(define-key xterm-function-map "\eO3Q" [A-f2])
 +(define-key xterm-function-map "\eO3R" [A-f3])
 +(define-key xterm-function-map "\eO3S" [A-f4])
 +(define-key xterm-function-map "\e[15;3~" [A-f5])
 +(define-key xterm-function-map "\e[17;3~" [A-f6])
 +(define-key xterm-function-map "\e[18;3~" [A-f7])
 +(define-key xterm-function-map "\e[19;3~" [A-f8])
 +(define-key xterm-function-map "\e[20;3~" [A-f9])
 +(define-key xterm-function-map "\e[21;3~" [A-f10])
 +(define-key xterm-function-map "\e[23;3~" [A-f11])
 +(define-key xterm-function-map "\e[24;3~" [A-f12])
 +
 +(define-key xterm-function-map "\eOA" [up])
 +(define-key xterm-function-map "\eOB" [down])
 +(define-key xterm-function-map "\eOC" [right])
 +(define-key xterm-function-map "\eOD" [left])
 +(define-key xterm-function-map "\eOF" [end])
 +(define-key xterm-function-map "\eOH" [home])
 +
 +(define-key xterm-function-map "\e[1;2A" [S-up])
 +(define-key xterm-function-map "\e[1;2B" [S-down])
 +(define-key xterm-function-map "\e[1;2C" [S-right])
 +(define-key xterm-function-map "\e[1;2D" [S-left])
 +(define-key xterm-function-map "\e[1;2F" [S-end])
 +(define-key xterm-function-map "\e[1;2H" [S-home])
 +
 +(define-key xterm-function-map "\e[1;5A" [C-up])
 +(define-key xterm-function-map "\e[1;5B" [C-down])
 +(define-key xterm-function-map "\e[1;5C" [C-right])
 +(define-key xterm-function-map "\e[1;5D" [C-left])
 +(define-key xterm-function-map "\e[1;5F" [C-end])
 +(define-key xterm-function-map "\e[1;5H" [C-home])
 +
 +(define-key xterm-function-map "\e[1;6A" [C-S-up])
 +(define-key xterm-function-map "\e[1;6B" [C-S-down])
 +(define-key xterm-function-map "\e[1;6C" [C-S-right])
 +(define-key xterm-function-map "\e[1;6D" [C-S-left])
 +(define-key xterm-function-map "\e[1;6F" [C-S-end])
 +(define-key xterm-function-map "\e[1;6H" [C-S-home])
 +
 +(define-key xterm-function-map "\e[1;3A" [A-up])
 +(define-key xterm-function-map "\e[1;3B" [A-down])
 +(define-key xterm-function-map "\e[1;3C" [A-right])
 +(define-key xterm-function-map "\e[1;3D" [A-left])
 +(define-key xterm-function-map "\e[1;3F" [A-end])
 +(define-key xterm-function-map "\e[1;3H" [A-home])
 +
 +(define-key xterm-function-map "\e[2~" [insert])
 +(define-key xterm-function-map "\e[3~" [delete])
 +(define-key xterm-function-map "\e[5~" [prior])
 +(define-key xterm-function-map "\e[6~" [next])
 +
 +(define-key xterm-function-map "\e[2;2~" [S-insert])
 +(define-key xterm-function-map "\e[3;2~" [S-delete])
 +(define-key xterm-function-map "\e[5;2~" [S-prior])
 +(define-key xterm-function-map "\e[6;2~" [S-next])
 +
 +(define-key xterm-function-map "\e[2;5~" [C-insert])
 +(define-key xterm-function-map "\e[3;5~" [C-delete])
 +(define-key xterm-function-map "\e[5;5~" [C-prior])
 +(define-key xterm-function-map "\e[6;5~" [C-next])
 +
 +(define-key xterm-function-map "\e[2;6~" [C-S-insert])
 +(define-key xterm-function-map "\e[3;6~" [C-S-delete])
 +(define-key xterm-function-map "\e[5;6~" [C-S-prior])
 +(define-key xterm-function-map "\e[6;6~" [C-S-next])
 +
 +(define-key xterm-function-map "\e[2;3~" [A-insert])
 +(define-key xterm-function-map "\e[3;3~" [A-delete])
 +(define-key xterm-function-map "\e[5;3~" [A-prior])
 +(define-key xterm-function-map "\e[6;3~" [A-next])
 +
 +(define-key xterm-function-map "\e[4~" [select])
 +(define-key xterm-function-map "\e[29~" [print])
 +
 +;; These keys are available in xterm starting from version 216
 +;; if the modifyOtherKeys resource is set to 1.
 +
 +(define-key xterm-function-map "\e[27;5;9~"   [C-tab])
 +(define-key xterm-function-map "\e[27;5;13~"  [C-return])
 +(define-key xterm-function-map "\e[27;5;39~"  [?\C-\'])
 +(define-key xterm-function-map "\e[27;5;44~"  [?\C-,])
 +(define-key xterm-function-map "\e[27;5;45~"  [?\C--])
 +(define-key xterm-function-map "\e[27;5;46~"  [?\C-.])
 +(define-key xterm-function-map "\e[27;5;47~"  [?\C-/])
 +(define-key xterm-function-map "\e[27;5;48~"  [?\C-0])
 +(define-key xterm-function-map "\e[27;5;49~"  [?\C-1])
 +;; Not all C-DIGIT keys have a distinct binding.
 +(define-key xterm-function-map "\e[27;5;57~"  [?\C-9])
 +(define-key xterm-function-map "\e[27;5;59~"  [(C-\;)])
 +(define-key xterm-function-map "\e[27;5;61~"  [?\C-=])
 +(define-key xterm-function-map "\e[27;5;92~"  [?\C-\\])
 +
 +(define-key xterm-function-map "\e[27;6;33~"  [?\C-!])
 +(define-key xterm-function-map "\e[27;6;34~"  [?\C-\"])
 +(define-key xterm-function-map "\e[27;6;35~"  [?\C-#])
 +(define-key xterm-function-map "\e[27;6;36~"  [?\C-$])
 +(define-key xterm-function-map "\e[27;6;37~"  [?\C-%])
 +(define-key xterm-function-map "\e[27;6;38~"  [(C-&)])
 +(define-key xterm-function-map "\e[27;6;40~"  [?\C-(])
 +(define-key xterm-function-map "\e[27;6;41~"  [?\C-)])
 +(define-key xterm-function-map "\e[27;6;42~"  [?\C-*])
 +(define-key xterm-function-map "\e[27;6;43~"  [?\C-+])
 +(define-key xterm-function-map "\e[27;6;58~"  [?\C-:])
 +(define-key xterm-function-map "\e[27;6;60~"  [?\C-<])
 +(define-key xterm-function-map "\e[27;6;62~"  [?\C->])
 +(define-key xterm-function-map "\e[27;6;63~"  [(C-\?)])
 +
 +;; These are the strings emitted for various C-M- combinations
 +;; for keyboards that the Meta and Alt modifiers are on the same
 +;; key (usually labeled "Alt").
 +(define-key xterm-function-map "\e[27;13;9~"  [(C-M-tab)])
 +(define-key xterm-function-map "\e[27;13;13~" [(C-M-return)])
 +
 +(define-key xterm-function-map "\e[27;13;39~" [?\C-\M-\'])
 +(define-key xterm-function-map "\e[27;13;44~" [?\C-\M-,])
 +(define-key xterm-function-map "\e[27;13;45~" [?\C-\M--])
 +(define-key xterm-function-map "\e[27;13;46~" [?\C-\M-.])
 +(define-key xterm-function-map "\e[27;13;47~" [?\C-\M-/])
 +(define-key xterm-function-map "\e[27;13;48~" [?\C-\M-0])
 +(define-key xterm-function-map "\e[27;13;49~" [?\C-\M-1])
 +(define-key xterm-function-map "\e[27;13;50~" [?\C-\M-2])
 +(define-key xterm-function-map "\e[27;13;51~" [?\C-\M-3])
 +(define-key xterm-function-map "\e[27;13;52~" [?\C-\M-4])
 +(define-key xterm-function-map "\e[27;13;53~" [?\C-\M-5])
 +(define-key xterm-function-map "\e[27;13;54~" [?\C-\M-6])
 +(define-key xterm-function-map "\e[27;13;55~" [?\C-\M-7])
 +(define-key xterm-function-map "\e[27;13;56~" [?\C-\M-8])
 +(define-key xterm-function-map "\e[27;13;57~" [?\C-\M-9])
 +(define-key xterm-function-map "\e[27;13;59~" [?\C-\M-\;])
 +(define-key xterm-function-map "\e[27;13;61~" [?\C-\M-=])
 +(define-key xterm-function-map "\e[27;13;92~" [?\C-\M-\\])
 +
 +(define-key xterm-function-map "\e[27;14;33~"  [?\C-\M-!])
 +(define-key xterm-function-map "\e[27;14;34~"  [?\C-\M-\"])
 +(define-key xterm-function-map "\e[27;14;35~"  [?\C-\M-#])
 +(define-key xterm-function-map "\e[27;14;36~"  [?\C-\M-$])
 +(define-key xterm-function-map "\e[27;14;37~"  [?\C-\M-%])
 +(define-key xterm-function-map "\e[27;14;38~"  [(C-M-&)])
 +(define-key xterm-function-map "\e[27;14;40~"  [?\C-\M-(])
 +(define-key xterm-function-map "\e[27;14;41~"  [?\C-\M-)])
 +(define-key xterm-function-map "\e[27;14;42~"  [?\C-\M-*])
 +(define-key xterm-function-map "\e[27;14;43~"  [?\C-\M-+])
 +(define-key xterm-function-map "\e[27;14;58~"  [?\C-\M-:])
 +(define-key xterm-function-map "\e[27;14;60~"  [?\C-\M-<])
 +(define-key xterm-function-map "\e[27;14;62~"  [?\C-\M->])
 +(define-key xterm-function-map "\e[27;14;63~"  [(C-M-\?)])
 +
 +(define-key xterm-function-map "\e[27;7;9~"  [(C-M-tab)])
 +(define-key xterm-function-map "\e[27;7;13~" [(C-M-return)])
 +
 +(define-key xterm-function-map "\e[27;7;39~" [?\C-\M-\'])
 +(define-key xterm-function-map "\e[27;7;44~" [?\C-\M-,])
 +(define-key xterm-function-map "\e[27;7;45~" [?\C-\M--])
 +(define-key xterm-function-map "\e[27;7;46~" [?\C-\M-.])
 +(define-key xterm-function-map "\e[27;7;47~" [?\C-\M-/])
 +(define-key xterm-function-map "\e[27;7;48~" [?\C-\M-0])
 +(define-key xterm-function-map "\e[27;7;49~" [?\C-\M-1])
 +(define-key xterm-function-map "\e[27;7;50~" [?\C-\M-2])
 +(define-key xterm-function-map "\e[27;7;51~" [?\C-\M-3])
 +(define-key xterm-function-map "\e[27;7;52~" [?\C-\M-4])
 +(define-key xterm-function-map "\e[27;7;53~" [?\C-\M-5])
 +(define-key xterm-function-map "\e[27;7;54~" [?\C-\M-6])
 +(define-key xterm-function-map "\e[27;7;55~" [?\C-\M-7])
 +(define-key xterm-function-map "\e[27;7;56~" [?\C-\M-8])
 +(define-key xterm-function-map "\e[27;7;57~" [?\C-\M-9])
 +(define-key xterm-function-map "\e[27;7;59~" [?\C-\M-\;])
 +(define-key xterm-function-map "\e[27;7;61~" [?\C-\M-=])
 +(define-key xterm-function-map "\e[27;7;92~" [?\C-\M-\\])
 +
 +(define-key xterm-function-map "\e[27;8;33~"  [?\C-\M-!])
 +(define-key xterm-function-map "\e[27;8;34~"  [?\C-\M-\"])
 +(define-key xterm-function-map "\e[27;8;35~"  [?\C-\M-#])
 +(define-key xterm-function-map "\e[27;8;36~"  [?\C-\M-$])
 +(define-key xterm-function-map "\e[27;8;37~"  [?\C-\M-%])
 +(define-key xterm-function-map "\e[27;8;38~"  [(C-M-&)])
 +(define-key xterm-function-map "\e[27;8;40~"  [?\C-\M-(])
 +(define-key xterm-function-map "\e[27;8;41~"  [?\C-\M-)])
 +(define-key xterm-function-map "\e[27;8;42~"  [?\C-\M-*])
 +(define-key xterm-function-map "\e[27;8;43~"  [?\C-\M-+])
 +(define-key xterm-function-map "\e[27;8;58~"  [?\C-\M-:])
 +(define-key xterm-function-map "\e[27;8;60~"  [?\C-\M-<])
 +(define-key xterm-function-map "\e[27;8;62~"  [?\C-\M->])
 +(define-key xterm-function-map "\e[27;8;63~"  [(C-M-\?)])
 +
 +(define-key xterm-function-map "\e[27;2;9~"   [S-tab])
 +(define-key xterm-function-map "\e[27;2;13~"  [S-return])
 +
 +(define-key xterm-function-map "\e[27;6;9~"   [(C-S-tab)])
 +(define-key xterm-function-map "\e[27;6;13~"  [(C-S-return)])
 +
 +;; Other versions of xterm might emit these.
 +(define-key xterm-function-map "\e[A" [up])
 +(define-key xterm-function-map "\e[B" [down])
 +(define-key xterm-function-map "\e[C" [right])
 +(define-key xterm-function-map "\e[D" [left])
 +(define-key xterm-function-map "\e[1~" [home])
 +
 +(define-key xterm-function-map "\e[1;2A" [S-up])
 +(define-key xterm-function-map "\e[1;2B" [S-down])
 +(define-key xterm-function-map "\e[1;2C" [S-right])
 +(define-key xterm-function-map "\e[1;2D" [S-left])
 +(define-key xterm-function-map "\e[1;2F" [S-end])
 +(define-key xterm-function-map "\e[1;2H" [S-home])
 +
 +(define-key xterm-function-map "\e[1;5A" [C-up])
 +(define-key xterm-function-map "\e[1;5B" [C-down])
 +(define-key xterm-function-map "\e[1;5C" [C-right])
 +(define-key xterm-function-map "\e[1;5D" [C-left])
 +(define-key xterm-function-map "\e[1;5F" [C-end])
 +(define-key xterm-function-map "\e[1;5H" [C-home])
 +
 +(define-key xterm-function-map "\e[11~" [f1])
 +(define-key xterm-function-map "\e[12~" [f2])
 +(define-key xterm-function-map "\e[13~" [f3])
 +(define-key xterm-function-map "\e[14~" [f4])
 +
  (defun terminal-init-xterm ()
    "Terminal initialization function for xterm."
    ;; rxvt terminals sometimes set the TERM variable to "xterm", but
      ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C, A-, C-S-.  The
      ;; code here subsitutes the corresponding defintions in
      ;; function-key-map. This substitution is needed because if a key
-     ;; definition if found in function-key-map, there are no further
+     ;; definition is found in function-key-map, there are no further
      ;; lookups in other keymaps.
 -    (substitute-key-definition [f13] [S-f1] function-key-map)
 -    (substitute-key-definition [f14] [S-f2] function-key-map)
 -    (substitute-key-definition [f15] [S-f3] function-key-map)
 -    (substitute-key-definition [f16] [S-f4] function-key-map)
 -    (substitute-key-definition [f17] [S-f5] function-key-map)
 -    (substitute-key-definition [f18] [S-f6] function-key-map)
 -    (substitute-key-definition [f19] [S-f7] function-key-map)
 -    (substitute-key-definition [f20] [S-f8] function-key-map)
 -    (substitute-key-definition [f21] [S-f9] function-key-map)
 -    (substitute-key-definition [f22] [S-f10] function-key-map)
 -    (substitute-key-definition [f23] [S-f11] function-key-map)
 -    (substitute-key-definition [f24] [S-f12] function-key-map)
 -
 -    (substitute-key-definition [f25] [C-f1] function-key-map)
 -    (substitute-key-definition [f26] [C-f2] function-key-map)
 -    (substitute-key-definition [f27] [C-f3] function-key-map)
 -    (substitute-key-definition [f28] [C-f4] function-key-map)
 -    (substitute-key-definition [f29] [C-f5] function-key-map)
 -    (substitute-key-definition [f30] [C-f6] function-key-map)
 -    (substitute-key-definition [f31] [C-f7] function-key-map)
 -    (substitute-key-definition [f32] [C-f8] function-key-map)
 -    (substitute-key-definition [f33] [C-f9] function-key-map)
 -    (substitute-key-definition [f34] [C-f10] function-key-map)
 -    (substitute-key-definition [f35] [C-f11] function-key-map)
 -    (substitute-key-definition [f36] [C-f12] function-key-map)
 -
 -    (substitute-key-definition [f37] [C-S-f1] function-key-map)
 -    (substitute-key-definition [f38] [C-S-f2] function-key-map)
 -    (substitute-key-definition [f39] [C-S-f3] function-key-map)
 -    (substitute-key-definition [f40] [C-S-f4] function-key-map)
 -    (substitute-key-definition [f41] [C-S-f5] function-key-map)
 -    (substitute-key-definition [f42] [C-S-f6] function-key-map)
 -    (substitute-key-definition [f43] [C-S-f7] function-key-map)
 -    (substitute-key-definition [f44] [C-S-f8] function-key-map)
 -    (substitute-key-definition [f45] [C-S-f9] function-key-map)
 -    (substitute-key-definition [f46] [C-S-f10] function-key-map)
 -    (substitute-key-definition [f47] [C-S-f11] function-key-map)
 -    (substitute-key-definition [f48] [C-S-f12] function-key-map)
 -
 -    (substitute-key-definition [f49] [A-f1] function-key-map)
 -    (substitute-key-definition [f50] [A-f2] function-key-map)
 -    (substitute-key-definition [f51] [A-f3] function-key-map)
 -    (substitute-key-definition [f52] [A-f4] function-key-map)
 -    (substitute-key-definition [f53] [A-f5] function-key-map)
 -    (substitute-key-definition [f54] [A-f6] function-key-map)
 -    (substitute-key-definition [f55] [A-f7] function-key-map)
 -    (substitute-key-definition [f56] [A-f8] function-key-map)
 -    (substitute-key-definition [f57] [A-f9] function-key-map)
 -    (substitute-key-definition [f58] [A-f10] function-key-map)
 -    (substitute-key-definition [f59] [A-f11] function-key-map)
 -    (substitute-key-definition [f60] [A-f12] function-key-map)
 -
 -    (let ((map (make-sparse-keymap)))
 -      ;; xterm from X.org 6.8.2 uses these key definitions.
 -      (define-key map "\eOP" [f1])
 -      (define-key map "\eOQ" [f2])
 -      (define-key map "\eOR" [f3])
 -      (define-key map "\eOS" [f4])
 -      (define-key map "\e[15~" [f5])
 -      (define-key map "\e[17~" [f6])
 -      (define-key map "\e[18~" [f7])
 -      (define-key map "\e[19~" [f8])
 -      (define-key map "\e[20~" [f9])
 -      (define-key map "\e[21~" [f10])
 -      (define-key map "\e[23~" [f11])
 -      (define-key map "\e[24~" [f12])
 -
 -      (define-key map "\eO2P" [S-f1])
 -      (define-key map "\eO2Q" [S-f2])
 -      (define-key map "\eO2R" [S-f3])
 -      (define-key map "\eO2S" [S-f4])
 -      (define-key map "\e[1;2P" [S-f1])
 -      (define-key map "\e[1;2Q" [S-f2])
 -      (define-key map "\e[1;2R" [S-f3])
 -      (define-key map "\e[1;2S" [S-f4])
 -      (define-key map "\e[15;2~" [S-f5])
 -      (define-key map "\e[17;2~" [S-f6])
 -      (define-key map "\e[18;2~" [S-f7])
 -      (define-key map "\e[19;2~" [S-f8])
 -      (define-key map "\e[20;2~" [S-f9])
 -      (define-key map "\e[21;2~" [S-f10])
 -      (define-key map "\e[23;2~" [S-f11])
 -      (define-key map "\e[24;2~" [S-f12])
 -
 -      (define-key map "\eO5P" [C-f1])
 -      (define-key map "\eO5Q" [C-f2])
 -      (define-key map "\eO5R" [C-f3])
 -      (define-key map "\eO5S" [C-f4])
 -      (define-key map "\e[15;5~" [C-f5])
 -      (define-key map "\e[17;5~" [C-f6])
 -      (define-key map "\e[18;5~" [C-f7])
 -      (define-key map "\e[19;5~" [C-f8])
 -      (define-key map "\e[20;5~" [C-f9])
 -      (define-key map "\e[21;5~" [C-f10])
 -      (define-key map "\e[23;5~" [C-f11])
 -      (define-key map "\e[24;5~" [C-f12])
 -
 -      (define-key map "\eO6P" [C-S-f1])
 -      (define-key map "\eO6Q" [C-S-f2])
 -      (define-key map "\eO6R" [C-S-f3])
 -      (define-key map "\eO6S" [C-S-f4])
 -      (define-key map "\e[15;6~" [C-S-f5])
 -      (define-key map "\e[17;6~" [C-S-f6])
 -      (define-key map "\e[18;6~" [C-S-f7])
 -      (define-key map "\e[19;6~" [C-S-f8])
 -      (define-key map "\e[20;6~" [C-S-f9])
 -      (define-key map "\e[21;6~" [C-S-f10])
 -      (define-key map "\e[23;6~" [C-S-f11])
 -      (define-key map "\e[24;6~" [C-S-f12])
 -
 -      (define-key map "\eO3P" [A-f1])
 -      (define-key map "\eO3Q" [A-f2])
 -      (define-key map "\eO3R" [A-f3])
 -      (define-key map "\eO3S" [A-f4])
 -      (define-key map "\e[15;3~" [A-f5])
 -      (define-key map "\e[17;3~" [A-f6])
 -      (define-key map "\e[18;3~" [A-f7])
 -      (define-key map "\e[19;3~" [A-f8])
 -      (define-key map "\e[20;3~" [A-f9])
 -      (define-key map "\e[21;3~" [A-f10])
 -      (define-key map "\e[23;3~" [A-f11])
 -      (define-key map "\e[24;3~" [A-f12])
 -
 -      (define-key map "\eOA" [up])
 -      (define-key map "\eOB" [down])
 -      (define-key map "\eOC" [right])
 -      (define-key map "\eOD" [left])
 -      (define-key map "\eOF" [end])
 -      (define-key map "\eOH" [home])
 -
 -      (define-key map "\e[1;2A" [S-up])
 -      (define-key map "\e[1;2B" [S-down])
 -      (define-key map "\e[1;2C" [S-right])
 -      (define-key map "\e[1;2D" [S-left])
 -      (define-key map "\e[1;2F" [S-end])
 -      (define-key map "\e[1;2H" [S-home])
 -
 -      (define-key map "\e[1;5A" [C-up])
 -      (define-key map "\e[1;5B" [C-down])
 -      (define-key map "\e[1;5C" [C-right])
 -      (define-key map "\e[1;5D" [C-left])
 -      (define-key map "\e[1;5F" [C-end])
 -      (define-key map "\e[1;5H" [C-home])
 -
 -      (define-key map "\e[1;6A" [C-S-up])
 -      (define-key map "\e[1;6B" [C-S-down])
 -      (define-key map "\e[1;6C" [C-S-right])
 -      (define-key map "\e[1;6D" [C-S-left])
 -      (define-key map "\e[1;6F" [C-S-end])
 -      (define-key map "\e[1;6H" [C-S-home])
 -
 -      (define-key map "\e[1;3A" [A-up])
 -      (define-key map "\e[1;3B" [A-down])
 -      (define-key map "\e[1;3C" [A-right])
 -      (define-key map "\e[1;3D" [A-left])
 -      (define-key map "\e[1;3F" [A-end])
 -      (define-key map "\e[1;3H" [A-home])
 -
 -      (define-key map "\e[2~" [insert])
 -      (define-key map "\e[3~" [delete])
 -      (define-key map "\e[5~" [prior])
 -      (define-key map "\e[6~" [next])
 -
 -      (define-key map "\e[2;2~" [S-insert])
 -      (define-key map "\e[3;2~" [S-delete])
 -      (define-key map "\e[5;2~" [S-prior])
 -      (define-key map "\e[6;2~" [S-next])
 -
 -      (define-key map "\e[2;5~" [C-insert])
 -      (define-key map "\e[3;5~" [C-delete])
 -      (define-key map "\e[5;5~" [C-prior])
 -      (define-key map "\e[6;5~" [C-next])
 -
 -      (define-key map "\e[2;6~" [C-S-insert])
 -      (define-key map "\e[3;6~" [C-S-delete])
 -      (define-key map "\e[5;6~" [C-S-prior])
 -      (define-key map "\e[6;6~" [C-S-next])
 -
 -      (define-key map "\e[2;3~" [A-insert])
 -      (define-key map "\e[3;3~" [A-delete])
 -      (define-key map "\e[5;3~" [A-prior])
 -      (define-key map "\e[6;3~" [A-next])
 -
 -      (define-key map "\e[4~" [select])
 -      (define-key map "\e[29~" [print])
 -      
 -      ;; These keys are available in xterm starting from version 216
 -      ;; if the modifyOtherKeys resource is set to 1.
 -
 -      (define-key map "\e[27;5;9~"   [C-tab])
 -      (define-key map "\e[27;5;13~"  [C-return])
 -      (define-key map "\e[27;5;39~"  [?\C-\'])
 -      (define-key map "\e[27;5;44~"  [?\C-,])
 -      (define-key map "\e[27;5;45~"  [?\C--])
 -      (define-key map "\e[27;5;46~"  [?\C-.])
 -      (define-key map "\e[27;5;47~"  [?\C-/])
 -      (define-key map "\e[27;5;48~"  [?\C-0])
 -      (define-key map "\e[27;5;49~"  [?\C-1])
 -      ;; Not all C-DIGIT keys have a distinct binding.
 -      (define-key map "\e[27;5;57~"  [?\C-9])
 -      (define-key map "\e[27;5;59~"  [(C-\;)])
 -      (define-key map "\e[27;5;61~"  [?\C-=])
 -      (define-key map "\e[27;5;92~"  [?\C-\\])
 -
 -      (define-key map "\e[27;6;33~"  [?\C-!])
 -      (define-key map "\e[27;6;34~"  [?\C-\"])
 -      (define-key map "\e[27;6;35~"  [?\C-#])
 -      (define-key map "\e[27;6;36~"  [?\C-$])
 -      (define-key map "\e[27;6;37~"  [?\C-%])
 -      (define-key map "\e[27;6;38~"  [(C-&)])
 -      (define-key map "\e[27;6;40~"  [?\C-(])
 -      (define-key map "\e[27;6;41~"  [?\C-)])
 -      (define-key map "\e[27;6;42~"  [?\C-*])
 -      (define-key map "\e[27;6;43~"  [?\C-+])
 -      (define-key map "\e[27;6;58~"  [?\C-:])
 -      (define-key map "\e[27;6;60~"  [?\C-<])
 -      (define-key map "\e[27;6;62~"  [?\C->])
 -      (define-key map "\e[27;6;63~"  [(C-\?)])
 -
 -      ;; These are the strings emitted for various C-M- combinations
 -      ;; for keyboards that the Meta and Alt modifiers are on the same
 -      ;; key (usually labeled "Alt").
 -      (define-key map "\e[27;13;9~"  [(C-M-tab)])
 -      (define-key map "\e[27;13;13~" [(C-M-return)])
 -
 -      (define-key map "\e[27;13;39~" [?\C-\M-\'])
 -      (define-key map "\e[27;13;44~" [?\C-\M-,])
 -      (define-key map "\e[27;13;45~" [?\C-\M--])
 -      (define-key map "\e[27;13;46~" [?\C-\M-.])
 -      (define-key map "\e[27;13;47~" [?\C-\M-/])
 -      (define-key map "\e[27;13;48~" [?\C-\M-0])
 -      (define-key map "\e[27;13;49~" [?\C-\M-1])
 -      (define-key map "\e[27;13;50~" [?\C-\M-2])
 -      (define-key map "\e[27;13;51~" [?\C-\M-3])
 -      (define-key map "\e[27;13;52~" [?\C-\M-4])
 -      (define-key map "\e[27;13;53~" [?\C-\M-5])
 -      (define-key map "\e[27;13;54~" [?\C-\M-6])
 -      (define-key map "\e[27;13;55~" [?\C-\M-7])
 -      (define-key map "\e[27;13;56~" [?\C-\M-8])
 -      (define-key map "\e[27;13;57~" [?\C-\M-9])
 -      (define-key map "\e[27;13;59~" [?\C-\M-\;])
 -      (define-key map "\e[27;13;61~" [?\C-\M-=])
 -      (define-key map "\e[27;13;92~" [?\C-\M-\\])
 -
 -      (define-key map "\e[27;14;33~"  [?\C-\M-!])
 -      (define-key map "\e[27;14;34~"  [?\C-\M-\"])
 -      (define-key map "\e[27;14;35~"  [?\C-\M-#])
 -      (define-key map "\e[27;14;36~"  [?\C-\M-$])
 -      (define-key map "\e[27;14;37~"  [?\C-\M-%])
 -      (define-key map "\e[27;14;38~"  [(C-M-&)])
 -      (define-key map "\e[27;14;40~"  [?\C-\M-(])
 -      (define-key map "\e[27;14;41~"  [?\C-\M-)])
 -      (define-key map "\e[27;14;42~"  [?\C-\M-*])
 -      (define-key map "\e[27;14;43~"  [?\C-\M-+])
 -      (define-key map "\e[27;14;58~"  [?\C-\M-:])
 -      (define-key map "\e[27;14;60~"  [?\C-\M-<])
 -      (define-key map "\e[27;14;62~"  [?\C-\M->])
 -      (define-key map "\e[27;14;63~"  [(C-M-\?)])
 -
 -      (define-key map "\e[27;7;9~"  [(C-M-tab)])
 -      (define-key map "\e[27;7;13~" [(C-M-return)])
 -
 -      (define-key map "\e[27;7;39~" [?\C-\M-\'])
 -      (define-key map "\e[27;7;44~" [?\C-\M-,])
 -      (define-key map "\e[27;7;45~" [?\C-\M--])
 -      (define-key map "\e[27;7;46~" [?\C-\M-.])
 -      (define-key map "\e[27;7;47~" [?\C-\M-/])
 -      (define-key map "\e[27;7;48~" [?\C-\M-0])
 -      (define-key map "\e[27;7;49~" [?\C-\M-1])
 -      (define-key map "\e[27;7;50~" [?\C-\M-2])
 -      (define-key map "\e[27;7;51~" [?\C-\M-3])
 -      (define-key map "\e[27;7;52~" [?\C-\M-4])
 -      (define-key map "\e[27;7;53~" [?\C-\M-5])
 -      (define-key map "\e[27;7;54~" [?\C-\M-6])
 -      (define-key map "\e[27;7;55~" [?\C-\M-7])
 -      (define-key map "\e[27;7;56~" [?\C-\M-8])
 -      (define-key map "\e[27;7;57~" [?\C-\M-9])
 -      (define-key map "\e[27;7;59~" [?\C-\M-\;])
 -      (define-key map "\e[27;7;61~" [?\C-\M-=])
 -      (define-key map "\e[27;7;92~" [?\C-\M-\\])
 -
 -      (define-key map "\e[27;8;33~"  [?\C-\M-!])
 -      (define-key map "\e[27;8;34~"  [?\C-\M-\"])
 -      (define-key map "\e[27;8;35~"  [?\C-\M-#])
 -      (define-key map "\e[27;8;36~"  [?\C-\M-$])
 -      (define-key map "\e[27;8;37~"  [?\C-\M-%])
 -      (define-key map "\e[27;8;38~"  [(C-M-&)])
 -      (define-key map "\e[27;8;40~"  [?\C-\M-(])
 -      (define-key map "\e[27;8;41~"  [?\C-\M-)])
 -      (define-key map "\e[27;8;42~"  [?\C-\M-*])
 -      (define-key map "\e[27;8;43~"  [?\C-\M-+])
 -      (define-key map "\e[27;8;58~"  [?\C-\M-:])
 -      (define-key map "\e[27;8;60~"  [?\C-\M-<])
 -      (define-key map "\e[27;8;62~"  [?\C-\M->])
 -      (define-key map "\e[27;8;63~"  [(C-M-\?)])
 -
 -      (define-key map "\e[27;2;9~"   [S-tab])
 -      (define-key map "\e[27;2;13~"  [S-return])
 -
 -      (define-key map "\e[27;6;9~"   [(C-S-tab)])
 -      (define-key map "\e[27;6;13~"  [(C-S-return)])
 -
 -      ;; Other versions of xterm might emit these.
 -      (define-key map "\e[A" [up])
 -      (define-key map "\e[B" [down])
 -      (define-key map "\e[C" [right])
 -      (define-key map "\e[D" [left])
 -      (define-key map "\e[1~" [home])
 -
 -      (define-key map "\eO2A" [S-up])
 -      (define-key map "\eO2B" [S-down])
 -      (define-key map "\eO2C" [S-right])
 -      (define-key map "\eO2D" [S-left])
 -      (define-key map "\eO2F" [S-end])
 -      (define-key map "\eO2H" [S-home])
 -
 -      (define-key map "\eO5A" [C-up])
 -      (define-key map "\eO5B" [C-down])
 -      (define-key map "\eO5C" [C-right])
 -      (define-key map "\eO5D" [C-left])
 -      (define-key map "\eO5F" [C-end])
 -      (define-key map "\eO5H" [C-home])
 -
 -      (define-key map "\e[11~" [f1])
 -      (define-key map "\e[12~" [f2])
 -      (define-key map "\e[13~" [f3])
 -      (define-key map "\e[14~" [f4])
 -
 -      ;; Use inheritance to let the main keymap override those defaults.
 -      ;; This way we don't override terminfo-derived settings or settings
 -      ;; made in the .emacs file.
 -      (set-keymap-parent map (keymap-parent function-key-map))
 -      (set-keymap-parent function-key-map map))
 -
 -    ;; Do it!
 +    (substitute-key-definition [f13] [S-f1] local-function-key-map)
 +    (substitute-key-definition [f14] [S-f2] local-function-key-map)
 +    (substitute-key-definition [f15] [S-f3] local-function-key-map)
 +    (substitute-key-definition [f16] [S-f4] local-function-key-map)
 +    (substitute-key-definition [f17] [S-f5] local-function-key-map)
 +    (substitute-key-definition [f18] [S-f6] local-function-key-map)
 +    (substitute-key-definition [f19] [S-f7] local-function-key-map)
 +    (substitute-key-definition [f20] [S-f8] local-function-key-map)
 +    (substitute-key-definition [f21] [S-f9] local-function-key-map)
 +    (substitute-key-definition [f22] [S-f10] local-function-key-map)
 +    (substitute-key-definition [f23] [S-f11] local-function-key-map)
 +    (substitute-key-definition [f24] [S-f12] local-function-key-map)
 +
 +    (substitute-key-definition [f25] [C-f1] local-function-key-map)
 +    (substitute-key-definition [f26] [C-f2] local-function-key-map)
 +    (substitute-key-definition [f27] [C-f3] local-function-key-map)
 +    (substitute-key-definition [f28] [C-f4] local-function-key-map)
 +    (substitute-key-definition [f29] [C-f5] local-function-key-map)
 +    (substitute-key-definition [f30] [C-f6] local-function-key-map)
 +    (substitute-key-definition [f31] [C-f7] local-function-key-map)
 +    (substitute-key-definition [f32] [C-f8] local-function-key-map)
 +    (substitute-key-definition [f33] [C-f9] local-function-key-map)
 +    (substitute-key-definition [f34] [C-f10] local-function-key-map)
 +    (substitute-key-definition [f35] [C-f11] local-function-key-map)
 +    (substitute-key-definition [f36] [C-f12] local-function-key-map)
 +
 +    (substitute-key-definition [f37] [C-S-f1] local-function-key-map)
 +    (substitute-key-definition [f38] [C-S-f2] local-function-key-map)
 +    (substitute-key-definition [f39] [C-S-f3] local-function-key-map)
 +    (substitute-key-definition [f40] [C-S-f4] local-function-key-map)
 +    (substitute-key-definition [f41] [C-S-f5] local-function-key-map)
 +    (substitute-key-definition [f42] [C-S-f6] local-function-key-map)
 +    (substitute-key-definition [f43] [C-S-f7] local-function-key-map)
 +    (substitute-key-definition [f44] [C-S-f8] local-function-key-map)
 +    (substitute-key-definition [f45] [C-S-f9] local-function-key-map)
 +    (substitute-key-definition [f46] [C-S-f10] local-function-key-map)
 +    (substitute-key-definition [f47] [C-S-f11] local-function-key-map)
 +    (substitute-key-definition [f48] [C-S-f12] local-function-key-map)
 +
 +    (substitute-key-definition [f49] [A-f1] local-function-key-map)
 +    (substitute-key-definition [f50] [A-f2] local-function-key-map)
 +    (substitute-key-definition [f51] [A-f3] local-function-key-map)
 +    (substitute-key-definition [f52] [A-f4] local-function-key-map)
 +    (substitute-key-definition [f53] [A-f5] local-function-key-map)
 +    (substitute-key-definition [f54] [A-f6] local-function-key-map)
 +    (substitute-key-definition [f55] [A-f7] local-function-key-map)
 +    (substitute-key-definition [f56] [A-f8] local-function-key-map)
 +    (substitute-key-definition [f57] [A-f9] local-function-key-map)
 +    (substitute-key-definition [f58] [A-f10] local-function-key-map)
 +    (substitute-key-definition [f59] [A-f11] local-function-key-map)
 +    (substitute-key-definition [f60] [A-f12] local-function-key-map)
 +
 +    ;; Use inheritance to let the main keymap override those defaults.
 +    ;; This way we don't override terminfo-derived settings or settings
 +    ;; made in the .emacs file.
 +    (let ((m (copy-keymap xterm-function-map)))
 +      (set-keymap-parent m (keymap-parent local-function-key-map))
 +      (set-keymap-parent local-function-key-map m)))
 +
      (xterm-register-default-colors)
      ;; This recomputes all the default faces given the colors we've just set up.
 -    (tty-set-up-initial-frame-faces)))
 +    (tty-set-up-initial-frame-faces))
  
  ;; Set up colors, for those versions of xterm that support it.
  (defvar xterm-standard-colors
diff --cc lisp/tmm.el
Simple merge
diff --cc lisp/version.el
index e6ed5fb5e7eb4365efc307d87a9e26c89e8759ef,144a77602e46f9edc74657375d7a160f3a37bbe2..d975d89f8216ec176242bf24203c77ae2b339e92
@@@ -27,7 -27,7 +27,7 @@@
  
  ;;; Code:
  
--(defconst emacs-version "22.0.91" "\
++(defconst emacs-version "23.0.51" "\
  Version numbers of this version of Emacs.")
  
  (defconst emacs-major-version
diff --cc s.diff
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..5fc53faa16bdab9f082590a0ef19b1f2cf392024
new file mode 100644 (file)
--- /dev/null
--- /dev/null
+++ b/s.diff
@@@ -1,0 -1,0 +1,184 @@@
++--- orig/lisp/server.el
+++++ mod/lisp/server.el
++@@ -83,18 +83,54 @@
++   "Emacs running as a server process."
++   :group 'external)
++ 
+++(defcustom server-use-tcp nil
+++  "If non-nil, use TCP sockets instead of local sockets."
+++  :set #'(lambda (sym val)
+++           (unless (featurep 'make-network-process '(:family local))
+++             (setq val t)
+++             (unless load-in-progress
+++               (message "Local sockets unsupported, using TCP sockets")))
+++           (when val (random t))
+++           (set-default sym val))
+++  :group 'server
+++  :type 'boolean
+++  :version "22.1")
+++
+++(defcustom server-host nil
+++  "The name or IP address to use as host address of the server process.
+++If set, the server accepts remote connections; otherwise it is local."
+++  :group 'server
+++  :type '(choice
+++          (string :tag "Name or IP address")
+++          (const :tag "Local" nil))
+++  :version "22.1")
+++(put 'server-host 'risky-local-variable t)
+++
+++(defcustom server-auth-dir "~/.emacs.d/server/"
+++  "Directory for server authentication files."
+++  :group 'server
+++  :type 'directory
+++  :version "22.1")
+++(put 'server-auth-dir 'risky-local-variable t)
+++
+++(defcustom server-raise-frame t
+++  "If non-nil, raise frame when switching to a buffer."
+++  :group 'server
+++  :type 'boolean
+++  :version "22.1")
+++
++ (defcustom server-visit-hook nil
++-  "*Hook run when visiting a file for the Emacs server."
+++  "Hook run when visiting a file for the Emacs server."
++   :group 'server
++   :type 'hook)
++ 
++ (defcustom server-switch-hook nil
++-  "*Hook run when switching to a buffer for the Emacs server."
+++  "Hook run when switching to a buffer for the Emacs server."
++   :group 'server
++   :type 'hook)
++ 
++ (defcustom server-done-hook nil
++-  "*Hook run when done editing a buffer for the Emacs server."
+++  "Hook run when done editing a buffer for the Emacs server."
++   :group 'server
++   :type 'hook)
++ 
++@@ -113,7 +149,7 @@
++ (put 'server-buffer-clients 'permanent-local t)
++ 
++ (defcustom server-window nil
++-  "*Specification of the window to use for selecting Emacs server buffers.
+++  "Specification of the window to use for selecting Emacs server buffers.
++ If nil, use the selected window.
++ If it is a function, it should take one argument (a buffer) and
++ display and select it.  A common value is `pop-to-buffer'.
++@@ -132,14 +168,14 @@
++               (function :tag "Other function")))
++ 
++ (defcustom server-temp-file-regexp "^/tmp/Re\\|/draft$"
++-  "*Regexp matching names of temporary files.
+++  "Regexp matching names of temporary files.
++ These are deleted and reused after each edit by the programs that
++ invoke the Emacs server."
++   :group 'server
++   :type 'regexp)
++ 
++ (defcustom server-kill-new-buffers t
++-  "*Whether to kill buffers when done with them.
+++  "Whether to kill buffers when done with them.
++ If non-nil, kill a buffer unless it already existed before editing
++ it with Emacs server.  If nil, kill only buffers as specified by
++ `server-temp-file-regexp'.
++@@ -151,7 +187,7 @@
++   :version "21.1")
++ 
++ (or (assq 'server-buffer-clients minor-mode-alist)
++-    (setq minor-mode-alist (cons '(server-buffer-clients " Server") minor-mode-alist)))
+++    (push '(server-buffer-clients " Server") minor-mode-alist))
++ 
++ (defvar server-existing-buffer nil
++   "Non-nil means the buffer existed before the server was asked to visit it.
++@@ -390,11 +426,12 @@
++   (setq dir (directory-file-name dir))
++   (let ((attrs (file-attributes dir)))
++     (unless attrs
++-      (letf (((default-file-modes) ?\700)) (make-directory dir))
+++      (letf (((default-file-modes) ?\700)) (make-directory dir t))
++       (setq attrs (file-attributes dir)))
++     ;; Check that it's safe for use.
++     (unless (and (eq t (car attrs)) (eq (nth 2 attrs) (user-uid))
++-              (zerop (logand ?\077 (file-modes dir))))
+++                 (or (eq system-type 'windows-nt)
+++                     (zerop (logand ?\077 (file-modes dir)))))
++       (error "The directory %s is unsafe" dir))))
++ 
++ ;;;###autoload
++@@ -966,10 +1003,10 @@
++      (let ((version-control nil)
++            (buffer-backed-up nil))
++        (save-buffer))
++-      (if (and (buffer-modified-p)
++-            buffer-file-name
++-            (y-or-n-p (concat "Save file " buffer-file-name "? ")))
++-       (save-buffer)))
+++      (when (and (buffer-modified-p)
+++              buffer-file-name
+++              (y-or-n-p (concat "Save file " buffer-file-name "? ")))
+++     (save-buffer)))
++     (server-buffer-done (current-buffer))))
++ 
++ ;; Ask before killing a server buffer.
++@@ -1027,12 +1064,12 @@
++ starts server process and that is all.  Invoked by \\[server-edit]."
++   (interactive "P")
++   (cond
++-   ((or arg
++-     (not server-process)
++-     (memq (process-status server-process) '(signal exit)))
++-    (server-mode 1))
++-   (server-clients (apply 'server-switch-buffer (server-done)))
++-   (t (message "No server editing buffers exist"))))
+++    ((or arg
+++         (not server-process)
+++         (memq (process-status server-process) '(signal exit)))
+++     (server-mode 1))
+++    (server-clients (apply 'server-switch-buffer (server-done)))
+++    (t (message "No server editing buffers exist"))))
++ 
++ (defun server-switch-buffer (&optional next-buffer killed-one)
++   "Switch to another buffer, preferably one that has a client.
++@@ -1065,21 +1102,19 @@
++      (let ((win (get-buffer-window next-buffer 0)))
++        (if (and win (not server-window))
++            ;; The buffer is already displayed: just reuse the window.
++-           (let ((frame (window-frame win)))
++-             (if (eq (frame-visible-p frame) 'icon)
++-                 (raise-frame frame))
++-             (select-window win)
++-             (set-buffer next-buffer))
+++              (progn
+++                (select-window win)
+++                (set-buffer next-buffer))
++          ;; Otherwise, let's find an appropriate window.
++          (cond ((and (windowp server-window)
++                      (window-live-p server-window))
++                 (select-window server-window))
++                ((framep server-window)
++-                (if (not (frame-live-p server-window))
++-                    (setq server-window (make-frame)))
+++                (unless (frame-live-p server-window)
+++                  (setq server-window (make-frame)))
++                 (select-window (frame-selected-window server-window))))
++-         (if (window-minibuffer-p (selected-window))
++-             (select-window (next-window nil 'nomini 0)))
+++         (when (window-minibuffer-p (selected-window))
+++           (select-window (next-window nil 'nomini 0)))
++          ;; Move to a non-dedicated window, if we have one.
++          (when (window-dedicated-p (selected-window))
++            (select-window
++@@ -1093,7 +1128,9 @@
++              (switch-to-buffer next-buffer)
++            ;; After all the above, we might still have ended up with
++            ;; a minibuffer/dedicated-window (if there's no other).
++-           (error (pop-to-buffer next-buffer)))))))))
+++           (error (pop-to-buffer next-buffer)))))))
+++    (when server-raise-frame
+++      (select-frame-set-input-focus (window-frame (selected-window))))))
++ 
++ ;;;###autoload
++ (defun server-save-buffers-kill-terminal (proc &optional arg)
diff --cc src/alloc.c
Simple merge
diff --cc src/buffer.c
Simple merge
diff --cc src/coding.c
Simple merge
diff --cc src/config.in
Simple merge
diff --cc src/data.c
Simple merge
diff --cc src/emacs.c
Simple merge
diff --cc src/eval.c
Simple merge
diff --cc src/fileio.c
Simple merge
diff --cc src/fns.c
Simple merge
diff --cc src/frame.c
index d7c58fd8faa1a90a11511c43a2c416d85b4b30c7,75992824fd3eaf4edf78dad83b331660955ce8f1..b6f361bcbfe56e17de8477b89e25f244fac249d1
@@@ -3340,6 -3034,9 +3340,9 @@@ x_set_fullscreen (f, new_value, old_val
      f->want_fullscreen = FULLSCREEN_WIDTH;
    else if (EQ (new_value, Qfullheight))
      f->want_fullscreen = FULLSCREEN_HEIGHT;
 -  if (fullscreen_hook != NULL) 
 -    fullscreen_hook (f);
++  if (FRAME_TERMINAL (f)->fullscreen_hook != NULL) 
++    FRAME_TERMINAL (f)->fullscreen_hook (f);
  }
  
  
@@@ -4426,10 -4107,10 +4429,10 @@@ Setting this variable does not affect e
    staticpro (&Qinhibit_default_face_x_resources);
  
    DEFVAR_LISP ("terminal-frame", &Vterminal_frame,
 -             doc: /* The initial frame-object, which represents Emacs's stdout.  */);
 +               doc: /* The initial frame-object, which represents Emacs's stdout.  */);
  
    DEFVAR_LISP ("emacs-iconified", &Vemacs_iconified,
-              doc: /* Non-nil if all of emacs is iconified and frame updates are not needed.  */);
+              doc: /* Non-nil if all of Emacs is iconified and frame updates are not needed.  */);
    Vemacs_iconified = Qnil;
  
    DEFVAR_LISP ("mouse-position-function", &Vmouse_position_function,
diff --cc src/gtkutil.c
Simple merge
diff --cc src/image.c
Simple merge
diff --cc src/indent.c
Simple merge
diff --cc src/keyboard.c
Simple merge
diff --cc src/lread.c
Simple merge
diff --cc src/macfns.c
Simple merge
diff --cc src/macterm.c
Simple merge
diff --cc src/macterm.h
Simple merge
diff --cc src/minibuf.c
Simple merge
diff --cc src/msdos.c
Simple merge
diff --cc src/process.c
Simple merge
diff --cc src/sysdep.c
Simple merge
diff --cc src/term.c
index 924bebf5f7eea4e75c8737093873a567dbeecb17,b39f86c4907862838e13ec7e65fa88a474c9c5e2..00c72ea8bee44ed5493c76265dd0c46b5eb8ac0b
@@@ -2246,162 -2306,11 +2246,163 @@@ the currently selected frame. */
                            Initialization
   ***********************************************************************/
  
 +/* Initialize the tty-dependent part of frame F.  The frame must
 +   already have its device initialized. */
 +
  void
 -term_init (terminal_type)
 -     char *terminal_type;
 +create_tty_output (struct frame *f)
 +{
 +  struct tty_output *t;
 +
 +  if (! FRAME_TERMCAP_P (f))
 +    abort ();
 +
 +  t = xmalloc (sizeof (struct tty_output));
 +  bzero (t, sizeof (struct tty_output));
 +
 +  t->display_info = FRAME_TERMINAL (f)->display_info.tty;
 +
 +  f->output_data.tty = t;
 +}
 +
 +/* Delete the tty-dependent part of frame F. */
 +
 +static void
 +delete_tty_output (struct frame *f)
 +{
 +  if (! FRAME_TERMCAP_P (f))
 +    abort ();
 +
 +  xfree (f->output_data.tty);
 +}
 +
 +\f
 +
 +static void
 +clear_tty_hooks (struct terminal *terminal)
  {
 -  char *area;
 +  terminal->rif = 0;
 +  terminal->cursor_to_hook = 0;
 +  terminal->raw_cursor_to_hook = 0;
 +  terminal->clear_to_end_hook = 0;
 +  terminal->clear_frame_hook = 0;
 +  terminal->clear_end_of_line_hook = 0;
 +  terminal->ins_del_lines_hook = 0;
 +  terminal->insert_glyphs_hook = 0;
 +  terminal->write_glyphs_hook = 0;
 +  terminal->delete_glyphs_hook = 0;
 +  terminal->ring_bell_hook = 0;
 +  terminal->reset_terminal_modes_hook = 0;
 +  terminal->set_terminal_modes_hook = 0;
 +  terminal->update_begin_hook = 0;
 +  terminal->update_end_hook = 0;
 +  terminal->set_terminal_window_hook = 0;
 +  terminal->mouse_position_hook = 0;
 +  terminal->frame_rehighlight_hook = 0;
 +  terminal->frame_raise_lower_hook = 0;
++  terminal->fullscreen_hook = 0;
 +  terminal->set_vertical_scroll_bar_hook = 0;
 +  terminal->condemn_scroll_bars_hook = 0;
 +  terminal->redeem_scroll_bar_hook = 0;
 +  terminal->judge_scroll_bars_hook = 0;
 +  terminal->read_socket_hook = 0;
 +  terminal->frame_up_to_date_hook = 0;
 +
 +  /* Leave these two set, or suspended frames are not deleted
 +     correctly.  */
 +  terminal->delete_frame_hook = &delete_tty_output;
 +  terminal->delete_terminal_hook = &delete_tty;
 +}
 +
 +static void
 +set_tty_hooks (struct terminal *terminal)
 +{
 +  terminal->rif = 0; /* ttys don't support window-based redisplay. */
 +
 +  terminal->cursor_to_hook = &tty_cursor_to;
 +  terminal->raw_cursor_to_hook = &tty_raw_cursor_to;
 +
 +  terminal->clear_to_end_hook = &tty_clear_to_end;
 +  terminal->clear_frame_hook = &tty_clear_frame;
 +  terminal->clear_end_of_line_hook = &tty_clear_end_of_line;
 +
 +  terminal->ins_del_lines_hook = &tty_ins_del_lines;
 +
 +  terminal->insert_glyphs_hook = &tty_insert_glyphs;
 +  terminal->write_glyphs_hook = &tty_write_glyphs;
 +  terminal->delete_glyphs_hook = &tty_delete_glyphs;
 +
 +  terminal->ring_bell_hook = &tty_ring_bell;
 +  
 +  terminal->reset_terminal_modes_hook = &tty_reset_terminal_modes;
 +  terminal->set_terminal_modes_hook = &tty_set_terminal_modes;
 +  terminal->update_begin_hook = 0; /* Not needed. */
 +  terminal->update_end_hook = &tty_update_end;
 +  terminal->set_terminal_window_hook = &tty_set_terminal_window;
 +
 +  terminal->mouse_position_hook = 0; /* Not needed. */
 +  terminal->frame_rehighlight_hook = 0; /* Not needed. */
 +  terminal->frame_raise_lower_hook = 0; /* Not needed. */
 +
 +  terminal->set_vertical_scroll_bar_hook = 0; /* Not needed. */
 +  terminal->condemn_scroll_bars_hook = 0; /* Not needed. */
 +  terminal->redeem_scroll_bar_hook = 0; /* Not needed. */
 +  terminal->judge_scroll_bars_hook = 0; /* Not needed. */
 +
 +  terminal->read_socket_hook = &tty_read_avail_input; /* keyboard.c */
 +  terminal->frame_up_to_date_hook = 0; /* Not needed. */
 +  
 +  terminal->delete_frame_hook = &delete_tty_output;
 +  terminal->delete_terminal_hook = &delete_tty;
 +}
 +
 +/* Drop the controlling terminal if fd is the same device. */
 +static void
 +dissociate_if_controlling_tty (int fd)
 +{
 +  int pgid;
 +  EMACS_GET_TTY_PGRP (fd, &pgid); /* If tcgetpgrp succeeds, fd is the ctty. */
 +  if (pgid != -1)
 +    {
 +#if defined (USG) && !defined (BSD_PGRPS)
 +      setpgrp ();
 +      no_controlling_tty = 1;
 +#else
 +#ifdef TIOCNOTTY                /* Try BSD ioctls. */
 +      sigblock (sigmask (SIGTTOU));
 +      fd = emacs_open ("/dev/tty", O_RDWR, 0);
 +      if (fd != -1 && ioctl (fd, TIOCNOTTY, 0) != -1)
 +        {
 +          no_controlling_tty = 1;
 +        }
 +      if (fd != -1)
 +        emacs_close (fd);
 +      sigunblock (sigmask (SIGTTOU));
 +#else
 +      /* Unknown system. */
 +      croak ();
 +#endif  /* ! TIOCNOTTY */
 +#endif  /* ! USG */
 +    }
 +}
 +
 +static void maybe_fatal();
 +
 +/* Create a termcap display on the tty device with the given name and
 +   type.
 +
 +   If NAME is NULL, then use the controlling tty, i.e., "/dev/tty".
 +   Otherwise NAME should be a path to the tty device file,
 +   e.g. "/dev/pts/7".
 +
 +   TERMINAL_TYPE is the termcap type of the device, e.g. "vt100".
 +
 +   If MUST_SUCCEED is true, then all errors are fatal. */
 +
 +struct terminal *
 +init_tty (char *name, char *terminal_type, int must_succeed)
 +{
 +  char *area = NULL;
    char **address = &area;
    char *buffer = NULL;
    int buffer_size = 4096;
diff --cc src/termhooks.h
index 64a72acc36054de668e10aee6f6d853017e73e7f,2b9e947996ef6627bd7a3cab088a6456390859ae..98c4edb4f240baf32a15edd2adf611beb99d6fdc
@@@ -43,6 -73,130 +43,11 @@@ enum scroll_bar_part 
    scroll_bar_move_ratio
  };
  
 -/* Return the current position of the mouse.
 -
 -   Set *f to the frame the mouse is in, or zero if the mouse is in no
 -   Emacs frame.  If it is set to zero, all the other arguments are
 -   garbage.
 -
 -   If the motion started in a scroll bar, set *bar_window to the
 -   scroll bar's window, *part to the part the mouse is currently over,
 -   *x to the position of the mouse along the scroll bar, and *y to the
 -   overall length of the scroll bar.
 -
 -   Otherwise, set *bar_window to Qnil, and *x and *y to the column and
 -   row of the character cell the mouse is over.
 -
 -   Set *time to the time the mouse was at the returned position.
 -
 -   This should clear mouse_moved until the next motion
 -   event arrives.  */
 -extern void (*mouse_position_hook) P_ ((struct frame **f, int,
 -                                      Lisp_Object *bar_window,
 -                                      enum scroll_bar_part *part,
 -                                      Lisp_Object *x,
 -                                      Lisp_Object *y,
 -                                      unsigned long *time));
 -
 -/* The window system handling code should set this if the mouse has
 -   moved since the last call to the mouse_position_hook.  Calling that
 -   hook should clear this.  */
 -extern int mouse_moved;
 -
 -/* When a frame's focus redirection is changed, this hook tells the
 -   window system code to re-decide where to put the highlight.  Under
 -   X, this means that Emacs lies about where the focus is.  */
 -extern void (*frame_rehighlight_hook) P_ ((struct frame *));
 -
 -/* If we're displaying frames using a window system that can stack
 -   frames on top of each other, this hook allows you to bring a frame
 -   to the front, or bury it behind all the other windows.  If this
 -   hook is zero, that means the device we're displaying on doesn't
 -   support overlapping frames, so there's no need to raise or lower
 -   anything.
 -
 -   If RAISE is non-zero, F is brought to the front, before all other
 -   windows.  If RAISE is zero, F is sent to the back, behind all other
 -   windows.  */
 -extern void (*frame_raise_lower_hook) P_ ((struct frame *f, int raise));
 -
+ /* If the value of the frame parameter changed, whis hook is called.
+    For example, if going from fullscreen to not fullscreen this hook
+    may do something OS dependent, like extended window manager hints on X11.  */
+ extern void (*fullscreen_hook) P_ ((struct frame *f));
 -\f
 -/* Scroll bar hooks.  */
 -
 -/* The representation of scroll bars is determined by the code which
 -   implements them, except for one thing: they must be represented by
 -   lisp objects.  This allows us to place references to them in
 -   Lisp_Windows without worrying about those references becoming
 -   dangling references when the scroll bar is destroyed.
 -
 -   The window-system-independent portion of Emacs just refers to
 -   scroll bars via their windows, and never looks inside the scroll bar
 -   representation; it always uses hook functions to do all the
 -   scroll bar manipulation it needs.
 -
 -   The `vertical_scroll_bar' field of a Lisp_Window refers to that
 -   window's scroll bar, or is nil if the window doesn't have a
 -   scroll bar.
 -
 -   The `scroll_bars' and `condemned_scroll_bars' fields of a Lisp_Frame
 -   are free for use by the scroll bar implementation in any way it sees
 -   fit.  They are marked by the garbage collector.  */
 -
 -
 -/* Set the vertical scroll bar for WINDOW to have its upper left corner
 -   at (TOP, LEFT), and be LENGTH rows high.  Set its handle to
 -   indicate that we are displaying PORTION characters out of a total
 -   of WHOLE characters, starting at POSITION.  If WINDOW doesn't yet
 -   have a scroll bar, create one for it.  */
 -extern void (*set_vertical_scroll_bar_hook)
 -            P_ ((struct window *window,
 -               int portion, int whole, int position));
 -
 -
 -/* The following three hooks are used when we're doing a thorough
 -   redisplay of the frame.  We don't explicitly know which scroll bars
 -   are going to be deleted, because keeping track of when windows go
 -   away is a real pain - can you say set-window-configuration?
 -   Instead, we just assert at the beginning of redisplay that *all*
 -   scroll bars are to be removed, and then save scroll bars from the
 -   fiery pit when we actually redisplay their window.  */
 -
 -/* Arrange for all scroll bars on FRAME to be removed at the next call
 -   to `*judge_scroll_bars_hook'.  A scroll bar may be spared if
 -   `*redeem_scroll_bar_hook' is applied to its window before the judgement.
 -
 -   This should be applied to each frame each time its window tree is
 -   redisplayed, even if it is not displaying scroll bars at the moment;
 -   if the HAS_SCROLL_BARS flag has just been turned off, only calling
 -   this and the judge_scroll_bars_hook will get rid of them.
 -
 -   If non-zero, this hook should be safe to apply to any frame,
 -   whether or not it can support scroll bars, and whether or not it is
 -   currently displaying them.  */
 -extern void (*condemn_scroll_bars_hook) P_ ((struct frame *frame));
 -
 -/* Unmark WINDOW's scroll bar for deletion in this judgement cycle.
 -   Note that it's okay to redeem a scroll bar that is not condemned.  */
 -extern void (*redeem_scroll_bar_hook) P_ ((struct window *window));
 -
 -/* Remove all scroll bars on FRAME that haven't been saved since the
 -   last call to `*condemn_scroll_bars_hook'.
 -
 -   This should be applied to each frame after each time its window
 -   tree is redisplayed, even if it is not displaying scroll bars at the
 -   moment; if the HAS_SCROLL_BARS flag has just been turned off, only
 -   calling this and condemn_scroll_bars_hook will get rid of them.
 -
 -   If non-zero, this hook should be safe to apply to any frame,
 -   whether or not it can support scroll bars, and whether or not it is
 -   currently displaying them.  */
 -extern void (*judge_scroll_bars_hook) P_ ((struct frame *FRAME));
 -
  \f
  /* Input queue declarations and hooks.  */
  
@@@ -285,329 -446,7 +290,334 @@@ enum 
    meta_modifier       =  CHAR_META    /* Under X, the XK_Meta_[LR] keysyms.  */
  };
  
 +#endif /* CONSP */
 +
 +\f
 +/* Terminal-local parameters. */
 +struct terminal
 +{
 +  /* Chain of all terminal devices. */
 +  struct terminal *next_terminal;
 +
 +  /* Unique id for this terminal device. */
 +  int id;
 +
 +  /* The number of frames that are on this terminal. */
 +  int reference_count;
 +
 +  /* Nonzero while deleting this terminal.  Used to protect against
 +     recursive calls to delete_terminal_hook.  */
 +  int deleted;
 +
 +  /* The type of the terminal device. */
 +  enum output_method type;
 +
 +  /* The name of the terminal device.  Do not use this to uniquely
 +     identify a terminal; the same device may be opened multiple
 +     times. */
 +  char *name;
 +
 +#ifdef MULTI_KBOARD
 +  /* The terminal's keyboard object. */
 +  struct kboard *kboard;
 +#endif
 +
 +  /* Device-type dependent data shared amongst all frames on this terminal. */
 +  union display_info
 +  {
 +    struct tty_display_info *tty;     /* termchar.h */
 +    struct x_display_info *x;         /* xterm.h */
 +  } display_info;
 +
 +\f
 +  /* Coding-system to be used for encoding terminal output.  This
 +     structure contains information of a coding-system specified by
 +     the function `set-terminal-coding-system'.  Also see
 +     `safe_terminal_coding' in coding.h.  */
 +  struct coding_system *terminal_coding;
 +
 +  /* Coding-system of what is sent from terminal keyboard.  This
 +     structure contains information of a coding-system specified by
 +     the function `set-keyboard-coding-system'.  */
 +  struct coding_system *keyboard_coding;
 +
 +  /* Parameter alist of this terminal.  */
 +  Lisp_Object param_alist;
 +  
 +  /* Terminal characteristics. */
 +  /* XXX Are these really used on non-termcap displays? */
 +  
 +  int must_write_spaces;      /* Nonzero means spaces in the text must
 +                                 actually be output; can't just skip over
 +                                 some columns to leave them blank.  */
 +  int fast_clear_end_of_line;   /* Nonzero means terminal has a `ce' string */
 +  
 +  int line_ins_del_ok;          /* Terminal can insert and delete lines */
 +  int char_ins_del_ok;          /* Terminal can insert and delete chars */
 +  int scroll_region_ok;         /* Terminal supports setting the scroll
 +                                   window */
 +  int scroll_region_cost;     /* Cost of setting the scroll window,
 +                                   measured in characters. */
 +  int memory_below_frame;     /* Terminal remembers lines scrolled
 +                                   off bottom */
 +
 +#if 0  /* These are not used anywhere. */
 +  /* EMACS_INT baud_rate; */  /* Output speed in baud */
 +  int min_padding_speed;      /* Speed below which no padding necessary. */
 +  int dont_calculate_costs;     /* Nonzero means don't bother computing
 +                                   various cost tables; we won't use them. */
 +#endif
 +
 +\f
 +  /* Window-based redisplay interface for this device (0 for tty
 +     devices). */
 +  struct redisplay_interface *rif;
 +
 +  /* Frame-based redisplay interface. */
 +  
 +  /* Text display hooks.  */
 +
 +  void (*cursor_to_hook) P_ ((struct frame *f, int vpos, int hpos));
 +  void (*raw_cursor_to_hook) P_ ((struct frame *, int, int));
 +  
 +  void (*clear_to_end_hook) P_ ((struct frame *));
 +  void (*clear_frame_hook) P_ ((struct frame *));
 +  void (*clear_end_of_line_hook) P_ ((struct frame *, int));
 +  
 +  void (*ins_del_lines_hook) P_ ((struct frame *f, int, int));
 +  
 +  void (*insert_glyphs_hook) P_ ((struct frame *f, struct glyph *s, int n));
 +  void (*write_glyphs_hook) P_ ((struct frame *f, struct glyph *s, int n));
 +  void (*delete_glyphs_hook) P_ ((struct frame *, int));
 +  
 +  void (*ring_bell_hook) P_ ((struct frame *f));
 +  
 +  void (*reset_terminal_modes_hook) P_ ((struct terminal *));
 +  void (*set_terminal_modes_hook) P_ ((struct terminal *));
 +
 +  void (*update_begin_hook) P_ ((struct frame *));
 +  void (*update_end_hook) P_ ((struct frame *));
 +  void (*set_terminal_window_hook) P_ ((struct frame *, int));
 +
 +  /* Multi-frame and mouse support hooks.  */
 +
 +  /* Return the current position of the mouse.
 +
 +     Set *f to the frame the mouse is in, or zero if the mouse is in no
 +     Emacs frame.  If it is set to zero, all the other arguments are
 +     garbage.
 +  
 +     If the motion started in a scroll bar, set *bar_window to the
 +     scroll bar's window, *part to the part the mouse is currently over,
 +     *x to the position of the mouse along the scroll bar, and *y to the
 +     overall length of the scroll bar.
 +
 +     Otherwise, set *bar_window to Qnil, and *x and *y to the column and
 +     row of the character cell the mouse is over.
 +
 +     Set *time to the time the mouse was at the returned position.
 +     
 +     This should clear mouse_moved until the next motion
 +     event arrives.  */
 +  void (*mouse_position_hook) P_ ((struct frame **f, int,
 +                                   Lisp_Object *bar_window,
 +                                   enum scroll_bar_part *part,
 +                                   Lisp_Object *x,
 +                                   Lisp_Object *y,
 +                                   unsigned long *time));
 +
 +  /* The window system handling code should set this if the mouse has
 +     moved since the last call to the mouse_position_hook.  Calling that
 +     hook should clear this.  */
 +  int mouse_moved;
 +
 +  /* When a frame's focus redirection is changed, this hook tells the
 +     window system code to re-decide where to put the highlight.  Under
 +     X, this means that Emacs lies about where the focus is.  */
 +  void (*frame_rehighlight_hook) P_ ((struct frame *));
 +
 +  /* If we're displaying frames using a window system that can stack
 +     frames on top of each other, this hook allows you to bring a frame
 +     to the front, or bury it behind all the other windows.  If this
 +     hook is zero, that means the terminal we're displaying on doesn't
 +     support overlapping frames, so there's no need to raise or lower
 +     anything.
 +     
 +     If RAISE is non-zero, F is brought to the front, before all other
 +     windows.  If RAISE is zero, F is sent to the back, behind all other
 +     windows.  */
 +  void (*frame_raise_lower_hook) P_ ((struct frame *f, int raise));
 +
++  /* If the value of the frame parameter changed, whis hook is called.
++     For example, if going from fullscreen to not fullscreen this hook
++     may do something OS dependent, like extended window manager hints on X11.  */
++  void (*fullscreen_hook) P_ ((struct frame *f));
++    
 +  \f
 +  /* Scroll bar hooks.  */
 +
 +  /* The representation of scroll bars is determined by the code which
 +     implements them, except for one thing: they must be represented by
 +     lisp objects.  This allows us to place references to them in
 +     Lisp_Windows without worrying about those references becoming
 +     dangling references when the scroll bar is destroyed.
 +     
 +     The window-system-independent portion of Emacs just refers to
 +     scroll bars via their windows, and never looks inside the scroll bar
 +     representation; it always uses hook functions to do all the
 +     scroll bar manipulation it needs.
 +     
 +     The `vertical_scroll_bar' field of a Lisp_Window refers to that
 +     window's scroll bar, or is nil if the window doesn't have a
 +     scroll bar.
 +     
 +     The `scroll_bars' and `condemned_scroll_bars' fields of a Lisp_Frame
 +     are free for use by the scroll bar implementation in any way it sees
 +     fit.  They are marked by the garbage collector.  */
 +  
 +  
 +  /* Set the vertical scroll bar for WINDOW to have its upper left corner
 +     at (TOP, LEFT), and be LENGTH rows high.  Set its handle to
 +     indicate that we are displaying PORTION characters out of a total
 +     of WHOLE characters, starting at POSITION.  If WINDOW doesn't yet
 +     have a scroll bar, create one for it.  */
 +  void (*set_vertical_scroll_bar_hook) P_ ((struct window *window,
 +                                            int portion, int whole,
 +                                            int position));
 +
 +
 +  /* The following three hooks are used when we're doing a thorough
 +     redisplay of the frame.  We don't explicitly know which scroll bars
 +     are going to be deleted, because keeping track of when windows go
 +     away is a real pain - can you say set-window-configuration?
 +     Instead, we just assert at the beginning of redisplay that *all*
 +     scroll bars are to be removed, and then save scroll bars from the
 +     fiery pit when we actually redisplay their window.  */
 +  
 +  /* Arrange for all scroll bars on FRAME to be removed at the next call
 +     to `*judge_scroll_bars_hook'.  A scroll bar may be spared if
 +     `*redeem_scroll_bar_hook' is applied to its window before the judgement.
 +     
 +     This should be applied to each frame each time its window tree is
 +     redisplayed, even if it is not displaying scroll bars at the moment;
 +     if the HAS_SCROLL_BARS flag has just been turned off, only calling
 +     this and the judge_scroll_bars_hook will get rid of them.
 +     
 +     If non-zero, this hook should be safe to apply to any frame,
 +     whether or not it can support scroll bars, and whether or not it is
 +     currently displaying them.  */
 +  void (*condemn_scroll_bars_hook) P_ ((struct frame *frame));
 +
 +  /* Unmark WINDOW's scroll bar for deletion in this judgement cycle.
 +     Note that it's okay to redeem a scroll bar that is not condemned.  */
 +  void (*redeem_scroll_bar_hook) P_ ((struct window *window));
 +
 +  /* Remove all scroll bars on FRAME that haven't been saved since the
 +     last call to `*condemn_scroll_bars_hook'.
 +
 +     This should be applied to each frame after each time its window
 +     tree is redisplayed, even if it is not displaying scroll bars at the
 +     moment; if the HAS_SCROLL_BARS flag has just been turned off, only
 +     calling this and condemn_scroll_bars_hook will get rid of them.
 +     
 +     If non-zero, this hook should be safe to apply to any frame,
 +     whether or not it can support scroll bars, and whether or not it is
 +     currently displaying them.  */
 +  void (*judge_scroll_bars_hook) P_ ((struct frame *FRAME));
 +
 +\f
 +  /* Called to read input events.
 +
 +     TERMINAL indicates which terminal device to read from.  Input
 +     events should be read into BUF, the size of which is given in
 +     SIZE.  EXPECTED is non-zero if the caller suspects that new input
 +     is available.
 +
 +     A positive return value indicates that that many input events
 +     where read into BUF.
 +     Zero means no events were immediately available.
 +     A value of -1 means a transient read error, while -2 indicates
 +     that the device was closed (hangup), and it should be deleted.
 +
 +     XXX Please note that a non-zero value of EXPECTED only means that
 +     there is available input on at least one of the currently opened
 +     terminal devices -- but not necessarily on this device.
 +     Therefore, in most cases EXPECTED should be simply ignored.
 +
 +     XXX This documentation needs to be updated.  */
 +  int (*read_socket_hook) P_ ((struct terminal *terminal,
 +                               int expected,
 +                               struct input_event *hold_quit));
 +
 +  /* Called when a frame's display becomes entirely up to date.  */
 +  void (*frame_up_to_date_hook) P_ ((struct frame *));
 +
 +\f
 +  /* Called to delete the device-specific portions of a frame that is
 +     on this terminal device. */
 +  void (*delete_frame_hook) P_ ((struct frame *));
 +
 +  /* Called after the last frame on this terminal is deleted, or when
 +     the display device was closed (hangup).
 +     
 +     If this is NULL, then the generic delete_terminal is called
 +     instead.  Otherwise the hook must call delete_terminal itself.
 +
 +     The hook must check for and close any live frames that are still
 +     on the terminal.  Fdelete_frame ensures that there are no live
 +     frames on the terminal when it calls this hook, so infinite
 +     recursion is prevented.  */
 +  void (*delete_terminal_hook) P_ ((struct terminal *));
 +};
 +
 +
 +/* Chain of all terminal devices currently in use. */
 +extern struct terminal *terminal_list;
 +
 +#define FRAME_MUST_WRITE_SPACES(f) ((f)->terminal->must_write_spaces)
 +#define FRAME_FAST_CLEAR_END_OF_LINE(f) ((f)->terminal->fast_clear_end_of_line)
 +#define FRAME_LINE_INS_DEL_OK(f) ((f)->terminal->line_ins_del_ok)
 +#define FRAME_CHAR_INS_DEL_OK(f) ((f)->terminal->char_ins_del_ok)
 +#define FRAME_SCROLL_REGION_OK(f) ((f)->terminal->scroll_region_ok)
 +#define FRAME_SCROLL_REGION_COST(f) ((f)->terminal->scroll_region_cost)
 +#define FRAME_MEMORY_BELOW_FRAME(f) ((f)->terminal->memory_below_frame)
 +
 +#define FRAME_TERMINAL_CODING(f) ((f)->terminal->terminal_coding)
 +#define FRAME_KEYBOARD_CODING(f) ((f)->terminal->keyboard_coding)
 +
 +#define TERMINAL_TERMINAL_CODING(d) ((d)->terminal_coding)
 +#define TERMINAL_KEYBOARD_CODING(d) ((d)->keyboard_coding)
 +
 +#define FRAME_RIF(f) ((f)->terminal->rif)
 +
 +#define FRAME_TERMINAL(f) ((f)->terminal)
 +
 +/* FRAME_WINDOW_P tests whether the frame is a window, and is
 +   defined to be the predicate for the window system being used.  */
 +
 +#ifdef HAVE_X_WINDOWS
 +#define FRAME_WINDOW_P(f) FRAME_X_P (f)
  #endif
 +#ifdef HAVE_NTGUI
 +#define FRAME_WINDOW_P(f) FRAME_W32_P (f)
 +#endif
 +#ifdef MAC_OS
 +#define FRAME_WINDOW_P(f) FRAME_MAC_P (f)
 +#endif
 +#ifndef FRAME_WINDOW_P
 +#define FRAME_WINDOW_P(f) (0)
 +#endif
 +
 +/* Return true if the terminal device is not suspended. */
 +#define TERMINAL_ACTIVE_P(d) ((d)->type != output_termcap || (d)->display_info.tty->input)
 +
 +extern Lisp_Object get_terminal_param P_ ((struct terminal *, Lisp_Object));
 +extern struct terminal *get_terminal P_ ((Lisp_Object terminal, int));
 +extern struct terminal *create_terminal P_ ((void));
 +extern void delete_terminal P_ ((struct terminal *));
 +
 +/* The initial terminal device, created by initial_term_init. */
 +extern struct terminal *initial_terminal;
  
  /* arch-tag: 33a00ecc-52b5-4186-a410-8801ac9f087d
     (do not change this comment) */
diff --cc src/w32term.c
Simple merge
diff --cc src/window.c
Simple merge
diff --cc src/xdisp.c
Simple merge
diff --cc src/xfaces.c
index b55118acdf00d32f87cba679bf48e2308dee401d,e93531e1f592d14244d310e91c45606ab52fc02f..ec20445b7dc83f5db964c7a611b70328cf7f0ffd
@@@ -7088,11 -7070,19 +7088,19 @@@ realize_default_face (f
  
  #ifdef HAVE_WINDOW_SYSTEM
  #ifdef HAVE_X_WINDOWS
 -  if (face->font != FRAME_FONT (f))
 +  if (FRAME_X_P (f) && face->font != FRAME_FONT (f))
-     /* As the font specified for the frame was not acceptable as a
-        font for the default face (perhaps because auto-scaled fonts
-        are rejected), we must adjust the frame font.  */
-     x_set_font (f, build_string (face->font_name), Qnil);
+     {
+       /* This can happen when making a frame on a display that does
 -       not support the default font.  */
++       not support the default font.  */
+       if (!face->font)
 -      return 0;
 -
++      return 0;
++ 
+       /* Otherwise, the font specified for the frame was not
 -       acceptable as a font for the default face (perhaps because
 -       auto-scaled fonts are rejected), so we must adjust the frame
 -       font.  */
++       acceptable as a font for the default face (perhaps because
++       auto-scaled fonts are rejected), so we must adjust the frame
++       font.  */
+       x_set_font (f, build_string (face->font_name), Qnil);
+     }
  #endif        /* HAVE_X_WINDOWS */
  #endif        /* HAVE_WINDOW_SYSTEM */
    return 1;
diff --cc src/xfns.c
Simple merge
diff --cc src/xmenu.c
index b615d321cc72e786ca2fddc705194fb094d6b141,80565f387b860c3fe332ae66a9be54070f9ebb43..b4665f88e07f908426b1db7dcd0481c70d415f44
@@@ -3818,11 -3791,11 +3836,12 @@@ syms_of_xmenu (
  #endif
  
    defsubr (&Sx_popup_menu);
+   defsubr (&Smenu_or_popup_active_p);
  
  #if defined (USE_GTK) || defined (USE_X_TOOLKIT)
 -  defsubr (&Smenu_bar_open);
 -  Ffset (intern ("accelerate-menu"), intern (Smenu_bar_open.symbol_name));
 +  defsubr (&Sx_menu_bar_open_internal);
 +  Ffset (intern ("accelerate-menu"),
 +       intern (Sx_menu_bar_open_internal.symbol_name));
  #endif
  
  #ifdef HAVE_MENUS
diff --cc src/xselect.c
Simple merge
diff --cc src/xsmfns.c
Simple merge
diff --cc src/xterm.c
index 95b2a87fd4b65eeb7a20c2870386325a17994064,75c22a7361f5ff6ba9f8d9e3e1e6b386afb872e2..7bbd2736307fb8eafc9ab9b1880532ced64ca778
@@@ -10938,124 -10996,39 +11068,125 @@@ x_activate_timeout_atimer (
  extern frame_parm_handler x_frame_parm_handlers[];
  
  static struct redisplay_interface x_redisplay_interface =
 -{
 -  x_frame_parm_handlers,
 -  x_produce_glyphs,
 -  x_write_glyphs,
 -  x_insert_glyphs,
 -  x_clear_end_of_line,
 -  x_scroll_run,
 -  x_after_update_window_line,
 -  x_update_window_begin,
 -  x_update_window_end,
 -  x_cursor_to,
 -  x_flush,
 +  {
 +    x_frame_parm_handlers,
 +    x_produce_glyphs,
 +    x_write_glyphs,
 +    x_insert_glyphs,
 +    x_clear_end_of_line,
 +    x_scroll_run,
 +    x_after_update_window_line,
 +    x_update_window_begin,
 +    x_update_window_end,
 +    x_cursor_to,
 +    x_flush,
  #ifdef XFlush
 -  x_flush,
 +    x_flush,
  #else
 -  0,  /* flush_display_optional */
 -#endif
 -  x_clear_window_mouse_face,
 -  x_get_glyph_overhangs,
 -  x_fix_overlapping_area,
 -  x_draw_fringe_bitmap,
 -  0, /* define_fringe_bitmap */
 -  0, /* destroy_fringe_bitmap */
 -  x_per_char_metric,
 -  x_encode_char,
 -  x_compute_glyph_string_overhangs,
 -  x_draw_glyph_string,
 -  x_define_frame_cursor,
 -  x_clear_frame_area,
 -  x_draw_window_cursor,
 -  x_draw_vertical_window_border,
 -  x_shift_glyphs_for_insert
 -};
 +    0,  /* flush_display_optional */
 +#endif
 +    x_clear_window_mouse_face,
 +    x_get_glyph_overhangs,
 +    x_fix_overlapping_area,
 +    x_draw_fringe_bitmap,
 +    0, /* define_fringe_bitmap */
 +    0, /* destroy_fringe_bitmap */
 +    x_per_char_metric,
 +    x_encode_char,
 +    x_compute_glyph_string_overhangs,
 +    x_draw_glyph_string,
 +    x_define_frame_cursor,
 +    x_clear_frame_area,
 +    x_draw_window_cursor,
 +    x_draw_vertical_window_border,
 +    x_shift_glyphs_for_insert
 +  };
 +
 +
 +/* This function is called when the last frame on a display is deleted. */
 +void
 +x_delete_terminal (struct terminal *terminal)
 +{
 +  struct x_display_info *dpyinfo = terminal->display_info.x;
 +  int i;
 +
 +  /* Protect against recursive calls.  Fdelete_frame in
 +     delete_terminal calls us back when it deletes our last frame.  */
 +  if (terminal->deleted)
 +    return;
 +
 +  BLOCK_INPUT;
 +  /* Free the fonts in the font table.  */
 +  for (i = 0; i < dpyinfo->n_fonts; i++)
 +    if (dpyinfo->font_table[i].name)
 +      {
 +      XFreeFont (dpyinfo->display, dpyinfo->font_table[i].font);
 +      }
 +
 +  x_destroy_all_bitmaps (dpyinfo);
 +  XSetCloseDownMode (dpyinfo->display, DestroyAll);
 +
 +#ifdef USE_GTK
 +  xg_display_close (dpyinfo->display);
 +#else
 +#ifdef USE_X_TOOLKIT
 +  XtCloseDisplay (dpyinfo->display);
 +#else
 +  XCloseDisplay (dpyinfo->display);
 +#endif
 +#endif /* ! USE_GTK */
 +
 +  x_delete_display (dpyinfo);
 +  UNBLOCK_INPUT;
 +}
 +
 +
 +static struct terminal *
 +x_create_terminal (struct x_display_info *dpyinfo)
 +{
 +  struct terminal *terminal;
 +  
 +  terminal = create_terminal ();
 +
 +  terminal->type = output_x_window;
 +  terminal->display_info.x = dpyinfo;
 +  dpyinfo->terminal = terminal;
 +
 +  /* kboard is initialized in x_term_init. */
 +  
 +  terminal->clear_frame_hook = x_clear_frame;
 +  terminal->ins_del_lines_hook = x_ins_del_lines;
 +  terminal->delete_glyphs_hook = x_delete_glyphs;
 +  terminal->ring_bell_hook = XTring_bell;
 +  terminal->reset_terminal_modes_hook = XTreset_terminal_modes;
 +  terminal->set_terminal_modes_hook = XTset_terminal_modes;
 +  terminal->update_begin_hook = x_update_begin;
 +  terminal->update_end_hook = x_update_end;
 +  terminal->set_terminal_window_hook = XTset_terminal_window;
 +  terminal->read_socket_hook = XTread_socket;
 +  terminal->frame_up_to_date_hook = XTframe_up_to_date;
 +  terminal->mouse_position_hook = XTmouse_position;
 +  terminal->frame_rehighlight_hook = XTframe_rehighlight;
 +  terminal->frame_raise_lower_hook = XTframe_raise_lower;
++  terminal->fullscreen_hook = XTfullscreen_hook;
 +  terminal->set_vertical_scroll_bar_hook = XTset_vertical_scroll_bar;
 +  terminal->condemn_scroll_bars_hook = XTcondemn_scroll_bars;
 +  terminal->redeem_scroll_bar_hook = XTredeem_scroll_bar;
 +  terminal->judge_scroll_bars_hook = XTjudge_scroll_bars;
 +
 +  terminal->delete_frame_hook = x_destroy_window;
 +  terminal->delete_terminal_hook = x_delete_terminal;
 +  
 +  terminal->rif = &x_redisplay_interface;
 +  terminal->scroll_region_ok = 1;    /* We'll scroll partial frames. */
 +  terminal->char_ins_del_ok = 1;
 +  terminal->line_ins_del_ok = 1;         /* We'll just blt 'em. */
 +  terminal->fast_clear_end_of_line = 1;  /* X does this well. */
 +  terminal->memory_below_frame = 0;   /* We don't remember what scrolls
 +                                        off the bottom. */
 +
 +  return terminal;
 +}
  
  void
  x_initialize ()
diff --cc src/xterm.h
Simple merge