This commit was generated by cvs2svn to compensate for changes in r12055,
authortomo <tomo>
Mon, 3 Sep 2007 07:45:17 +0000 (07:45 +0000)
committertomo <tomo>
Mon, 3 Sep 2007 07:45:17 +0000 (07:45 +0000)
which included commits to RCS files with non-trunk default branches.

41 files changed:
PROBLEMS
lib-src/ChangeLog
lib-src/etags.c
lib-src/gnuclient.c
lib-src/gnuslib.c
lib-src/pop.c
lib-src/pop.h
lisp/font-lock.el
lisp/info.el
lisp/package-get.el
lwlib/ChangeLog
lwlib/lwlib-Xlw.c
lwlib/xlwmenu.c
man/ChangeLog
man/lispref/os.texi
man/new-users-guide/edit.texi
man/xemacs-faq.texi
nt/ChangeLog
nt/xemacs.mak
src/EmacsShell-sub.c
src/bytecode.c
src/device-x.c
src/dgif_lib.c
src/dialog-msw.c
src/dialog-x.c
src/editfns.c
src/extents.c
src/fileio.c
src/glyphs-msw.c
src/glyphs-widget.c
src/input-method-xlib.c
src/keymap.c
src/md5.c
src/nas.c
src/scrollbar-msw.c
src/scrollbar-x.c
src/sound.c
tests/ChangeLog
tests/automated/tag-tests.el
tests/automated/test-harness.el
version.sh

index 93f8825..7abb978 100644 (file)
--- a/PROBLEMS
+++ b/PROBLEMS
@@ -44,6 +44,16 @@ General advice:
     Much general information is in INSTALL.  If it's covered in
     INSTALL, we don't repeat it here.
 
+*** X11/bitmaps/gray (or other X11-related file) not found.
+
+The X11R6 distribution was monolithic, but the X11R7 distribution is
+much more modular.  Many OS distributions omit these bitmaps (assuming
+nobody uses them, evidently).  Your OS distribution should have a
+developer's package containing these files, probably with a name
+containing the string "bitmap".  Known package names (you may need to
+add an extension such as .deb or .rpm) include x11/xbitmaps (Ubuntu)
+and xorg-x11-xbitmaps (Fedora Core 5).
+
 *** How do I configure to get the buffer tabs/progress bars?
 
 These features depend on support for "native widgets".  Use the
index 3675816..184dc6d 100644 (file)
@@ -1,3 +1,26 @@
+2006-12-09  Vin Shelton  <acs@xemacs.org>
+
+       * XEmacs 21.4.20 is released
+
+2006-08-11  Jerry James  <james@xemacs.org>
+
+       * gnuslib.c (disconnect_from_server): shutdown() has been fine on
+       Linux for a long time now; use it.  Also, don't use length to
+       access the buffer unless it is positive, not just nonzero.
+       * gnuclient.c (filename_expand): Initialize the last array element
+       to get a valid C string in case of overflow.  Use strncat to avoid
+       buffer overruns.
+       * gnuclient.c (main): Use strncpy to avoid buffer overruns.
+
+2006-08-11  Jerry James  <james@xemacs.org>
+
+       * pop.h: Sync with Emacs.
+       * pop.c: Ditto.
+
+2006-07-21  Stephen J. Turnbull  <stephen@xemacs.org>
+
+       * etags.c: Xemacs -> XEmacs
+
 2006-01-28  Vin Shelton  <acs@xemacs.org>
 
        * XEmacs 21.4.19 is released
index d59e2e8..e1b6aeb 100644 (file)
@@ -64,7 +64,7 @@ char pot_etags_version[] = "@(#) pot revision number is 14.15";
 # define _GNU_SOURCE 1         /* enables some compiler checks on GNU */
 #endif
 
-/* WIN32_NATIVE is for Xemacs.
+/* WIN32_NATIVE is for XEmacs.
    MSDOS, WINDOWSNT, DOS_NT are for Emacs. */
 #ifdef WIN32_NATIVE
 # undef MSDOS
index aaec46a..311249e 100644 (file)
@@ -198,7 +198,7 @@ filename_expand (char *fullpath, char *filename)
 #endif
 
   int len;
-  fullpath[0] = '\0';
+  fullpath[0] = fullpath[MAXPATHLEN] = '\0';
 
 #ifdef  CYGWIN
   /*
@@ -211,7 +211,7 @@ filename_expand (char *fullpath, char *filename)
   if (filename[0] && filename[0] == '/')
      {
        /* Absolute (unix-style) pathname.  Do nothing */
-       strcat (fullpath, filename);
+       strncat (fullpath, filename, MAXPATHLEN);
      }
   else
     {
@@ -219,15 +219,18 @@ filename_expand (char *fullpath, char *filename)
        and prepend it.  FIXME: need to fix the case of DOS paths like
        "\foo", where we need to get the current drive. */
 
-      strcat (fullpath, get_current_working_directory ());
+      strncat (fullpath, get_current_working_directory (), MAXPATHLEN);
       len = strlen (fullpath);
 
-      if (len > 0 && fullpath[len-1] == '/')   /* trailing slash already? */
-       ;                                       /* yep */
-      else
-       strcat (fullpath, "/");         /* nope, append trailing slash */
+      /* If no trailing slash, add one */
+      if (len <= 0 || (fullpath[len - 1] != '/' && len < MAXPATHLEN))
+       {
+         strcat (fullpath, "/");
+         len++;
+       }
+
       /* Don't forget to add the filename! */
-      strcat (fullpath,filename);
+      strncat (fullpath, filename, MAXPATHLEN - len);
     }
 } /* filename_expand */
 
@@ -439,7 +442,7 @@ main (int argc, char *argv[])
                  break;
                case 'r':
                  GET_ARGUMENT (remotearg, "-r");
-                 strcpy (remotepath, remotearg);
+                 strncpy (remotepath, remotearg, MAXPATHLEN);
                  rflg = 1;
                  break;
 #endif /* INTERNET_DOMAIN_SOCKETS */
@@ -594,7 +597,7 @@ main (int argc, char *argv[])
                                         * to this machine */
              if ((ptr = getenv ("GNU_NODE")) != NULL)
                /* user specified a path */
-               strcpy (remotepath, ptr);
+               strncpy (remotepath, ptr, MAXPATHLEN);
            }
 #if 0  /* This is really bogus... re-enable it if you must have it! */
 #if defined (hp9000s300) || defined (hp9000s800)
index ba5a96c..8951b26 100644 (file)
@@ -411,13 +411,11 @@ disconnect_from_server (int s, int echo)
 
   send_string(s,EOT_STR);              /* make sure server gets string */
 
-#if !defined (linux)  && !defined (_SCO_DS) 
+#if !defined (_SCO_DS) 
   /*
-   * shutdown is completely hozed under linux. If s is a unix domain socket,
-   * you'll get EOPNOTSUPP back from it. If s is an internet socket, you get
-   * a broken pipe when you try to read a bit later. The latter
-   * problem is fixed for linux versions >= 1.1.46, but the problem
-   * with unix sockets persists. Sigh.
+   * There used to be a comment here complaining about ancient Linux
+   * versions.  It is no longer relevant.  I don't know why _SCO_DS is
+   * verboten here, as the original comment did not say.
    */
 
   if (shutdown(s,1) == -1) {
@@ -436,7 +434,7 @@ disconnect_from_server (int s, int echo)
 #else
   while ((length = read(s,buffer,GSERV_BUFSZ)) > 0 ||
       (length == -1 && errno == EINTR)) {
-    if (length) {
+    if (length > 0) {
       buffer[length] = '\0';
       if (echo) {
        fputs(buffer,stdout);
index 0bf05de..164eb6e 100644 (file)
@@ -1,5 +1,7 @@
 /* pop.c: client routines for talking to a POP3-protocol post-office server
-   Copyright (c) 1991, 1993, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1993, 1996, 1997, 1999, 2002, 2003, 2004,
+                 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2001 Ben Wing.
    Written by Jonathan Kamens, jik@security.ov.com.
 
 This file is part of GNU Emacs.
@@ -16,8 +18,10 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
+/* Synched up with: FSF 22.0.50. */
 
 #ifdef HAVE_CONFIG_H
 #define NO_SHORTNAMES  /* Tell config not to load remap.h */
@@ -95,7 +99,7 @@ extern struct servent *hes_getservbyname (/* char *, char * */);
 #ifdef KERBEROS
 #ifndef KRB5
 extern int krb_sendauth (/* long, int, KTEXT, char *, char *, char *,
-                           unsigned long, MSG_DAT *, CREDENTIALS *, Key_schedule,
+                           u_long, MSG_DAT *, CREDENTIALS *, Key_schedule,
                            struct sockaddr_in *, struct sockaddr_in *,
                            char * */);
 extern char *krb_realmofhost (/* char * */);
@@ -109,7 +113,7 @@ extern int h_errno;
 #endif
 
 static int socket_connection (char *, int);
-static char *pop_getline (popserver);
+static int pop_getline (popserver, char **);
 static int sendline (popserver, char *);
 static int fullwrite (int, char *, int);
 static int getok (popserver);
@@ -117,9 +121,11 @@ static int getok (popserver);
 static int gettermination (popserver);
 #endif
 static void pop_trash (popserver);
-static char *find_crlf (char *);
+static char *find_crlf (char *, int);
 
-#define ERROR_MAX 80           /* a pretty arbitrary size */
+#define ERROR_MAX 160          /* a pretty arbitrary size, but needs
+                                  to be bigger than the original
+                                  value of 80 */
 #define POP_PORT 110
 #define KPOP_PORT 1109
 #if defined(WIN32_NATIVE) || defined(CYGWIN)
@@ -129,7 +135,7 @@ static char *find_crlf (char *);
 #endif
 #ifdef KERBEROS
 #ifdef KRB5
-#define KPOP_SERVICE "k5pop";
+#define KPOP_SERVICE "k5pop"
 #else
 #define KPOP_SERVICE "kpop"
 #endif
@@ -355,7 +361,7 @@ pop_stat (popserver server, int *count, int *size)
       return (-1);
     }
      
-  if (sendline (server, "STAT") || (! (fromserver = pop_getline (server))))
+  if (sendline (server, "STAT") || (pop_getline (server, &fromserver) < 0))
     return (-1);
 
   if (strncmp (fromserver, "+OK ", 4))
@@ -447,7 +453,7 @@ pop_list (popserver server, int message, int **IDs, int **sizes)
          free ((char *) *sizes);
          return (-1);
        }
-      if (! (fromserver = pop_getline (server)))
+      if (pop_getline (server, &fromserver) < 0)
        {
          free ((char *) *IDs);
          free ((char *) *sizes);
@@ -492,7 +498,7 @@ pop_list (popserver server, int message, int **IDs, int **sizes)
        }
       for (i = 0; i < how_many; i++)
        {
-         if (pop_multi_next (server, &fromserver))
+         if (pop_multi_next (server, &fromserver) <= 0)
            {
              free ((char *) *IDs);
              free ((char *) *sizes);
@@ -511,7 +517,7 @@ pop_list (popserver server, int message, int **IDs, int **sizes)
            }
          (*sizes)[i] = atoi (fromserver);
        }
-      if (pop_multi_next (server, &fromserver))
+      if (pop_multi_next (server, &fromserver) < 0)
        {
          free ((char *) *IDs);
          free ((char *) *sizes);
@@ -541,14 +547,17 @@ pop_list (popserver server, int message, int **IDs, int **sizes)
  *     markfrom
  *             If true, then mark the string "From " at the beginning
  *             of lines with '>'.
+ *     msg_buf Output parameter to which a buffer containing the
+ *             message is assigned.
  * 
- * Return value: A string pointing to the message, if successful, or
- *     null with pop_error set if not.
+ * Return value: The number of bytes in msg_buf, which may contain
+ *     embedded nulls, not including its final null, or -1 on error
+ *     with pop_error set.
  *
  * Side effects: May kill connection on error.
  */
-char *
-pop_retrieve (popserver server, int message, int markfrom)
+int
+pop_retrieve (popserver server, int message, int markfrom, char **msg_buf)
 {
   int *IDs, *sizes, bufsize, fromcount = 0, cp = 0;
   char *ptr, *fromserver;
@@ -561,11 +570,11 @@ pop_retrieve (popserver server, int message, int markfrom)
     }
 
   if (pop_list (server, message, &IDs, &sizes))
-    return (0);
+    return (-1);
 
   if (pop_retrieve_first (server, message, &fromserver))
     {
-      return (0);
+      return (-1);
     }
 
   /*
@@ -583,17 +592,16 @@ pop_retrieve (popserver server, int message, int markfrom)
     {
       strcpy (pop_error, "Out of memory in pop_retrieve");
       pop_retrieve_flush (server);
-      return (0);
+      return (-1);
     }
 
-  while (! (ret = pop_retrieve_next (server, &fromserver)))
+  while ((ret = pop_retrieve_next (server, &fromserver)) >= 0)
     {
-      int linesize;
-
       if (! fromserver)
        {
          ptr[cp] = '\0';
-         return (ptr);
+         *msg_buf = ptr;
+         return (cp);
        }
       if (markfrom && fromserver[0] == 'F' && fromserver[1] == 'r' &&
          fromserver[2] == 'o' && fromserver[3] == 'm' &&
@@ -607,25 +615,19 @@ pop_retrieve (popserver server, int message, int markfrom)
                {
                  strcpy (pop_error, "Out of memory in pop_retrieve");
                  pop_retrieve_flush (server);
-                 return (0);
+                 return (-1);
                }
              fromcount = 0;
            }
          ptr[cp++] = '>';
        }
-      linesize = strlen (fromserver);
-      memcpy (&ptr[cp], fromserver, linesize);
-      cp += linesize;
+      memcpy (&ptr[cp], fromserver, ret);
+      cp += ret;
       ptr[cp++] = '\n';
     }
 
-  if (ret)
-    {
-      free (ptr);
-      /* return (0); */
-    }
-  /* This function used to fall off the end, but that doesn't make any sense */
-  return (0);
+  free (ptr);
+  return (-1);
 }     
 
 int
@@ -635,6 +637,14 @@ pop_retrieve_first (popserver server, int message, char **response)
   return (pop_multi_first (server, pop_error, response));
 }
 
+/*
+  Returns a negative number on error, 0 to indicate that the data has
+  all been read (i.e., the server has returned a "." termination
+  line), or a positive number indicating the number of bytes in the
+  returned buffer (which is null-terminated and may contain embedded
+  nulls, but the returned bytecount doesn't include the final null).
+  */
+
 int
 pop_retrieve_next (popserver server, char **line)
 {
@@ -654,6 +664,14 @@ pop_top_first (popserver server, int message, int lines, char **response)
   return (pop_multi_first (server, pop_error, response));
 }
 
+/*
+  Returns a negative number on error, 0 to indicate that the data has
+  all been read (i.e., the server has returned a "." termination
+  line), or a positive number indicating the number of bytes in the
+  returned buffer (which is null-terminated and may contain embedded
+  nulls, but the returned bytecount doesn't include the final null).
+  */
+
 int
 pop_top_next (popserver server, char **line)
 {
@@ -676,7 +694,7 @@ pop_multi_first (popserver server, char *command, char **response)
       return (-1);
     }
 
-  if (sendline (server, command) || (! (*response = pop_getline (server))))
+  if (sendline (server, command) || (pop_getline (server, response) < 0))
     {
       return (-1);
     }
@@ -700,10 +718,20 @@ pop_multi_first (popserver server, char *command, char **response)
     }
 }
 
+/*
+  Read the next line of data from SERVER and place a pointer to it
+  into LINE.  Return -1 on error, 0 if there are no more lines to read
+  (i.e., the server has returned a line containing only "."), or a
+  positive number indicating the number of bytes in the LINE buffer
+  (not including the final null).  The data in that buffer may contain
+  embedded nulls, but does not contain the final CRLF. When returning
+  0, LINE is set to null. */
+
 int
 pop_multi_next (popserver server, char **line)
 {
   char *fromserver;
+  int ret;
 
   if (! server->in_multi)
     {
@@ -711,8 +739,7 @@ pop_multi_next (popserver server, char **line)
       return (-1);
     }
 
-  fromserver = pop_getline (server);
-  if (! fromserver)
+  if ((ret = pop_getline (server, &fromserver)) < 0)
     {
       return (-1);
     }
@@ -728,13 +755,13 @@ pop_multi_next (popserver server, char **line)
       else
        {
          *line = fromserver + 1;
-         return (0);
+         return (ret - 1);
        }
     }
   else
     {
       *line = fromserver;
-      return (0);
+      return (ret);
     }
 }
 
@@ -742,21 +769,22 @@ int
 pop_multi_flush (popserver server)
 {
   char *line;
+  int ret;
 
   if (! server->in_multi)
     {
       return (0);
     }
 
-  while (! pop_multi_next (server, &line))
+  while ((ret = pop_multi_next (server, &line)))
     {
-      if (! line)
+      if (ret < 0)
        {
-         return (0);
+         return (-1);
        }
     }
 
-  return (-1);
+  return (0);
 }
 
 /* Function: pop_delete
@@ -843,7 +871,7 @@ pop_last (popserver server)
   if (sendline (server, "LAST"))
     return (-1);
 
-  if (! (fromserver = pop_getline (server)))
+  if (pop_getline (server, &fromserver) < 0)
     return (-1);
 
   if (! strncmp (fromserver, "-ERR", 4))
@@ -961,6 +989,8 @@ socket_connection (char *host, int flags)
 #ifdef KERBEROS
 #ifdef KRB5
   krb5_error_code rem;
+  krb5_context kcontext = 0;
+  krb5_auth_context auth_context = 0;
   krb5_ccache ccdef;
   krb5_principal client, server;
   krb5_error *err_ret;
@@ -971,6 +1001,7 @@ socket_connection (char *host, int flags)
   CREDENTIALS cred;
   Key_schedule schedule;
   int rem;
+  char *realhost;
 #endif /* KRB5 */
 #endif /* KERBEROS */
 
@@ -984,21 +1015,6 @@ socket_connection (char *host, int flags)
   }
 #endif
 
-  do
-    {
-      hostent = gethostbyname (host);
-      try_count++;
-      if ((! hostent) 
-#ifndef BROKEN_CYGWIN    
-         && ((h_errno != TRY_AGAIN) || (try_count == 5))
-#endif
-         )
-       {
-         strcpy (pop_error, "Could not determine POP server's address");
-         return (-1);
-       }
-    } while (! hostent);
-
   memset (&addr, 0, sizeof (addr));
   addr.sin_family = AF_INET;
 
@@ -1037,18 +1053,33 @@ socket_connection (char *host, int flags)
        }
     }
 
-#define SOCKET_ERROR "Could not create socket for POP connection: "
+#define POP_SOCKET_ERROR "Could not create socket for POP connection: "
 
   sock = socket (PF_INET, SOCK_STREAM, 0);
   if (sock < 0)
     {
-      strcpy (pop_error, SOCKET_ERROR);
+      strcpy (pop_error, POP_SOCKET_ERROR);
       strncat (pop_error, strerror (errno),
-              ERROR_MAX - sizeof (SOCKET_ERROR));
+              ERROR_MAX - sizeof (POP_SOCKET_ERROR));
       return (-1);
          
     }
 
+  do
+    {
+      hostent = gethostbyname (host);
+      try_count++;
+      if ((! hostent) 
+#ifndef BROKEN_CYGWIN    
+         && ((h_errno != TRY_AGAIN) || (try_count == 5))
+#endif
+         )
+       {
+         strcpy (pop_error, "Could not determine POP server's address");
+         return (-1);
+       }
+    } while (! hostent);
+
   while (*hostent->h_addr_list)
     {
       memcpy (&addr.sin_addr, *hostent->h_addr_list, hostent->h_length);
@@ -1074,11 +1105,13 @@ socket_connection (char *host, int flags)
   if (! (flags & POP_NO_KERBEROS))
     {
 #ifdef KRB5
-      krb5_init_ets ();
-
-      if (rem = krb5_cc_default (&ccdef))
+      if ((rem = krb5_init_context (&kcontext)))
        {
        krb5error:
+         if (auth_context)
+           krb5_auth_con_free (kcontext, auth_context);
+         if (kcontext)
+           krb5_free_context (kcontext);
          strcpy (pop_error, KRB_ERROR);
          strncat (pop_error, error_message (rem),
                   ERROR_MAX - sizeof(KRB_ERROR));
@@ -1086,10 +1119,14 @@ socket_connection (char *host, int flags)
          return (-1);
        }
 
-      if (rem = krb5_cc_get_principal (ccdef, &client))
-       {
-         goto krb5error;
-       }
+      if ((rem = krb5_auth_con_init (kcontext, &auth_context)))
+       goto krb5error;
+
+      if (rem = krb5_cc_default (kcontext, &ccdef))
+       goto krb5error;
+
+      if (rem = krb5_cc_get_principal (kcontext, ccdef, &client))
+       goto krb5error;
 
       for (cp = hostent->h_name; *cp; cp++)
        {
@@ -1099,22 +1136,20 @@ socket_connection (char *host, int flags)
            }
        }
 
-      if (rem = krb5_sname_to_principal (hostent->h_name, POP_SERVICE,
-                                        FALSE, &server))
-       {
-         goto krb5error;
-       }
+      if (rem = krb5_sname_to_principal (kcontext, hostent->h_name,
+                                        POP_SERVICE, FALSE, &server))
+       goto krb5error;
 
-      rem = krb5_sendauth ((krb5_pointer) &sock, "KPOPV1.0", client, server,
+      rem = krb5_sendauth (kcontext, &auth_context,
+                          (krb5_pointer) &sock, "KPOPV1.0", client, server,
                          AP_OPTS_MUTUAL_REQUIRED,
                          0,    /* no checksum */
                          0,    /* no creds, use ccache instead */
                          ccdef,
-                         0,    /* don't need seq # */
-                         0,    /* don't need subsession key */
                          &err_ret,
+                         0,    /* don't need subsession key */
                          0);   /* don't need reply */
-      krb5_free_principal (server);
+      krb5_free_principal (kcontext, server);
       if (rem)
        {
          if (err_ret && err_ret->text.length)
@@ -1137,20 +1172,23 @@ socket_connection (char *host, int flags)
                       ERROR_MAX - sizeof (KRB_ERROR));
            }
          if (err_ret)
-           krb5_free_error (err_ret);
+           krb5_free_error (kcontext, err_ret);
+         krb5_auth_con_free (kcontext, auth_context);
+         krb5_free_context (kcontext);
 
          CLOSESOCKET (sock);
          return (-1);
        }
 #else  /* ! KRB5 */      
       ticket = (KTEXT) malloc (sizeof (KTEXT_ST));
-      rem = krb_sendauth (0L, sock, ticket, "pop", hostent->h_name,
-                         (char *) krb_realmofhost (hostent->h_name),
+      rem = krb_sendauth (0L, sock, ticket, "pop", realhost,
+                         (char *) krb_realmofhost (realhost),
                          (unsigned long) 0, &msg_data, &cred, schedule,
                          (struct sockaddr_in *) 0,
                          (struct sockaddr_in *) 0,
                          "KPOPV0.1");
       free ((char *) ticket);
+      free (realhost);
       if (rem != KSUCCESS)
        {
          strcpy (pop_error, KRB_ERROR);
@@ -1177,15 +1215,20 @@ socket_connection (char *host, int flags)
  * Arguments:
  *     server  The server from which to get the line of text.
  *
- * Returns: A non-null pointer if successful, or a null pointer on any
- *     error, with an error message copied into pop_error.
+ * Returns: The number of characters in the line, which is returned in
+ *     LINE, not including the final null.  A return value of 0
+ *     indicates a blank line.  A negative return value indicates an
+ *     error (in which case the contents of LINE are undefined.  In
+ *     case of error, an error message is copied into pop_error.
  *
  * Notes: The line returned is overwritten with each call to pop_getline.
  *
  * Side effects: Closes the connection on error.
+ *
+ * THE RETURNED LINE MAY CONTAIN EMBEDDED NULLS!
  */
-static char *
-pop_getline (popserver server)
+static int
+pop_getline (popserver server, char **line)
 {
 #define GETLINE_ERROR "Error reading from server: "
 
@@ -1194,7 +1237,8 @@ pop_getline (popserver server)
 
   if (server->data)
     {
-      char *cp = find_crlf (server->buffer + server->buffer_index);
+      char *cp = find_crlf (server->buffer + server->buffer_index,
+                           server->data);
       if (cp)
        {
          int found;
@@ -1208,8 +1252,11 @@ pop_getline (popserver server)
          server->buffer_index += data_used;
 
          if (pop_debug)
+           /* Embedded nulls will truncate this output prematurely,
+              but that's OK because it's just for debugging anyway. */
            fprintf (stderr, "<<< %s\n", server->buffer + found);
-         return (server->buffer + found);
+         *line = server->buffer + found;
+         return (data_used - 2);
        }
       else
        {
@@ -1245,7 +1292,7 @@ pop_getline (popserver server)
            {
              strcpy (pop_error, "Out of memory in pop_getline");
              pop_trash (server);
-             return (0);
+             return (-1);
            }
        }
       ret = RECV (server->file, server->buffer + server->data,
@@ -1256,13 +1303,13 @@ pop_getline (popserver server)
          strncat (pop_error, strerror (errno),
                   ERROR_MAX - sizeof (GETLINE_ERROR));
          pop_trash (server);
-         return (0);
+         return (-1);
        }
       else if (ret == 0)
        {
          strcpy (pop_error, "Unexpected EOF from server in pop_getline");
          pop_trash (server);
-         return (0);
+         return (-1);
        }
       else
        {
@@ -1270,7 +1317,8 @@ pop_getline (popserver server)
          server->data += ret;
          server->buffer[server->data] = '\0';
               
-         cp = find_crlf (server->buffer + search_offset);
+         cp = find_crlf (server->buffer + search_offset,
+                         server->data - search_offset);
          if (cp)
            {
              int data_used = (cp + 2) - server->buffer;
@@ -1280,9 +1328,12 @@ pop_getline (popserver server)
 
              if (pop_debug)
                fprintf (stderr, "<<< %s\n", server->buffer);
-             return (server->buffer);
+             *line = server->buffer;
+             return (data_used - 2);
            }
-         search_offset += ret;
+         /* As above, the "- 1" here is to account for the fact that
+            we may have read a CR without its accompanying LF. */
+         search_offset += ret - 1;
        }
     }
 
@@ -1312,12 +1363,24 @@ sendline (popserver server, char *line)
 {
 #define SENDLINE_ERROR "Error writing to POP server: "
   int ret;
-
+  char *buf;
+
+  /* Combine the string and the CR-LF into one buffer.  Otherwise, two
+     reasonable network stack optimizations, Nagle's algorithm and
+     delayed acks, combine to delay us a fraction of a second on every
+     message we send.  (Movemail writes line without \r\n, client
+     kernel sends packet, server kernel delays the ack to see if it
+     can combine it with data, movemail writes \r\n, client kernel
+     waits because it has unacked data already in its outgoing queue,
+     client kernel eventually times out and sends.)
+
+     This can be something like 0.2s per command, which can add up
+     over a few dozen messages, and is a big chunk of the time we
+     spend fetching mail from a server close by.  */
+  buf = alloca (strlen (line) + 3);
+  strcpy (buf, line);
+  strcat (buf, "\r\n");
   ret = fullwrite (server->file, line, strlen (line));
-  if (ret >= 0)
-    {                          /* 0 indicates that a blank line was written */
-      ret = fullwrite (server->file, "\r\n", 2);
-    }
 
   if (ret < 0)
     {
@@ -1346,10 +1409,10 @@ static int
 fullwrite (int fd, char *buf, int nbytes)
 {
   char *cp;
-  int ret;
+  int ret = 0;
 
   cp = buf;
-  while ((ret = SEND (fd, cp, nbytes, 0)) > 0)
+  while (nbytes && ((ret = SEND (fd, cp, nbytes, 0)) > 0))
     {
       cp += ret;
       nbytes -= ret;
@@ -1377,7 +1440,7 @@ getok (popserver server)
 {
   char *fromline;
 
-  if (! (fromline = pop_getline (server)))
+  if (pop_getline (server, &fromline) < 0)
     {
       return (-1);
     }
@@ -1415,8 +1478,7 @@ gettermination (popserver server)
 {
   char *fromserver;
 
-  fromserver = pop_getline (server);
-  if (! fromserver)
+  if (pop_getline (server, &fromserver) < 0)
     return (-1);
 
   if (strcmp (fromserver, "."))
@@ -1487,17 +1549,16 @@ pop_trash (popserver server)
 #endif
 }
 
-/* Return a pointer to the first CRLF in IN_STRING,
-   or 0 if it does not contain one.  */
+/* Return a pointer to the first CRLF in IN_STRING, which can contain
+   embedded nulls and has LEN characters in it not including the final
+   null, or 0 if it does not contain one.  */
 
 static char *
-find_crlf (char *in_string)
+find_crlf (char *in_string, int len)
 {
-  while (1)
+  while (len--)
     {
-      if (! *in_string)
-       return (0);
-      else if (*in_string == '\r')
+      if (*in_string == '\r')
        {
          if (*++in_string == '\n')
            return (in_string - 1);
@@ -1505,7 +1566,7 @@ find_crlf (char *in_string)
       else
        in_string++;
     }
-  /* NOTREACHED */
+  return (0);
 }
 
 #endif /* MAIL_USE_POP */
index 9121425..c18b623 100644 (file)
@@ -1,5 +1,6 @@
 /* pop.h: Header file for the "pop.c" client POP3 protocol.
-   Copyright (c) 1991,1993 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1993, 2002, 2003, 2004,
+                 2005, 2006 Free Software Foundation, Inc.
    Written by Jonathan Kamens, jik@security.ov.com.
 
 This file is part of GNU Emacs.
@@ -16,8 +17,10 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
+
+/* Synched up with: FSF 22.0.50. */
 
 #include <stdio.h>
 
@@ -59,7 +62,8 @@ extern popserver pop_open _ARGS((char *host, char *username, char *password,
 extern int pop_stat _ARGS((popserver server, int *count, int *size));
 extern int pop_list _ARGS((popserver server, int message, int **IDs,
                           int **size));
-extern char *pop_retrieve _ARGS((popserver server, int message, int markfrom));
+extern int pop_retrieve _ARGS((popserver server, int message, int markfrom,
+                              char **));
 extern int pop_retrieve_first _ARGS((popserver server, int message,
                                     char **response));
 extern int pop_retrieve_next _ARGS((popserver server, char **line));
index 1734010..e2ed681 100644 (file)
@@ -2503,9 +2503,10 @@ The name is assumed to begin with a capital letter.")
         (list        
          (concat
           "\\<\\("
+          "assert\\|"
           "break\\|byvalue\\|"
           "case\\|cast\\|catch\\|class\\|continue\\|"
-          "do\\|else\\|extends\\|"
+          "do\\|else\\|enum\\|extends\\|"
           "finally\\|for\\|future\\|"
           "generic\\|goto\\|"
           "if\\|implements\\|import\\|"
@@ -2691,10 +2692,10 @@ The name is assumed to begin with a capital letter.")
          '("\\(@beaninfo\\)"
            0 font-lock-keyword-face t)
          ;; Doc tag - Links
-         '("{ *@link\\s +\\([^}]+\\)}"
+         '("{ *@link\\(?:plain\\)?\\s +\\([^}]+\\)}"
            0 font-lock-keyword-face t)
          ;; Doc tag - Links
-         '("{ *@link\\s +\\(\\(\\S +\\)\\|\\(\\S +\\s +\\S +\\)\\) *}"
+         '("{ *@link\\(?:plain\\)?\\s +\\(\\(\\S +\\)\\|\\(\\S +\\s +\\S +\\)\\) *}"
            1 font-lock-function-name-face t)
     
          )))
index 41cfc46..a83a578 100644 (file)
@@ -699,7 +699,8 @@ further (recursive) error recovery.  TRYFILE is ??"
                    Info-current-subfile nil
                    Info-current-file-completions nil
                    Info-index-alternatives nil
-                   buffer-file-name nil)
+                   buffer-file-name nil
+                   buffer-file-truename nil)
              (erase-buffer)
              (if (string= "dir" (file-name-nondirectory filename))
                  (Info-insert-dir)
@@ -1034,7 +1035,8 @@ actually get any text from."
       (message "Composing main Info directory...done"))
     (setq Info-dir-contents (buffer-string)))
   (setq default-directory (file-name-as-directory Info-dir-contents-directory))
-  (setq buffer-file-name (caar Info-dir-file-attributes)))
+  (setq buffer-file-name (caar Info-dir-file-attributes)
+       buffer-file-truename (file-truename buffer-file-name)))
 
 (defmacro Info-directory-files (dir-file &optional all full nosort files-only)
   "Return a list of Info files living in the same directory as DIR-FILE.
@@ -1405,7 +1407,8 @@ invoke \"xemacs -batch -f Info-batch-rebuild-dir /usr/local/info\"."
            (throw 'foo t)))))
     (or (equal Info-current-subfile lastfilename)
        (let ((buffer-read-only nil))
-         (setq buffer-file-name nil)
+         (setq buffer-file-name nil
+               buffer-file-truename nil)
          (widen)
          (erase-buffer)
          (Info-insert-file-contents (Info-suffixed-file
@@ -1513,7 +1516,8 @@ versions of NAME. Only the suffixes are tried."
          (call-process shell-file-name nil t nil shell-command-switch command)
          (message "")
          (when visit
-           (setq buffer-file-name file)
+           (setq buffer-file-name file
+                 buffer-file-truename (file-truename buffer-file-name))
            (set-buffer-modified-p nil)
            (clear-visited-file-modtime)))
       (insert-file-contents file visit))))
@@ -3035,7 +3039,7 @@ The locations are of the format used in Info-history, i.e.
 \(FILENAME NODENAME BUFFERPOS\)."
   (let ((where '())
        (cmd-desc (concat "^\\* " (regexp-quote (symbol-name command))
-                         ":\\s *\\(.*\\)\\.$")))
+                         ":\\s *\\(.*\\)\\.")))
     (save-excursion
       (Info-find-node "XEmacs" "Command Index")
       ;; Take the index node off the Info history.
index 33d5802..0d97982 100644 (file)
@@ -233,6 +233,7 @@ directory."
 ;   ("Japan (nucba.ac.jp)" "mirror.nucba.ac.jp" "mirror/xemacs/packages")
     ("Japan (sut.ac.jp)" "sunsite.sut.ac.jp" "pub/archives/packages/xemacs/packages")
     ("Korea (kr.xemacs.org)" "ftp.kr.xemacs.org" "pub/tools/emacs/xemacs/packages")
+    ("Netherlands (nl.xemacs.org)" "ftp.nl.xemacs.org" "pub/xemacs/ftp/packages")
     ("New Zealand (nz.xemacs.org)" "ftp.nz.xemacs.org" "mirror/ftp.xemacs.org/packages")
     ("Norway (no.xemacs.org)" "ftp.no.xemacs.org" "pub/xemacs/packages")
     ("Poland (pl.xemacs.org)" "ftp.pl.xemacs.org" "pub/unix/editors/xemacs/packages")
@@ -323,6 +324,8 @@ variable actually used to specify package download sites."
      "pub/archives/packages/xemacs/xemacs-21.5/experimental/packages")
     ("Korea (kr.xemacs.org)" "ftp.kr.xemacs.org"
      "pub/tools/emacs/xemacs/beta/experimental/packages")
+    ("Netherlands (nl.xemacs.org)" "ftp.nl.xemacs.org"
+     "pub/xemacs/ftp/beta/experimental/packages")
     ("New Zealand Pre-Releases (nz.xemacs.org)" "ftp.nz.xemacs.org"
      "mirror/ftp.xemacs.org/packages")
     ("Norway Pre-Releases (no.xemacs.org)" "ftp.no.xemacs.org"
index 259cf54..43763b1 100644 (file)
@@ -1,3 +1,14 @@
+2006-12-09  Vin Shelton  <acs@xemacs.org>
+
+       * XEmacs 21.4.20 is released
+
+2006-06-22  Jerry James  <james@xemacs.org>
+
+       * lwlib-Xlw.c (xlw_scrollbar_callback): Do not dereference
+       instance before checking whether it is NULL.
+       * xlwmenu.c (xlw_map_menu): Prevent uninitialized access to root
+       and waste.
+
 2006-01-28  Vin Shelton  <acs@xemacs.org>
 
        * XEmacs 21.4.19 is released
index 1e909b6..712a62b 100644 (file)
@@ -163,13 +163,13 @@ xlw_scrollbar_callback (Widget widget, XtPointer closure, XtPointer call_data)
   XlwScrollBarCallbackStruct *data =
     (XlwScrollBarCallbackStruct *) call_data;
   scroll_event event_data;
-  scrollbar_values *val =
-    (scrollbar_values *) instance->info->val->scrollbar_data;
+  scrollbar_values *val;
   double percent;
 
   if (!instance || widget->core.being_destroyed)
     return;
 
+  val = (scrollbar_values *) instance->info->val->scrollbar_data;
   id = instance->info->id;
 
   percent = (double) (data->value - 1) / (double) (INT_MAX - 1);
index cd013c8..eff3d24 100644 (file)
@@ -3412,8 +3412,8 @@ xlw_map_menu (Time t)
   if (!mw->menu.pointer_grabbed)
     {
       XWindowAttributes ret;
-      Window parent,root;
-      Window *waste;
+      Window parent,root = 0UL;
+      Window *waste = NULL;
       unsigned int num_waste;
 
       lw_menu_active = True;
index d6c5abe..4342f7f 100644 (file)
@@ -1,3 +1,25 @@
+2006-12-09  Vin Shelton  <acs@xemacs.org>
+
+       * XEmacs 21.4.20 is released
+
+2006-11-07  Robert Pluim  <rpluim@gmail.com>
+
+       * lispref/os.texi (User Identification): The code uses HOMEPATH,
+       not HOMEDIR.
+
+2006-07-19  Stephen J. Turnbull  <stephen@xemacs.org>
+
+       * new-users-guide/edit.texi (Insert): Document bogosity in
+       vendor labeling of DEL key.
+       (Numeric Argument): Remove spurious RETs from keystroke examples.
+       Thanks to Michael C. Wescott <wescott@sc.rr.com>.
+
+2006-05-17  Stephen J. Turnbull  <stephen@xemacs.org>
+
+       * xemacs-faq.texi (Q2.2.3): New node.
+       (Q2.2.2, Q2.3.1): Fix navigation references.
+       (Top, Installation): Add to menus.
+
 2006-01-28  Vin Shelton  <acs@xemacs.org>
 
        * XEmacs 21.4.19 is released
index 67d1ff3..9376868 100644 (file)
@@ -866,10 +866,10 @@ Under MS Windows, this is done:
 Return the value of ``@code{(getenv "HOME")}'', if set.
 
 @item
-If the environment variables @code{HOMEDRIVE} and @code{HOMEDIR} are
+If the environment variables @code{HOMEDRIVE} and @code{HOMEPATH} are
 both set, return the concatenation (the following description uses MS
 Windows environment variable substitution syntax):
-@code{%HOMEDRIVE%%HOMEDIR%}.
+@code{%HOMEDRIVE%%HOMEPATH%}.
 
 @item
 Return ``C:\'', as a fallback, but issue a warning.
index 022a5df..0efac03 100644 (file)
@@ -71,10 +71,20 @@ the cursor).  The cursor and all characters after it move backwards.
 Therefore, if you type a printing character and then type @key{DEL},
 they cancel out.
 
+  Unfortunately, computer and keyboard manufacturers differ over the
+name of the @key{DEL} key.  This is the key at the far right of the row
+of keys containing the digits, usually immediately above the @kbd{RET}
+key.  It is usually labelled ``Backspace'' or ``Delete'' or some
+abbreviation.  Modern keyboards will often have another key labelled
+``Del'' in the @emph{edit keypad} (along with an ``Ins'' key and perhaps
+some others).  This is not the @kbd{DEL} key referred to here.  It
+usually deletes @emph{forward} in Emacs.
+
 @kindex RET
 @cindex newline
 @findex auto-fill-mode
-   To end a line and start typing a new one, type @key{RET}.  This
+   To end a line and start typing a new one, type @key{RET}.  On some
+keyboards, this key is labelled ``Enter''.  This
 inserts a newline character in the buffer.  If point is in the middle of
 a line, @key{RET} splits the line.  Typing @key{DEL} when the cursor is
 at the beginning of a line rubs out the newline before the line, thus
@@ -241,24 +251,24 @@ forward one character). Negative arguments are also allowed. Often they tell
 a command to move or act backwards. For example, if you want to move
 down ten lines, type the following:
 @example
-C-u 10 C-n RET
+C-u 10 C-n
 @end example
 @noindent
-After you press @key{RET} key, the cursor will move ten lines
+After you press the @kbd{C-n} key, the cursor will move ten lines
 downward. You can also type:
 @example
-M-10 C-n RET
+M-10 C-n
 @end example
 @noindent
 Both @kbd{C-u} and @kbd{M-} allow you to give numeric arguments. If you
 want to move ten lines backward, you can also give negative arguments, like:
 @example
-C-u -10 C-n RET
+C-u -10 C-n
 @end example
 @noindent
 OR you could also type:
 @example
-M--10 C-n RET
+M--10 C-n
 @end example
 @noindent
 You can obviously use @kbd{C-b} to move backward rather than giving
index 1c2ea47..404f853 100644 (file)
@@ -293,6 +293,7 @@ library directory>/info/}. For example in
 2.2: Unix/Mac OS X Installation (Also Relevant to Cygwin, MinGW)
 * Q2.2.1::    Libraries in non-standard locations
 * Q2.2.2::    Why can't I strip XEmacs?
+* Q2.2.3::    X11/bitmaps/gray (or other X11-related file) not found.
 
 2.3: Windows Installation (Windows, Cygwin, MinGW)
 * Q2.3.1::    What exactly are all the different ways to build XEmacs under Windows?
@@ -3090,6 +3091,7 @@ section is devoted to Installation, Maintenance and Troubleshooting.
 2.2: Unix/Mac OS X Installation (Also Relevant to Cygwin, MinGW)
 * Q2.2.1::    Libraries in non-standard locations
 * Q2.2.2::    Why can't I strip XEmacs?
+* Q2.2.3::    X11/bitmaps/gray (or other X11-related file) not found.
 
 2.3: Windows Installation (Windows, Cygwin, MinGW)
 * Q2.3.1::    What exactly are all the different ways to build XEmacs under Windows?
@@ -3580,7 +3582,7 @@ or for 21.5:
 --with-site-prefixes=WHATEVER
 @end example
 
-@node Q2.2.2, Q2.3.1, Q2.2.1, Installation
+@node Q2.2.2, Q2.2.3, Q2.2.1, Installation
 @unnumberedsubsec Q2.2.2: Why can't I strip XEmacs?
 
 @email{cognot@@fronsac.ensg.u-nancy.fr, Richard Cognot} writes:
@@ -3635,9 +3637,20 @@ cp lib-src/DOC-19.16-XEmacs
 @end enumerate
 @end quotation
 
+@node Q2.2.3, Q2.3.1, Q2.2.2, Installation
+@unnumberedsubsec Q2.2.3: X11/bitmaps/gray (or other X11-related file) not found.
+
+The X11R6 distribution was monolithic, but the X11R7 distribution is
+much more modular.  Many OS distributions omit these bitmaps (assuming
+nobody uses them, evidently).  Your OS distribution should have a
+developer's package containing these files, probably with a name
+containing the string "bitmap".  Known package names (you may need to
+add an extension such as .deb or .rpm) include x11/xbitmaps (Ubuntu)
+and xorg-x11-xbitmaps (Fedora Core 5).
+
 @unnumberedsec 2.3: Windows Installation (Windows, Cygwin, MinGW)
 
-@node Q2.3.1, Q2.3.2, Q2.2.2, Installation
+@node Q2.3.1, Q2.3.2, Q2.2.3, Installation
 @unnumberedsubsec Q2.3.1: What exactly are all the different ways to build XEmacs under Windows?
 
 XEmacs can be built in several ways in the MS Windows environment.
index 91ea3c7..833f1fa 100644 (file)
@@ -1,3 +1,17 @@
+2006-12-09  Vin Shelton  <acs@xemacs.org>
+
+       * XEmacs 21.4.20 is released
+
+2006-03-04  Vin Shelton  <acs@xemacs.org>
+
+       * config.inc.samp: Comment out PACKAGE_PREFIX.
+       * xemacs.mak: Do not set a value for PACKAGE_PATH unless
+       PACKAGE_PATH or PACKAGE_PREFIX was specified in config.inc.
+
+2006-01-28  Vin Shelton  <acs@xemacs.org>
+
+       * XEmacs.iss: Erase old code.
+
 2006-01-28  Vin Shelton  <acs@xemacs.org>
 
        * XEmacs 21.4.19 is released
index e1f5ad5..13a88d9 100644 (file)
@@ -108,17 +108,24 @@ INSTALL_DIR=c:\Program Files\XEmacs\XEmacs-$(XEMACS_VERSION_STRING)
 !if !defined(HAVE_MULE)
 HAVE_MULE=0
 !endif
+
+# If PACKAGE_PATH was defined, use it.  If PACKAGE_PATH was not defined,
+# but PACKAGE_PREFIX was, use PACKAGE_PREFIX to generate a package path.
+# If neither PACKAGE_PATH nor PACKAGE_PREFIX was defined,
+# do not define a package path.
 !if !defined(PACKAGE_PATH)
-! if !defined(PACKAGE_PREFIX)
-PACKAGE_PREFIX=c:\Program Files\XEmacs
-! endif
-! if $(HAVE_MULE)
+! if defined(PACKAGE_PREFIX)
+!  if $(HAVE_MULE)
 PACKAGE_PATH=~\.xemacs;;$(PACKAGE_PREFIX)\site-packages;$(PACKAGE_PREFIX)\mule-packages;$(PACKAGE_PREFIX)\xemacs-packages
-! else
+!  else
 PACKAGE_PATH=~\.xemacs;;$(PACKAGE_PREFIX)\site-packages;$(PACKAGE_PREFIX)\xemacs-packages
+!  endif
 ! endif
 !endif
+!if defined(PACKAGE_PATH)
 PATH_PACKAGEPATH="$(PACKAGE_PATH:\=\\)"
+!endif
+
 !if !defined(HAVE_MS_WINDOWS)
 HAVE_MS_WINDOWS=1
 !endif
@@ -541,8 +548,10 @@ CONFIG_VALUES = $(LIB_SRC)\config.values
 !endif
 !if [echo LISPDIR>>$(CONFIG_VALUES) && echo "$(MAKEDIR:\=\\)\\$(LISP:\=\\)">>$(CONFIG_VALUES)]
 !endif
+!if defined(PATH_PACKAGEPATH)
 # PATH_PACKAGEPATH is already a quoted string.
-!if [echo PACKAGE_PATH>>$(CONFIG_VALUES) && echo $(PATH_PACKAGEPATH)>>$(CONFIG_VALUES)]
+! if [echo PACKAGE_PATH>>$(CONFIG_VALUES) && echo $(PATH_PACKAGEPATH)>>$(CONFIG_VALUES)]
+! endif
 !endif
 
 # Inferred rule
@@ -875,8 +884,10 @@ TEMACS_CPP_FLAGS=-c \
  $(EMACS_BETA_VERSION) \
  $(EMACS_PATCH_LEVEL) \
  -DXEMACS_CODENAME=\"$(xemacs_codename:&=and)\" \
- -DEMACS_CONFIGURATION=\"$(EMACS_CONFIGURATION)\" \
- -DPATH_PACKAGEPATH=\"$(PATH_PACKAGEPATH)\"
+!if defined(PATH_PACKAGEPATH)
+ -DPATH_PACKAGEPATH=\"$(PATH_PACKAGEPATH)\" \
+!endif
+ -DEMACS_CONFIGURATION=\"$(EMACS_CONFIGURATION)\"
 
 !if $(HAVE_X_WINDOWS)
 TEMACS_X_OBJS=\
@@ -1363,7 +1374,11 @@ docfile :: $(DOC)
 
 $(DOC): $(LIB_SRC)\make-docfile.exe $(DOC_SRC1) $(DOC_SRC2) $(DOC_SRC3) $(DOC_SRC4) $(DOC_SRC5) $(DOC_SRC6) $(DOC_SRC7) $(DOC_SRC8) $(DOC_SRC9) $(DOC_SRC10) $(DOC_SRC11)
        if exist $(DOC) del $(DOC)
+!if defined(PACKAGE_PATH)
        set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH)
+!else
+       set EMACSBOOTSTRAPLOADPATH=$(LISP)
+!endif
        set EMACSBOOTSTRAPMODULEPATH=$(MODULES)
        $(TEMACS_BATCH) -l $(TEMACS_DIR)\..\lisp\make-docfile.el -- -o $(DOC) -i $(XEMACS)\site-packages
        $(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC1)
@@ -1379,7 +1394,11 @@ $(DOC): $(LIB_SRC)\make-docfile.exe $(DOC_SRC1) $(DOC_SRC2) $(DOC_SRC3) $(DOC_SR
        $(LIB_SRC)\make-docfile.exe -a $(DOC) -d $(TEMACS_SRC) $(DOC_SRC11)
 
 update-elc:
+!if defined(PACKAGE_PATH)
        set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH)
+!else
+       set EMACSBOOTSTRAPLOADPATH=$(LISP)
+!endif
        set EMACSBOOTSTRAPMODULEPATH=$(MODULES)
        $(TEMACS_BATCH) -l $(TEMACS_DIR)\..\lisp\update-elc.el
 
@@ -1393,7 +1412,11 @@ $(TEMACS_DIR)\NEEDTODUMP :
 $(PROGNAME) : $(TEMACS) $(TEMACS_DIR)\NEEDTODUMP
        @echo >$(TEMACS_DIR)\SATISFIED
        cd $(TEMACS_DIR)
+!if defined(PACKAGE_PATH)
        set EMACSBOOTSTRAPLOADPATH=$(LISP);$(PACKAGE_PATH)
+!else
+       set EMACSBOOTSTRAPLOADPATH=$(LISP)
+!endif
        set EMACSBOOTSTRAPMODULEPATH=$(MODULES)
        $(TEMACS_BATCH) -l $(TEMACS_DIR)\..\lisp\loadup.el dump
 !if $(USE_PORTABLE_DUMPER)
@@ -1435,6 +1458,7 @@ install:  all
        @xcopy /e /q $(XEMACS)\etc  "$(INSTALL_DIR)\etc\"
        @xcopy /e /q $(XEMACS)\info "$(INSTALL_DIR)\info\"
        @xcopy /e /q $(XEMACS)\lisp "$(INSTALL_DIR)\lisp\"
+!if defined(PACKAGE_PREFIX)
        @echo Making skeleton package tree in $(PACKAGE_PREFIX) ...
        @xcopy /q PlaceHolder "$(PACKAGE_PREFIX)\site-packages\"
        $(DEL) "$(PACKAGE_PREFIX)\site-packages\PlaceHolder"
@@ -1442,6 +1466,7 @@ install:  all
        $(DEL) "$(PACKAGE_PREFIX)\mule-packages\PlaceHolder"
        @xcopy /q PlaceHolder "$(PACKAGE_PREFIX)\xemacs-packages\"
        $(DEL) "$(PACKAGE_PREFIX)\xemacs-packages\PlaceHolder"
+!endif
        $(DEL) PlaceHolder
 
 mostlyclean:
@@ -1525,7 +1550,9 @@ XEmacs $(XEMACS_VERSION_STRING) $(xemacs_codename) configured for `$(EMACS_CONFI
   Using compiler "$(CC) $(CFLAGS)".
 !endif
   Installing XEmacs in "$(INSTALL_DIR:\=\\)".
+!if defined(PATH_PACKAGEPATH)
   Package path is $(PATH_PACKAGEPATH).
+!endif
 !if $(INFODOCK)
   Building InfoDock.
 !endif
index 81c538a..1a59ac3 100644 (file)
@@ -335,11 +335,16 @@ RootGeometryManager (Widget gw,
          result == XtGeometryAlmost ? "XtGeometryAlmost" :
          "XtGeometryDone");
   if (reply->request_mode & CWWidth)
-    printf ("width returned;");
+    printf ("width returned was %d%s",
+           reply->width,
+           reply->request_mode & CWHeight ? "; " : ".\n");
   if (reply->request_mode & CWHeight)
-    printf ("height returned;");
-  printf ("\n");
-  printf ("  resulting shell size: %d %d\n", reply->width, reply->height);
+    printf ("height returned was %d.\n", reply->height);
+  /* #### does this also need to depend on the result?
+     With XtGeometryYes there doesn't seem to be a useful reply object. */
+  printf ("  resulting shell size: %d %d\n",
+         reply->request_mode & CWWidth ? reply->width : w->core.width,
+         reply->request_mode & CWHeight ? reply->height : w->core.height);
   printf ("----------\n");
   fflush (stdout);
 #endif
@@ -366,11 +371,11 @@ ChangeManaged (Widget wid)
       for (i = 0; i < w->composite.num_children; i++) {
        if (XtIsManaged(w->composite.children[i])) {
          child = w->composite.children[i];
+         update_size_hints_internal (w, child->core.width,
+                                     child->core.height);
          break;
        }
       }
-
-      update_size_hints_internal (w, child->core.width, child->core.height);
     }
 
   /* call the real ChangeManaged */
index fa6b469..72f5d62 100644 (file)
@@ -1624,7 +1624,7 @@ optimize_byte_code (/* in */
     int from;
     int to;
   };
-  struct jump * const jumps = alloca_array (struct jump, comfy_size);
+  struct jump * const jumps = xnew_array (struct jump, comfy_size);
   struct jump *jumps_ptr = jumps;
 
   Opbyte *program_ptr = program;
@@ -1868,6 +1868,7 @@ optimize_byte_code (/* in */
 
   /* *program_ptr++ = 0; */
   *program_length = program_ptr - program;
+  xfree(jumps);
 }
 
 /* Optimize the byte code and store the optimized program, only
index 17ef7e2..540e407 100644 (file)
@@ -1161,8 +1161,10 @@ x_IO_error_handler (Display *disp)
      Xlib might just decide to exit().  So we mark the offending
      console for deletion and throw to top level.  */
   if (d)
-    enqueue_magic_eval_event (io_error_delete_device, dev);
-  DEVICE_X_BEING_DELETED (d) = 1;
+    {
+      enqueue_magic_eval_event (io_error_delete_device, dev);
+      DEVICE_X_BEING_DELETED (d) = 1;
+    }
   Fthrow (Qtop_level, Qnil);
 
   return 0; /* not reached */
index 6d91c90..df67571 100644 (file)
@@ -366,10 +366,11 @@ void DGifGetExtensionNext(GifFileType *GifFile, GifByteType **Extension)
 ******************************************************************************/
 int DGifCloseFile(GifFileType *GifFile)
 {
-    GifFilePrivateType *Private = (GifFilePrivateType *)GifFile->Private;
+    GifFilePrivateType *Private;
 
     if (GifFile == NULL) return -1;
 
+    Private = (GifFilePrivateType *)GifFile->Private;
     if (!IS_READABLE(Private))
     {
        /* This file was NOT open for reading: */
@@ -930,7 +931,10 @@ ColorMapObject *MakeMapObject(int ColorCount, GifColorType *ColorMap)
 
     Object->Colors = (GifColorType *)calloc(ColorCount, sizeof(GifColorType));
     if (Object->Colors == (GifColorType *)NULL)
+      {
+       free (Object);
        return((ColorMapObject *)NULL);
+      }
 
     Object->ColorCount = ColorCount;
     Object->BitsPerPixel = BitSize(ColorCount);
index 954a27a..0ddcc6a 100644 (file)
@@ -42,7 +42,9 @@ Lisp_Object Qdialog_box_error;
 static Lisp_Object Q_initial_directory;
 static Lisp_Object Q_initial_filename;
 static Lisp_Object Q_filter_list;
+/* Declared in general-slots.h
 static Lisp_Object Q_title;
+*/
 static Lisp_Object Q_allow_multi_select;
 static Lisp_Object Q_create_prompt_on_nonexistent;
 static Lisp_Object Q_overwrite_prompt;
@@ -400,7 +402,7 @@ handle_directory_dialog_box (struct frame *f, Lisp_Object keys)
   bi.lpfn = handle_directory_proc;
 
   LOCAL_FILE_FORMAT_TO_TSTR (Fexpand_file_name (build_string (""), Qnil),
-                            (char*)pd.fname);
+                            pd.fname);
 
   {
     EXTERNAL_PROPERTY_LIST_LOOP_3 (key, value, keys)
index a6dcd2d..9b32e5a 100644 (file)
@@ -105,7 +105,7 @@ dbox_selection_callback (Widget widget, LWLIB_ID id, XtPointer client_data)
      ourselves. */
 #ifdef EXTERNAL_WIDGET
   /* #### Not sure if this special case is necessary. */
-  if (!FRAME_X_EXTERNAL_WINDOW_P (f) && f)
+  if (f && !FRAME_X_EXTERNAL_WINDOW_P (f))
 #else
   if (f)
 #endif
index ca314b9..8ad18f5 100644 (file)
@@ -644,14 +644,17 @@ On Unix it is obtained from TMPDIR, with /tmp as the default.
        }
       else
        {
-         strcpy(path, getenv("HOME")); strncat(path, "/tmp/", _POSIX_PATH_MAX);
+         path[5 + _POSIX_PATH_MAX] = '\0';
+         strncpy(path, getenv("HOME"), 5 + _POSIX_PATH_MAX);
+         strncat(path, "/tmp/", 5 + _POSIX_PATH_MAX);
          if (stat(path, &st) < 0 && errno == ENOENT)
            {
              int fd;
-             char warnpath[1+_POSIX_PATH_MAX];
+             char warnpath[6+_POSIX_PATH_MAX];
              mkdir(path, 0700);        /* ignore retvals */
-             strcpy(warnpath, path);
-             strncat(warnpath, ".created_by_xemacs", _POSIX_PATH_MAX);
+             warnpath[_POSIX_PATH_MAX] = '\0';
+             strncpy(warnpath, path, 5 + _POSIX_PATH_MAX);
+             strncat(warnpath, ".created_by_xemacs", 5 + _POSIX_PATH_MAX);
              if ((fd = open(warnpath, O_WRONLY|O_CREAT, 0644)) > 0)
                {
                  write(fd, "XEmacs created this directory because /tmp/<yourname> was unavailable -- \nPlease check !\n", 89);
index ced0424..be980e9 100644 (file)
@@ -1175,11 +1175,12 @@ detach_all_extents (Lisp_Object object)
              set_extent_start (e, -1);
              set_extent_end (e, -1);
            }
+
+         /* But we need to clear all the lists containing extents or
+            havoc will result. */
+         extent_list_delete_all (data->extents);
        }
 
-      /* But we need to clear all the lists containing extents or
-        havoc will result. */
-      extent_list_delete_all (data->extents);
       soe_invalidate (object);
     }
 }
index f2b20c3..c9bc2ae 100644 (file)
@@ -57,7 +57,13 @@ Boston, MA 02111-1307, USA.  */
 #define WIN32_FILENAMES
 #ifdef WIN32_NATIVE
 #include "nt.h"
+#include <aclapi.h>
 #endif /* WIN32_NATIVE */
+#ifdef CYGWIN
+#include <w32api/aclapi.h>
+#endif
+
+
 #define IS_DRIVE(x) isalpha (x)
 /* Need to lower-case the drive letter, or else expanded
    filenames will sometimes compare inequal, because
@@ -2267,11 +2273,81 @@ check_executable (char *filename)
 #endif /* not WIN32_NATIVE */
 }
 
+
+
 /* Return nonzero if file FILENAME exists and can be written.  */
 
 static int
 check_writable (const char *filename)
 {
+#if defined(WIN32_NATIVE) || defined(CYGWIN)
+#ifdef CYGWIN
+  char filename_buffer[PATH_MAX];
+#endif
+  // Since this has to work for a directory, we can't just call 'CreateFile'
+  PSECURITY_DESCRIPTOR pDesc; /* Must be freed with LocalFree */
+  /* these need not be freed, they point into pDesc */
+  PSID psidOwner;
+  PSID psidGroup;
+  PACL pDacl;
+  PACL pSacl;
+  /* end of insides of descriptor */
+  DWORD error;
+  DWORD attributes;
+  HANDLE tokenHandle;
+  GENERIC_MAPPING genericMapping;
+  DWORD accessMask;
+  PRIVILEGE_SET PrivilegeSet;
+  DWORD dwPrivSetSize = sizeof( PRIVILEGE_SET );
+  BOOL fAccessGranted = FALSE;
+  DWORD dwAccessAllowed;
+
+#ifdef CYGWIN
+  cygwin_conv_to_full_win32_path(filename, filename_buffer);
+  filename = filename_buffer;
+#endif
+
+  /* Win32 prototype lacks const. */
+  error = GetNamedSecurityInfo((LPTSTR)filename, SE_FILE_OBJECT, 
+                               DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION,
+                               &psidOwner, &psidGroup, &pDacl, &pSacl, &pDesc);
+  if (error != ERROR_SUCCESS) { // FAT?
+    attributes = GetFileAttributes(filename);
+    return (attributes & FILE_ATTRIBUTE_DIRECTORY) || (0 == (attributes & FILE_ATTRIBUTE_READONLY));
+  }
+
+  genericMapping.GenericRead = FILE_GENERIC_READ;
+  genericMapping.GenericWrite = FILE_GENERIC_WRITE;
+  genericMapping.GenericExecute = FILE_GENERIC_EXECUTE;
+  genericMapping.GenericAll = FILE_ALL_ACCESS;
+
+  if (!ImpersonateSelf(SecurityDelegation)) {
+    return 0;
+  }
+  if (!OpenThreadToken(GetCurrentThread(), TOKEN_ALL_ACCESS, TRUE, &tokenHandle)) {
+      return 0;
+  }
+
+  accessMask = GENERIC_WRITE;
+  MapGenericMask(&accessMask, &genericMapping);
+
+  if (!AccessCheck(pDesc, tokenHandle, accessMask, &genericMapping,
+                   &PrivilegeSet,       // receives privileges used in check
+                   &dwPrivSetSize,      // size of PrivilegeSet buffer
+                   &dwAccessAllowed,    // receives mask of allowed access rights
+                   &fAccessGranted)) 
+  {
+    DWORD oops = GetLastError();
+    CloseHandle(tokenHandle);
+    RevertToSelf();
+    LocalFree(pDesc);
+    return 0;
+  }
+  CloseHandle(tokenHandle);
+  RevertToSelf();
+  LocalFree(pDesc);
+  return fAccessGranted == TRUE;
+#else
 #ifdef HAVE_EACCESS
   return (eaccess (filename, W_OK) >= 0);
 #else
@@ -2282,6 +2358,7 @@ check_writable (const char *filename)
      but would lose for directories.  */
   return (access (filename, W_OK) >= 0);
 #endif
+#endif
 }
 
 DEFUN ("file-exists-p", Ffile_exists_p, 1, 1, 0, /*
index 34fc84f..72902aa 100644 (file)
@@ -1460,7 +1460,7 @@ in this Software without prior written authorization from the X Consortium.
 
 /* shared data for the image read/parse logic */
 static short hexTable[256];            /* conversion value */
-static int initialized = FALSE;        /* easier to fill in at run time */
+static int hex_initialized = FALSE;    /* easier to fill in at run time */
 
 /*
  *     Table index for the hex values. Initialized once, first time.
@@ -1494,7 +1494,7 @@ initHexTable (void)
     hexTable['}'] = -1;        hexTable['\n'] = -1;
     hexTable['\t'] = -1;
 
-    initialized = TRUE;
+    hex_initialized = TRUE;
 }
 
 /*
@@ -1557,7 +1557,7 @@ int read_bitmap_data (FILE* fstream, unsigned int *width,
 #define Xmalloc(size) malloc(size)
 
     /* first time initialization */
-    if (initialized == FALSE) initHexTable();
+    if (hex_initialized == FALSE) initHexTable();
 
     /* error cleanup and return macro  */
 #define        RETURN(code) { if (data) free (data); return code; }
index c3e78b4..988e594 100644 (file)
@@ -558,20 +558,20 @@ widget_query_geometry (Lisp_Object image_instance,
                                     IMAGE_INSTANCE_WIDGET_FACE (ii),
                                     &w, &h, 0, domain);
              /* Adjust the size for borders. */
-             if (IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii))
+             if (width && IMAGE_INSTANCE_SUBWINDOW_H_RESIZEP (ii))
                *width = w + 2 * widget_instance_border_width (ii);
-             if (IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii))
+             if (height && IMAGE_INSTANCE_SUBWINDOW_V_RESIZEP (ii))
                *height = h +  2 * widget_instance_border_width (ii);
            }
        }
       /* Finish off with dynamic sizing. */
-      if (!NILP (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii)))
+      if (width && !NILP (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii)))
        {
          dynamic_width = Feval (IMAGE_INSTANCE_WIDGET_WIDTH_SUBR (ii));
          if (INTP (dynamic_width))
            *width = XINT (dynamic_width);
        }
-      if (!NILP (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii)))
+      if (height && !NILP (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii)))
        {
          dynamic_height = Feval (IMAGE_INSTANCE_WIDGET_HEIGHT_SUBR (ii));
          if (INTP (dynamic_height))
index 30b3072..8a1f3ca 100644 (file)
@@ -426,13 +426,18 @@ XIM_init_frame (struct frame *f)
 void
 XIM_SetGeometry (struct frame *f)
 {
-  XIC      xic   = FRAME_X_XIC (f);
-  XIMStyle style = FRAME_X_XIC_STYLE (f);
+  XIC      xic;
+  XIMStyle style;
   XRectangle area;
 
-  if (!xic || !f)
+  if (!f)
+    return;
+
+  xic = FRAME_X_XIC (f);
+  if (!xic)
     return;
 
+  style = FRAME_X_XIC_STYLE (f);
   if (style & XIMStatusArea)
     {
       /* Place Status Area in bottom right corner */
index 101a4a8..3752f0f 100644 (file)
@@ -3663,6 +3663,8 @@ where_is_recursive_mapper (Lisp_Object map, void *arg)
              struct key_data *new = xnew_array (struct key_data, size);
              memcpy ((void *)new, (const void *)c->keys_so_far,
                      c->keys_so_far_total_size * sizeof (struct key_data));
+             xfree (c->keys_so_far);
+             c->keys_so_far = new;
            }
          else
            XREALLOC_ARRAY (c->keys_so_far, struct key_data, size);
index 608ba7b..ec1337c 100644 (file)
--- a/src/md5.c
+++ b/src/md5.c
@@ -581,7 +581,7 @@ file-coding or Mule support.  Otherwise, they are ignored.
       Bufbyte tempbuf[1024];   /* some random amount */
       Lstream_data_count size_in_bytes =
        Lstream_read (XLSTREAM (instream), tempbuf, sizeof (tempbuf));
-      if (!size_in_bytes)
+      if (size_in_bytes <= 0)
        break;
 
       /* Process the bytes.  */
index 3249218..a0a5ddb 100644 (file)
--- a/src/nas.c
+++ b/src/nas.c
@@ -751,7 +751,7 @@ SndOpenDataForReading (const char *data,
 /* Stuff taken from wave.c from NAS.  Just like snd files, NAS can't
    read wave data from memory, so these functions do that for us. */
 
-#define Err()          { return NULL; }
+#define Err()          { free (wi); return NULL; }
 #define readFourcc(_f) dread(_f, sizeof(RIFF_FOURCC), 1)
 #define cmpID(_x, _y)                                                        \
     strncmp((char *) (_x), (char *) (_y), sizeof(RIFF_FOURCC))
index fac374a..8af6692 100644 (file)
@@ -83,9 +83,11 @@ mswindows_create_scrollbar_instance (struct frame *f, int vertical,
 static void
 mswindows_free_scrollbar_instance (struct scrollbar_instance *sb)
 {
-  DestroyWindow (SCROLLBAR_MSW_HANDLE (sb));
   if (sb->scrollbar_data)
-    xfree (sb->scrollbar_data);
+    {
+      DestroyWindow (SCROLLBAR_MSW_HANDLE (sb));
+      xfree (sb->scrollbar_data);
+    }
 }
 
 static void
index 53d4c24..b7b193b 100644 (file)
@@ -71,19 +71,21 @@ x_inhibit_scrollbar_slider_size_change (void)
 static void
 x_free_scrollbar_instance (struct scrollbar_instance *instance)
 {
-  if (SCROLLBAR_X_NAME (instance))
-    xfree (SCROLLBAR_X_NAME (instance));
-
-  if (SCROLLBAR_X_WIDGET (instance))
+  if (instance->scrollbar_data)
     {
-      if (XtIsManaged (SCROLLBAR_X_WIDGET (instance)))
-       XtUnmanageChild (SCROLLBAR_X_WIDGET (instance));
+      if (SCROLLBAR_X_NAME (instance))
+       xfree (SCROLLBAR_X_NAME (instance));
 
-      lw_destroy_all_widgets (SCROLLBAR_X_ID (instance));
-    }
+      if (SCROLLBAR_X_WIDGET (instance))
+       {
+         if (XtIsManaged (SCROLLBAR_X_WIDGET (instance)))
+           XtUnmanageChild (SCROLLBAR_X_WIDGET (instance));
 
-  if (instance->scrollbar_data)
-    xfree (instance->scrollbar_data);
+         lw_destroy_all_widgets (SCROLLBAR_X_ID (instance));
+       }
+
+      xfree (instance->scrollbar_data);
+    }
 }
 
 /* A device method. */
index acb272b..ec7e9e3 100644 (file)
@@ -467,7 +467,7 @@ init_nas_sound (struct device *d)
 static void
 init_native_sound (struct device *d)
 {
-  if (DEVICE_TTY_P (d) || DEVICE_STREAM_P (d) || DEVICE_MSWINDOWS_P(d))
+  if (!(DEVICE_X_P(d) || DEVICE_GTK_P(d)))
     DEVICE_ON_CONSOLE_P (d) = 1;
 #ifdef HAVE_X_WINDOWS
   else
@@ -517,7 +517,7 @@ init_native_sound (struct device *d)
                DEVICE_ON_CONSOLE_P (d) = 0;
              else
                {
-                 char hn [255];
+                 char *hn = alloca_array (char, strlen (h->h_name) + 1);
                  struct hostent *l;
                  strcpy (hn, h->h_name);
                  l = gethostbyname (localname);
index a473bb9..9ea1717 100644 (file)
@@ -1,3 +1,18 @@
+2006-12-09  Vin Shelton  <acs@xemacs.org>
+
+       * XEmacs 21.4.20 is released
+
+2006-06-24  Stephen J. Turnbull  <stephen@xemacs.org>
+
+       * automated/test-harness.el (Silence-Message): New macro.
+       * automated/mule-tests.el: Use it.
+       * automated/region-tests.el: Use it.
+       * automated/tag-tests.el: Use it.
+
+2006-06-24  Stephen J. Turnbull  <stephen@xemacs.org>
+
+       * automated/test-harness.el: Improve handling of unexpected errors.
+
 2006-01-28  Vin Shelton  <acs@xemacs.org>
 
        * XEmacs 21.4.19 is released
index 89e5ad6..75f5d5b 100644 (file)
@@ -68,20 +68,23 @@ If FILENAME is omitted, the printname of FEATURE is used as the file name.
   (let ((tags-always-exact t))
 
     ;; Search for the tag "mystruct"; this should succeed
-    (find-tag "mystruct")
+    (Silence-Message
+     (find-tag "mystruct"))
     (Assert (eq (point) 2))
 
     ;; Search again.  The search should fail, based on the patch that
     ;; Sven Grundmann submitted for 21.4.16.
     (Check-Error-Message error "No more entries matching mystruct"
-                        (tags-loop-continue)))
+                        (Silence-Message
+                         (tags-loop-continue))))
 
   (let ((tags-always-exact nil))
 
     ;; Search for the definition of "require". Until the etags.el upgrade
     ;; from 21.5 in 21.4.16, this test would fail.
     (condition-case nil
-       (find-tag "require")
+       (Silence-Message
+        (find-tag "require"))
       (t t))
     (Assert (eq (point) 52)))
 
index 6e8d632..ac31824 100644 (file)
 ;;; Implementation-Incomplete-Expect-Failure wrapper macros to mark them.
 ;;; A lot of the tests we run push limits; suppress Ebola message with the
 ;;; Ignore-Ebola wrapper macro.
+;;; Some noisy code will call `message'.  Output from `message' can be
+;;; suppressed with the Silence-Message macro.  Functions that are known to
+;;; issue messages include `write-region', `find-tag', `tag-loop-continue',
+;;; `insert', and `mark-whole-buffer'.  N.B. The Silence-Message macro
+;;; currently does not suppress the newlines printed by `message'.
+;;; Definitely do not use Silence-Message with Check-Message.
+;;; In general it should probably only be used on code that prepares for a
+;;; test, not on tests.
 ;;; 
 ;;; You run the tests using M-x test-emacs-test-file,
 ;;; or $(EMACS) -batch -l .../test-harness.el -f batch-test-emacs file ...
 
 (require 'bytecomp)
 
+(defvar unexpected-test-suite-failures 0
+  "Cumulative number of unexpected failures since test-harness was loaded.
+
+\"Unexpected failures\" are those caught by a generic handler established
+outside of the test context.  As such they involve an abort of the test
+suite for the file being tested.
+
+They often occur during preparation of a test or recording of the results.
+For example, an executable used to generate test data might not be present
+on the system, or a system error might occur while reading a data file.")
+
+(defvar unexpected-test-suite-failure-files nil
+  "List of test files causing unexpected failures.")
+
+;; Declared for dynamic scope; _do not_ initialize here.
+(defvar unexpected-test-file-failures)
+
 (defvar test-harness-test-compiled nil
   "Non-nil means the test code was compiled before execution.")
 
@@ -134,6 +159,7 @@ The output file's name is made by appending `c' to the end of FILENAME."
          (setq body (cons (read buffer) body)))
       (end-of-file nil)
       (error
+       (incf unexpected-test-file-failures)
        (princ (format "Unexpected error %S reading forms from buffer\n"
                      error-info))))
     `(lambda ()
@@ -144,7 +170,6 @@ The output file's name is made by appending `c' to the end of FILENAME."
        (defvar missing-message-failures)
        (defvar other-failures)
 
-       (defvar unexpected-test-suite-failure)
        (defvar trick-optimizer)
 
        ,@(nreverse body))))
@@ -158,6 +183,7 @@ The output file's name is made by appending `c' to the end of FILENAME."
        (wrong-error-failures 0)
        (missing-message-failures 0)
        (other-failures 0)
+       (unexpected-test-file-failures 0)
 
        ;; #### perhaps this should be a defvar, and output at the very end
        ;; OTOH, this way AC types can use a null EMACSPACKAGEPATH to find
@@ -165,7 +191,6 @@ The output file's name is made by appending `c' to the end of FILENAME."
        (skipped-test-reasons (make-hash-table :test 'equal))
 
        (trick-optimizer nil)
-       (unexpected-test-suite-failure nil)
        (debug-on-error t)
        (pass-stream nil))
     (with-output-to-temp-buffer "*Test-Log*"
@@ -267,7 +292,7 @@ BODY is a sequence of expressions and may contain several tests."
                             ,quoted-body ',expected-error error-info)
              (incf wrong-error-failures)))))
 
-
+      ;; Do not use this with Silence-Message.
       (defmacro Check-Message (expected-message-regexp &rest body)
        (Skip-Test-Unless (fboundp 'defadvice)
                          "can't defadvice"
@@ -299,6 +324,10 @@ BODY is a sequence of expressions and may contain several tests."
                  (incf other-failures)))
               (ad-unadvise 'message)))))
 
+      ;; #### Perhaps this should override `message' itself, too?
+      (defmacro Silence-Message (&rest body)
+       `(flet ((append-message (&rest args) ())) ,@body))
+
       (defmacro Ignore-Ebola (&rest body)
        `(let ((debug-issue-ebola-notices -42)) ,@body))
 
@@ -313,7 +342,7 @@ BODY is a sequence of expressions and may contain several tests."
       (condition-case error-info
          (funcall (test-harness-read-from-buffer inbuffer))
        (error
-        (setq unexpected-test-suite-failure t)
+        (incf unexpected-test-file-failures)
         (princ (format "Unexpected error %S while executing interpreted code\n"
                error-info))
         (message "Unexpected error %S while executing interpreted code." error-info)
@@ -334,6 +363,7 @@ BODY is a sequence of expressions and may contain several tests."
        (condition-case error-info
            (if code (funcall code))
          (error
+          (incf unexpected-test-file-failures)
           (princ (format "Unexpected error %S while executing byte-compiled code\n"
                          error-info))
           (message "Unexpected error %S while executing byte-compiled code." error-info)
@@ -376,7 +406,11 @@ BODY is a sequence of expressions and may contain several tests."
              (cons (list filename passes total)
                    test-harness-file-results-alist))
        (message "%s" summary-msg))
-      (when unexpected-test-suite-failure
+      (when (> unexpected-test-file-failures 0)
+       (setq unexpected-test-suite-failure-files
+             (cons filename unexpected-test-suite-failure-files))
+       (setq unexpected-test-suite-failures
+             (+ unexpected-test-suite-failures unexpected-test-file-failures))
        (message "Test suite execution failed unexpectedly."))
       (fmakunbound 'Assert)
       (fmakunbound 'Check-Error)
@@ -503,7 +537,23 @@ For example, invoke \"xemacs -batch -f batch-test-emacs tests/*.el\""
                         (/ (* 100 nsucc) ntest))
              (message test-harness-null-summary-template
                       (concat basename ":")))
-           (setq results (cdr results))))))
+           (setq results (cdr results)))))
+      (when (> unexpected-test-suite-failures 0)
+       (message "\n***** There %s %d unexpected test suite %s in %s:"
+                (if (= unexpected-test-suite-failures 1) "was" "were")
+                unexpected-test-suite-failures
+                (if (= unexpected-test-suite-failures 1) "failure" "failures")
+                (if (= (length unexpected-test-suite-failure-files) 1)
+                    "file"
+                  "files"))
+       (while unexpected-test-suite-failure-files
+         (let ((line (pop unexpected-test-suite-failure-files)))
+           (while (and (< (length line) 61)
+                       unexpected-test-suite-failure-files)
+             (setq line
+                   (concat line " "
+                           (pop unexpected-test-suite-failure-files))))
+           (message line)))))
     (message "\nDone")
     (kill-emacs (if error 1 0))))
 
index 59eea38..22fd490 100644 (file)
@@ -2,8 +2,8 @@
 emacs_is_beta=
 emacs_major_version=21
 emacs_minor_version=4
-emacs_beta_version=19
-xemacs_codename="Constant Variable"
+emacs_beta_version=20
+xemacs_codename="Double Solitaire"
 emacs_kit_version=
 infodock_major_version=4
 infodock_minor_version=0