From xemacs-m  Fri Jan 10 17:31:35 1997
Received: from nvwls.cc.purdue.edu (root@nvwls.cc.purdue.edu [128.210.7.3])
          by xemacs.org (8.8.4/8.8.4) with ESMTP
	  id RAA25618 for <XEmacs-Beta@XEmacs.org>; Fri, 10 Jan 1997 17:31:33 -0600 (CST)
Received: from nvwls.cc.purdue.edu (nuspl@localhost [127.0.0.1]) by nvwls.cc.purdue.edu (8.7.5/8.7.3) with ESMTP id SAA07764 for <XEmacs-Beta@XEmacs.org>; Fri, 10 Jan 1997 18:24:45 -0500
Message-Id: <199701102324.SAA07764@nvwls.cc.purdue.edu>
Reply-to: nuspl@purdue.edu
X-Mailer: MH-E 5.0.2
X-Attribution: jjn
X-Face: K'Q`VIQx)c-;TPHDA`.,kBQq(WyNe3AdopJ?B(.4yT%n|F?4>+?x]pQ4XC83s-4;|U{%9x]
 =yr4dko
To: XEmacs-Beta@XEmacs.org
Subject: Sync patches (2/3)
Mime-Version: 1.0 (split by tm-edit 7.100)
Content-Type: message/partial; id="Fri_Jan_10_18:24:36_1997@nvwls.cc.purdue.edu"; number=2; total=3
Date: Fri, 10 Jan 1997 18:24:43 -0500
From: Joe Nuspl <nuspl@nvwls.cc.purdue.edu>

+                          + XSTRING_LENGTH (Vdoc_directory)
                           + 1);
-  strcpy (name, (char *) string_data (XSTRING (Vdoc_directory)));
+  strcpy (name, (char *) XSTRING_DATA (Vdoc_directory));
 #endif /* CANNOT_DUMP */
-  strcat (name, (char *) string_data (XSTRING (filename)));
+  strcat (name, (char *) XSTRING_DATA (filename));
 #ifdef VMS
 #ifndef VMS4_4
   /* For VMS versions with limited file name syntax,
@@ -824,13 +818,13 @@
     keymap = Voverriding_local_map;
 #endif
 
-  strlength = string_length (XSTRING (str));
+  strlength = XSTRING_LENGTH (str);
   bsize = strlength;
   buf = (Bufbyte *) xmalloc (bsize);
   bufp = buf;
 
   /* Have to reset strdata every time GC might be called */
-  strdata = string_data (XSTRING (str));
+  strdata = XSTRING_DATA (str);
   for (idx = 0; idx < strlength; )
     {
       Bufbyte *strp = strdata + idx;
@@ -954,7 +948,7 @@
 		*b++ = '\n';
 		sprintf (b, GETTEXT (
 		"Uses keymap \"%s\", which is not currently defined."),
-			 (char *) string_data (XSTRING (Fsymbol_name (name))));
+			 (char *) XSTRING_DATA (Fsymbol_name (name)));
 		b += strlen (b);
 		*b++ = '\n';
 		*b++ = 0;
@@ -972,8 +966,8 @@
 	    goto subst_string;
 
 	  subst_string:
-	    start = string_data (XSTRING (tem));
-	    length = string_length (XSTRING (tem));
+	    start = XSTRING_DATA (tem);
+	    length = XSTRING_LENGTH (tem);
 	  subst:
 	    bsize += length;
 	    new = (Bufbyte *) xrealloc (buf, bsize);
@@ -983,7 +977,7 @@
 	    bufp += length;
 
 	    /* Reset STRDATA in case gc relocated it.  */
-	    strdata = string_data (XSTRING (str));
+	    strdata = XSTRING_DATA (str);
 
 	    break;
 	  }
--- src/doprnt.c	1997/01/10 21:44:28	1.1
+++ src/doprnt.c	1997/01/10 21:47:19
@@ -390,8 +390,8 @@
 
   if (!NILP (format_reloc))
     {
-      format_nonreloc = string_data (XSTRING (format_reloc));
-      format_length = string_length (XSTRING (format_reloc));
+      format_nonreloc = XSTRING_DATA (format_reloc);
+      format_length = XSTRING_LENGTH (format_reloc);
     }
   if (format_length < 0)
     format_length = (Bytecount) strlen ((CONST char *) format_nonreloc);
@@ -419,7 +419,7 @@
 
       /* Copy the text before */
       if (!NILP (format_reloc)) /* refetch in case of GC below */
-	format_nonreloc = string_data (XSTRING (format_reloc));
+	format_nonreloc = XSTRING_DATA (format_reloc);
        doprnt_1 (stream, format_nonreloc + spec->text_before,
 		 spec->text_before_len, 0, -1, 0, 0);
 
--- src/editfns.c	1997/01/10 21:47:31	1.1
+++ src/editfns.c	1997/01/10 21:56:56
@@ -132,7 +132,7 @@
 	 in select(), called from getpwnam(). */
       slow_down_interrupts ();
       pw = (struct passwd *)
-	getpwnam ((char *) string_data (XSTRING (Vuser_login_name)));
+	getpwnam ((char *) XSTRING_DATA (Vuser_login_name));
       speed_up_interrupts ();
     }
   
@@ -142,18 +142,17 @@
 				     FORMAT_OS);
   
 #ifdef AMPERSAND_FULL_NAME
-  p = string_data (XSTRING (Vuser_full_name));
+  p = XSTRING_DATA (Vuser_full_name);
   q = (Bufbyte *) strchr ((char *) p, '&');
   /* Substitute the login name for the &, upcasing the first character.  */
   if (q)
     {
       char *r = (char *)
-	alloca (strlen ((char *) p) +
-                string_length (XSTRING (Vuser_login_name)) + 1);
+	alloca (strlen ((char *) p) + XSTRING_LENGTH (Vuser_login_name) + 1);
       Charcount fullname_off = bytecount_to_charcount (p,  q - p);
       memcpy (r, p, q - p);
       r[q - p] = 0;
-      strcat (r, (char *) string_data (XSTRING (Vuser_login_name)));
+      strcat (r, (char *) XSTRING_DATA (Vuser_login_name));
       strcat (r, q + 1);
       Vuser_full_name = build_string (r);
       set_string_char (XSTRING (Vuser_full_name), fullname_off,
@@ -602,9 +601,7 @@
   Lisp_Object buffer;
 {
   struct buffer *b = decode_buffer (buffer, 1);
-  if (BUF_PT (b) == BUF_BEGV (b))
-    return Qt;
-  return Qnil;
+  return BUF_PT (b) == BUF_BEGV (b) ? Qt : Qnil;
 }
 
 DEFUN ("eobp", Feobp, Seobp, 0, 1, 0 /*
@@ -616,9 +613,7 @@
   Lisp_Object buffer;
 {
   struct buffer *b = decode_buffer (buffer, 1);
-  if (BUF_PT (b) == BUF_ZV (b))
-    return Qt;
-  return Qnil;
+  return BUF_PT (b) == BUF_ZV (b) ? Qt : Qnil;
 }
 
 int
@@ -794,16 +789,15 @@
 #ifdef AMPERSAND_FULL_NAME
   if (!NILP (tem))
     {
-      p = (char *) string_data (XSTRING (tem));
+      p = (char *) XSTRING_DATA (tem);
       q = strchr (p, '&');
       /* Substitute the login name for the &, upcasing the first character.  */
       if (q)
 	{
-	  char *r = (char *) alloca (strlen (p) +
-				     string_length (XSTRING (uname)) + 1);
+	  char *r = (char *) alloca (strlen (p) + XSTRING_LENGTH (uname) + 1);
 	  memcpy (r, p, q - p);
 	  r[q - p] = 0;
-	  strcat (r, (char *) string_data (XSTRING (uname)));
+	  strcat (r, (char *) XSTRING_DATA (uname));
 	  /* #### current_buffer dependency! */
 	  r[q - p] = UPCASE (current_buffer, r[q - p]);
 	  strcat (r, q + 1);
@@ -831,7 +825,7 @@
 char *
 get_system_name (void)
 {
-  return xstrdup ((char *) string_data (XSTRING (Vsystem_name)));
+  return xstrdup ((char *) XSTRING_DATA (Vsystem_name));
 }
 
 DEFUN ("emacs-pid", Femacs_pid, Semacs_pid, 0, 0, 0 /*
@@ -985,14 +979,14 @@
     error ("Invalid time specification");
 
   /* This is probably enough.  */
-  size = string_length (XSTRING (format_string)) * 6 + 50;
+  size = XSTRING_LENGTH (format_string) * 6 + 50;
 
   while (1)
     {
       char *buf = (char *) alloca (size);
       *buf = 1;
       if (emacs_strftime (buf, size,
-			  (CONST char *) string_data (XSTRING (format_string)),
+			  (CONST char *) XSTRING_DATA (format_string),
 			  localtime (&value))
 	  || !*buf)
 	return build_ext_string (buf, FORMAT_BINARY);
@@ -1100,7 +1094,7 @@
       char **oldenv = environ, **newenv;
       
       if (STRINGP (zone))
-	tzstring = (char *) string_data (XSTRING (zone));
+	tzstring = (char *) XSTRING_DATA (zone);
       else if (INTP (zone))
 	{
 	  int abszone = abs (XINT (zone));
@@ -1293,7 +1287,7 @@
   else
     {
       CHECK_STRING (tz);
-      tzstring = (char *) string_data (XSTRING (tz));
+      tzstring = (char *) XSTRING_DATA (tz);
     }
 
   set_time_zone_rule (tzstring);
--- src/elhash.c	1997/01/10 21:57:14	1.1
+++ src/elhash.c	1997/01/10 22:01:42
@@ -198,8 +198,7 @@
   Lisp_Object str1, str2;
   CVOID_TO_LISP (str1, x1);
   CVOID_TO_LISP (str2, x2);
-  return !strcmp ((char *) string_data (XSTRING (str1)),
-		  (char *) string_data (XSTRING (str2))); 
+  return !strcmp ((char *) XSTRING_DATA (str1), (char *) XSTRING_DATA (str2));
 }
 
 unsigned long
@@ -207,8 +206,7 @@
 {
   Lisp_Object str;
   CVOID_TO_LISP (str, x);
-  return hash_string (string_data (XSTRING (str)),
-		      string_length (XSTRING (str)));
+  return hash_string (XSTRING_DATA (str), XSTRING_LENGTH (str));
 }
 
 #endif /* 0 */
@@ -861,8 +859,7 @@
 		    internal_hash (XCDR (obj), depth + 1));
     }
   else if (STRINGP (obj))
-    return hash_string (string_data (XSTRING (obj)),
-			string_length (XSTRING (obj)));
+    return hash_string (XSTRING_DATA (obj), XSTRING_LENGTH (obj));
 #ifndef LRECORD_VECTOR
   else if (VECTORP (obj))
     {
--- src/emacs.c	1997/01/10 22:01:59	1.1
+++ src/emacs.c	1997/01/10 22:10:35
@@ -43,7 +43,8 @@
 #include "sysfile.h"
 #include "systime.h"
 
-#if defined (I18N2) || defined (I18N3) || defined (I18N4)
+#if defined (HAVE_LOCALE_H) && \
+   (defined (I18N2) || defined (I18N3) || defined (I18N4))
 #include <locale.h>
 #endif
 
@@ -265,7 +266,7 @@
   /* It might be unsafe to call do_auto_save now.  */
   force_auto_save_soon ();
 }
-#endif
+#endif /* SIGDANGER */
 
 /* Code for dealing with Lisp access to the Unix command line */
 
@@ -363,7 +364,7 @@
   
   /* 19-Jun-1995 -baw
    * NeXT secret magic, ripped from Emacs-for-NS by Carl Edman
-   * <cedman@princton.edu>.  Note that even Carl doesn't know what this
+   * <cedman@princeton.edu>.  Note that even Carl doesn't know what this
    * does; it was provided by NeXT, and it presumable makes NS's mallocator
    * work with dumping.  But malloc_jumpstart() and malloc_freezedry() in
    * unexnext.c are both completely undocumented, even in NS header files!
@@ -409,14 +410,10 @@
 #ifdef LINK_CRTL_SHARE
 #ifdef SHAREABLE_LIB_BUG
   /* Bletcherous shared libraries! */
-  if (!stdin)
-    stdin = fdopen (0, "r");
-  if (!stdout)
-    stdout = fdopen (1, "w");
-  if (!stderr)
-    stderr = fdopen (2, "w");
-  if (!environ)
-    environ = envp;
+  if (!stdin)  stdin  = fdopen (0, "r");
+  if (!stdout) stdout = fdopen (1, "w");
+  if (!stderr) stderr = fdopen (2, "w");
+  if (!environ) environ = envp;
 #endif /* SHAREABLE_LIB_BUG */
 #endif /* LINK_CRTL_SHARE */
 #endif /* VMS */
@@ -1583,11 +1580,11 @@
 	   to try to make the backtrace-determination process as foolproof
 	   as possible. */
 	if (GC_STRINGP (Vinvocation_name))
-	  name = (char *) string_data (XSTRING (Vinvocation_name));
+	  name = (char *) XSTRING_DATA (Vinvocation_name);
 	else
 	  name = "xemacs";
 	if (GC_STRINGP (Vinvocation_directory))
-	  dir = (char *) string_data (XSTRING (Vinvocation_directory));
+	  dir = (char *) XSTRING_DATA (Vinvocation_directory);
 	if (!dir || dir[0] != '/')
 	  stderr_out ("`which %s`", name);
 	else if (dir[strlen (dir) - 1] != '/')
@@ -1663,7 +1660,7 @@
   memory_warnings (&my_edata, malloc_warning);
 #endif
   UNGCPRO;
-  map_out_data (string_data (XSTRING (intoname)));
+  map_out_data (XSTRING_DATA (intoname));
 
   purify_flag = opurify;
 
@@ -1703,7 +1700,7 @@
   if (!NILP (symname))
     {
       CHECK_STRING (symname);
-      if (string_length (XSTRING (symname)) > 0)
+      if (XSTRING_LENGTH (symname) > 0)
 	symname = Fexpand_file_name (symname, Qnil);
       else
 	symname = Qnil;
@@ -1721,7 +1718,7 @@
   release_breathing_space ();
 
 #ifdef VMS
-  mapout_data (string_data (XSTRING (intoname)));
+  mapout_data (XSTRING_DATA (intoname));
 #else
   /* Tell malloc where start of impure now is */
   /* Also arrange for warnings when nearly out of space.  */
@@ -1733,10 +1730,10 @@
 
 #if defined (MSDOS) && defined (EMX)
   {
-    int fd = open ((char *) string_data (XSTRING (intoname)),
+    int fd = open ((char *) XSTRING_DATA (intoname),
                    O_WRONLY|O_CREAT|O_TRUNC, S_IREAD|S_IWRITE);
     if (!fd) {
-      error ("Failure operating on %s", string_data (XSTRING (intoname)));
+      error ("Failure operating on %s", XSTRING_DATA (intoname));
     } else {
       _core (fd);
       close (fd);
--- src/energize.c	1997/01/10 22:11:22	1.1
+++ src/energize.c	1997/01/10 22:23:53
@@ -722,7 +722,7 @@
 	XSETSTRING (type, XSYMBOL (type)->name);
 
       if (STRINGP (type))
-	type_string = (char *)string_data (XSTRING (type));
+	type_string = (char *) XSTRING_DATA (type);
 
       type_string = copy_string (type_string);
 
@@ -816,7 +816,7 @@
       wchar_t *buf, t;
 
 #ifdef SANITY_CHECK
-      stderr_out ("rebuilding widechar map for %s\n", string_data (XSTRING (current_buffer->name)));
+      stderr_out ("rebuilding widechar map for %s\n", XSTRING_DATA (current_buffer->name));
 #endif
       
       /* #### this is not gonna compile.  move_gap() is now a private function
@@ -1611,8 +1611,8 @@
   /* make sure that pathname_directory ends with a '/', if it exists */
   if (!NILP (pathname_directory))
     {
-      Bufbyte *str = string_data (XSTRING (pathname_directory));
-      Bytecount size = string_length (XSTRING (pathname_directory));
+      Bufbyte *str = XSTRING_DATA (pathname_directory);
+      Bytecount size = XSTRING_LENGTH (pathname_directory);
       if (str[size - 1] != '/')
 	{
 	  Lisp_Object tmp = make_string (str, size + 1);
@@ -1669,9 +1669,8 @@
   if (!NILP (buffer_name))
     {
       if (modifying_p
-	  && strcmp ((char*)string_data (XSTRING (buffer_name)),
-		     (char*)
-		     string_data (XSTRING (XBUFFER (binfo->emacs_buffer)->name))))
+	  && strcmp ((char*) XSTRING_DATA (buffer_name),
+		     (char*) XSTRING_DATA (XBUFFER (binfo->emacs_buffer)->name)))
 	rename_the_buffer (buffer_name);
     }
 
@@ -2110,7 +2109,7 @@
   /* file name */
   file_name = current_buffer->filename;
   if (STRINGP (file_name))
-    CWriteVstring0 (conn, string_data (XSTRING (file_name)));
+    CWriteVstring0 (conn, XSTRING_DATA (file_name));
   else
     CWriteVstring0 (conn, "");
   CWriteVstring0 (conn, "");	/* directory name */
@@ -2138,9 +2137,8 @@
       Lisp_Object string = make_string_from_buffer (current_buffer,
 						    BUF_BEG (current_buffer),
 						    BUF_Z (current_buffer));
-      CNeedOutputSize (conn, string_length (XSTRING (string)) + 9);
-      CWriteVstringLen (conn, string_data (XSTRING (string)),
-			string_length (XSTRING (string)));
+      CNeedOutputSize (conn, XSTRING_LENGTH (string) + 9);
+      CWriteVstringLen (conn, XSTRING_DATA (string), XSTRING_LENGTH (string));
     }
 
   /* write the extents */
@@ -2319,8 +2317,8 @@
   if (STRINGP (selection))
     {
       conn->header->data |= CEChasCharSelection;
-      CWriteVstringLen (conn, string_data (XSTRING (selection)),
-			string_length (XSTRING (selection)));
+      CWriteVstringLen (conn, XSTRING_DATA (selection),
+			XSTRING_LENGTH (selection));
     }
   else if (VECTORP (selection))
     {
@@ -2350,8 +2348,8 @@
 	  && STRINGP (value))
 	{
 	  conn->header->data |= CEChasObjectSelection;
-	  CWriteN (conn, char, string_data (XSTRING (value)),
-		   string_length (XSTRING (value)));
+	  CWriteN (conn, char, XSTRING_DATA (value),
+		   XSTRING_LENGTH (value));
 	}
     }
   else if (!NILP (selection))
@@ -2446,7 +2444,7 @@
 
       if (!NILP (only_name))
 	{
-	  if (!strcmp ((char*) string_data (XSTRING (only_name)), name))
+	  if (!strcmp ((char*) XSTRING_DATA (only_name), name))
 	    {
 	      if (NILP (item))
 		{
@@ -2536,7 +2534,7 @@
 
   /* ignore the flags for now */
   execute_energize_menu (buffer, extent_to_data (extent_obj),
-			 (char*)string_data (XSTRING (v->contents [0])),
+			 (char*) XSTRING_DATA (v->contents [0]),
 			 lisp_to_word (v->contents [1]),
 			 XINT (v->contents [3]),
 			 selection,
@@ -2564,7 +2562,7 @@
   CHECK_STRING (command);
 
   execute_energize_menu (buffer, extent_to_data (extent_obj),
-			 (char*)string_data (XSTRING (command)), 0, 0, selection,
+			 (char*) XSTRING_DATA (command), 0, 0, selection,
 			 no_confirm);
 
   return Qt;
@@ -2693,7 +2691,7 @@
   {
     char *execname =
       (STRINGP (Vinvocation_directory))?
-	((char *) string_data (XSTRING (Vinvocation_directory))):0;
+	((char *) XSTRING_DATA (Vinvocation_directory)):0;
 
     switch (creq->type)
       {
@@ -3773,8 +3771,8 @@
 
   if (!NILP (string))
     add_in_connection_input_buffer (energize_connection->conn,
-				    (char *) string_data (XSTRING (string)),
-				    string_length (XSTRING (string)));
+				    (char *) XSTRING_DATA (string),
+				    XSTRING_LENGTH (string));
 
   return process_energize_request_1 ();
 }
@@ -3951,7 +3949,7 @@
   if (!NILP (energize_arg))
     {
       CHECK_STRING (energize_arg);
-      arg = string_data (XSTRING (energize_arg));
+      arg = XSTRING_DATA (energize_arg);
     }
   else
     arg = 0;
@@ -3959,7 +3957,7 @@
   if (!NILP (server_name))
     {
       CHECK_STRING (server_name);
-      server = string_data (XSTRING (server_name));
+      server = XSTRING_DATA (server_name);
     }
   else
     server = 0;
@@ -5088,7 +5086,7 @@
 
   data->name = "otherText";
   data->selected = 0;
-  data->value = (char *) string_data (XSTRING (other_text));
+  data->value = (char *) XSTRING_DATA (other_text);
   data->enabled = (editmode.external == 3);
   lw_modify_all_widgets (dbox_id, data, True);
 
--- src/epoch.c	1997/01/10 22:23:59	1.1
+++ src/epoch.c	1997/01/10 22:26:55
@@ -104,7 +104,7 @@
       sprintf (buf, "#<x-resource %s on ",
 	       (NILP (atom_symbol)
 		? default_string
-		: string_data (XSTRING (Fsymbol_name (atom_symbol)))));
+		: XSTRING_DATA (Fsymbol_name (atom_symbol))));
       write_c_string (buf, printcharfun);
       print_internal (device, printcharfun, escapeflag);
       sprintf (buf, " 0x%x>",(unsigned int) XX_RESOURCE (obj)->xid);
@@ -291,9 +291,9 @@
     error ("Resource must be an atom");
   xr = XX_RESOURCE (type);
 
-  xid = (XID) strtol ((CONST char *) string_data (XSTRING (string)), &ptr, b);
+  xid = (XID) strtol ((CONST char *) XSTRING_DATA (string), &ptr, b);
 
-  return ((ptr == (char *) string_data (XSTRING (string)))
+  return ((ptr == (char *) XSTRING_DATA (string))
 	  ? Qnil
 	  : make_x_resource (xid, xr->xid, xr->device));
 }
@@ -586,14 +586,14 @@
       *format = BYTESIZE * sizeof (char);
       *type = XA_STRING;
       for ( i=0, size=0 ; i < length ; ++i )
-	size += (string_length (XSTRING (v->contents[i])) +
+	size += (XSTRING_LENGTH (v->contents[i]) +
 		 1); /* include null */
       addr = (void *) xmalloc (size);
       *count = size;
       for ( i = 0 , size = 0 ; i < length ; ++i )
 	{
-	  tsize = string_length (XSTRING (v->contents[i])) + 1;
-	  memmove (((char *) addr), string_data (XSTRING (v->contents[i])),
+	  tsize = XSTRING_LENGTH (v->contents[i]) + 1;
+	  memmove (((char *) addr), XSTRING_DATA (v->contents[i]),
 		   tsize);
 	  size += tsize;
 	}
@@ -656,15 +656,15 @@
       *format = BYTESIZE * sizeof (char);
       *type = XA_STRING;
       for ( i=0, size=0 , tlist=list ; i < length ; ++i, tlist = Fcdr (tlist) )
-	size += string_length (XSTRING (Fcar (tlist))) + 1; /* include null */
+	size += XSTRING_LENGTH (Fcar (tlist)) + 1; /* include null */
       addr = (void *) xmalloc (size);
       *count = size;
       for ( i=0, size=0, tlist=list ; i < length  ;
 	   ++i , tlist = Fcdr (tlist) )
 	{
 	  temp = Fcar (tlist);
-	  tsize = string_length (XSTRING (temp)) + 1;
-	  memmove (((char *) addr), string_data (XSTRING (temp)), tsize);
+	  tsize = XSTRING_LENGTH (temp) + 1;
+	  memmove (((char *) addr), XSTRING_DATA (temp), tsize);
 	  size += tsize;
 	}
       break;
@@ -692,8 +692,8 @@
     case Lisp_String:
       *format = BYTESIZE;
       *type = XA_STRING;
-      *count = strlen ((CONST char *) string_data (XSTRING (value))) + 1;
-      *addr = (void *) string_data (XSTRING (value));
+      *count = strlen ((CONST char *) XSTRING_DATA (value)) + 1;
+      *addr = (void *) XSTRING_DATA (value);
       break;
 
     case Lisp_Int:
--- src/event-Xt.c	1997/01/10 22:27:50	1.1
+++ src/event-Xt.c	1997/01/10 22:28:16
@@ -1700,7 +1700,7 @@
   f = x_any_window_to_frame (get_device_from_display (display), window);
   if (f) {
     char buf[500];
-    sprintf (buf, " \"%s\"", string_data (XSTRING (f->name)));
+    sprintf (buf, " \"%s\"", XSTRING_DATA (f->name));
     write_string_to_stdio_stream (stderr, 0, (Bufbyte *) buf, 0, strlen (buf),
                                   FORMAT_DISPLAY);
   }
--- src/event-stream.c	1997/01/10 22:30:26	1.1
+++ src/event-stream.c	1997/01/10 22:31:54
@@ -823,7 +823,7 @@
   command_builder->echo_buf_index = buf_index;
   if (buf_index > 0)
     memcpy (command_builder->echo_buf,
-            string_data (XSTRING (echo)), buf_index + 1); /* terminating 0 */
+            XSTRING_DATA (echo), buf_index + 1); /* terminating 0 */
   UNGCPRO;
 }
 
@@ -1994,10 +1994,10 @@
       Bytecount len;
       CHECK_STRING (prompt);
 
-      len = string_length (XSTRING (prompt));
+      len = XSTRING_LENGTH (prompt);
       if (command_builder->echo_buf_length < len)
 	len = command_builder->echo_buf_length - 1;
-      memcpy (command_builder->echo_buf, string_data (XSTRING (prompt)), len);
+      memcpy (command_builder->echo_buf, XSTRING_DATA (prompt), len);
       command_builder->echo_buf[len] = 0;
       command_builder->echo_buf_index = len;
       echo_area_message (XFRAME (CONSOLE_SELECTED_FRAME (con)),
@@ -3391,12 +3391,12 @@
 	  {
 	    /* Append keymap prompt to key echo buffer */
 	    int buf_index = command_builder->echo_buf_index;
-	    Bytecount len = string_length (XSTRING (prompt));
+	    Bytecount len = XSTRING_LENGTH (prompt);
 
 	    if (len + buf_index + 1 <= command_builder->echo_buf_length)
 	      {
 		Bufbyte *echo = command_builder->echo_buf + buf_index;
-		memcpy (echo, string_data (XSTRING (prompt)), len);
+		memcpy (echo, XSTRING_DATA (prompt), len);
 		echo[len] = 0;
 	      }
 	    maybe_echo_keys (command_builder, 1);
@@ -4036,7 +4036,7 @@
       int fd;
 
       file = Fexpand_file_name (file, Qnil);
-      fd = creat ((char *) string_data (XSTRING (file)), 0666);
+      fd = creat ((char *) XSTRING_DATA (file), 0666);
       if (fd < 0)
 	error ("Unable to create dribble file");
       Vdribble_file = make_filedesc_output_stream (fd, 0, 0, LSTR_CLOSING);
--- src/extents.c	1997/01/10 19:53:03	1.1
+++ src/extents.c	1997/01/10 19:56:01
@@ -1968,8 +1968,10 @@
       assert (!extent_detached_p (after));
     }
 
-  if (!buffer_or_string_extent_list (obj))
+  el = buffer_or_string_extent_list (obj);
+  if (!el || !extent_list_num_els(el))
     return;
+  el = 0;
 
   st = buffer_or_string_bytind_to_memind (obj, from);
   en = buffer_or_string_bytind_to_memind (obj, to);
@@ -2315,8 +2317,9 @@
 #endif
   el = buffer_or_string_extent_list (obj);
 
-  if (!el)
+  if (!el || !extent_list_num_els(el))
     return;
+
   /* IMPORTANT! Compute the starting positions of the extents to
      modify BEFORE doing any modification!  Otherwise the starting
      position for the second time through the loop might get
@@ -2516,7 +2519,7 @@
     buffer_or_string_absolute_end_byte (obj) :
       buffer_or_string_accessible_end_byte (obj);
 
-  if (!bel)
+  if (!bel || !extent_list_num_els(bel))
     return limit;
 
   sel = buffer_or_string_stack_of_extents_force (obj)->extents;
@@ -2556,7 +2559,7 @@
     buffer_or_string_absolute_begin_byte (obj) :
       buffer_or_string_accessible_begin_byte (obj);
 
-  if (!bel)
+  if (!bel || !extent_list_num_els(bel))
     return limit;
 
   sel = buffer_or_string_stack_of_extents_force (obj)->extents;
@@ -3008,7 +3011,7 @@
 	  if (BUFFER_LIVE_P (XBUFFER (obj2)))
 	    {
 	      title = "buffer ";
-	      name = (char *) string_data (XSTRING (XBUFFER (obj2)->name));
+	      name = (char *) XSTRING_DATA (XBUFFER (obj2)->name);
 	    }
 	  else
 	    {
@@ -3021,7 +3024,7 @@
 	  assert (STRINGP (obj2));
 	  title = "string \"";
 	  posttitle = "\"";
-	  name = (char *) string_data (XSTRING (obj2));
+	  name = (char *) XSTRING_DATA (obj2);
 	}
       
       if (print_readably)
--- src/filelock.c	1997/01/10 22:33:00	1.1
+++ src/filelock.c	1997/01/10 22:44:58
@@ -69,9 +69,8 @@
 
 #ifndef HAVE_LONG_FILE_NAMES
 
-#define MAKE_LOCK_NAME(lock, file)					    \
-  (lock = (char *) alloca (14 + string_length (XSTRING (Vlock_directory)) + \
-			   1),						    \
+#define MAKE_LOCK_NAME(lock, file)					\
+  (lock = (char *) alloca (14 + XSTRING_LENGTH (Vlock_directory) + 1),	\
    fill_in_lock_short_file_name (lock, (file)))
 
 static void
@@ -91,7 +90,7 @@
 
   crc.word[0] = crc.word[1] = 0;
 
-  for (p = string_data (XSTRING (fn)); new = *p++; )
+  for (p = XSTRING_DATA (fn); new = *p++; )
     {
       new += crc.byte[6];
       crc.byte[6] = crc.byte[5] + new;
@@ -107,12 +106,12 @@
     int need_slash = 0;
 
     /* in case lock-directory doesn't end in / */
-    if (string_byte (XSTRING (Vlock_directory),
-		     string_length (XSTRING (Vlock_directory)) - 1) != '/')
+    if (XSTRING_BYTE (Vlock_directory,
+		     XSTRING_LENGTH (Vlock_directory) - 1) != '/')
       need_slash = 1;
 
     sprintf (lockfile, "%s%s%.2x%.2x%.2x%.2x%.2x%.2x%.2x",
-	     (char *) string_data (XSTRING (Vlock_directory)),
+	     (char *) XSTRING_DATA (Vlock_directory),
 	     need_slash ? "/" : "",
 	     crc.byte[0], crc.byte[1], crc.byte[2], crc.byte[3],
 	     crc.byte[4], crc.byte[5], crc.byte[6]);
@@ -122,9 +121,9 @@
 #else /* defined HAVE_LONG_FILE_NAMES */
 
 /* +2 for terminating null and possible extra slash */
-#define MAKE_LOCK_NAME(lock, file)					   \
-  (lock = (char *) alloca (string_length (XSTRING (file)) +		   \
-			   string_length (XSTRING (Vlock_directory)) + 2), \
+#define MAKE_LOCK_NAME(lock, file)					\
+  (lock = (char *) alloca (XSTRING_LENGTH (file) +			\
+			   XSTRING_LENGTH (Vlock_directory) + 2),	\
    fill_in_lock_file_name (lock, (file)))
 
 static void
@@ -135,7 +134,7 @@
 
   CHECK_STRING (Vlock_directory);
 
-  strcpy (lockfile, (char *) string_data (XSTRING (Vlock_directory)));
+  strcpy (lockfile, (char *) XSTRING_DATA (Vlock_directory));
 
   p = lockfile + strlen (lockfile);
 
@@ -146,7 +145,7 @@
       p++;
     }
 
-  strcpy (p, (char *) string_data (XSTRING (fn)));
+  strcpy (p, (char *) XSTRING_DATA (fn));
 
   for (; *p; p++)
     {
@@ -239,7 +238,7 @@
       CHECK_STRING (Vsuperlock_file);
       lock_superlock (lfname);
       lock_file_1 (lfname, O_WRONLY);
-      unlink ((char *) string_data (XSTRING (Vsuperlock_file)));
+      unlink ((char *) XSTRING_DATA (Vsuperlock_file));
       goto done;
     }
   /* User says ignore the lock */
@@ -351,7 +350,7 @@
   if (current_lock_owner_1 (lfname) == getpid ())
     unlink (lfname);
 
-  unlink ((char *) string_data (XSTRING (Vsuperlock_file)));
+  unlink ((char *) XSTRING_DATA (Vsuperlock_file));
 }
 
 static void
@@ -361,7 +360,7 @@
   DIR *lockdir;
 
   for (i = -20; i < 0 &&
-       (fd = open ((char *) string_data (XSTRING (Vsuperlock_file)),
+       (fd = open ((char *) XSTRING_DATA (Vsuperlock_file),
 		   O_WRONLY | O_EXCL | O_CREAT, 0666)) < 0;
        i++)
     {
@@ -371,7 +370,7 @@
       /* This seems to be necessary to prevent Emacs from hanging when the
 	 competing process has already deleted the superlock, but it's still
 	 in the NFS cache.  So we force NFS to synchronize the cache.  */
-      lockdir = opendir ((char *) string_data (XSTRING (Vlock_directory)));
+      lockdir = opendir ((char *) XSTRING_DATA (Vlock_directory));
       if (lockdir)
 	closedir (lockdir);
 
@@ -380,7 +379,7 @@
   if (fd >= 0)
     {
 #ifdef USG
-      chmod ((char *) string_data (XSTRING (Vsuperlock_file)), 0666);
+      chmod ((char *) XSTRING_DATA (Vsuperlock_file), 0666);
 #else
       fchmod (fd, 0666);
 #endif
--- src/fns.c	1997/01/10 22:45:28	1.1
+++ src/fns.c	1997/01/10 22:49:20
@@ -288,9 +288,9 @@
   CHECK_STRING (s1);
   CHECK_STRING (s2);
 
-  len = string_length (XSTRING (s1));
-  if (len != string_length (XSTRING (s2)) ||
-      memcmp (string_data (XSTRING (s1)), string_data (XSTRING (s2)), len))
+  len = XSTRING_LENGTH (s1);
+  if (len != XSTRING_LENGTH (s2) ||
+      memcmp (XSTRING_DATA (s1), XSTRING_DATA (s2), len))
     return Qnil;
   return Qt;
 }
@@ -696,7 +696,7 @@
 #endif
 	}
       if (STRINGP (seq))
-	string_source_ptr = string_data (XSTRING (seq));
+	string_source_ptr = XSTRING_DATA (seq);
 
       while (1)
 	{
@@ -870,9 +870,9 @@
   CHECK_INT (from);
   get_string_range_char (string, from, to, &ccfr, &ccto,
 			 GB_HISTORICAL_STRING_BEHAVIOR);
-  bfr = charcount_to_bytecount (string_data (XSTRING (string)), ccfr);
-  bto = charcount_to_bytecount (string_data (XSTRING (string)), ccto);
-  val = make_string (string_data (XSTRING (string)) + bfr, bto - bfr);
+  bfr = charcount_to_bytecount (XSTRING_DATA (string), ccfr);
+  bto = charcount_to_bytecount (XSTRING_DATA (string), ccto);
+  val = make_string (XSTRING_DATA (string) + bfr, bto - bfr);
   /* Copy any applicable extent information into the new string: */
   copy_string_extents (val, string, 0, bfr, bto - bfr);
   return (val);
@@ -2793,10 +2793,10 @@
 #endif /* !LRECORD_VECTOR */
   else if (STRINGP (o1))
     {
-      Bytecount len = string_length (XSTRING (o1));
-      if (len != string_length (XSTRING (o2)))
+      Bytecount len = XSTRING_LENGTH (o1);
+      if (len != XSTRING_LENGTH (o2))
 	return (0);
-      if (memcmp (string_data (XSTRING (o1)), string_data (XSTRING (o2)), len))
+      if (memcmp (XSTRING_DATA (o1), XSTRING_DATA (o2), len))
 	return (0);
       return (1);
     }
--- src/frame-x.c	1997/01/10 22:51:46	1.1
+++ src/frame-x.c	1997/01/10 22:55:22
@@ -713,7 +713,7 @@
 	{
 	  CONST char *extprop;
 	  
-	  if (string_length (XSTRING (prop)) == 0)
+	  if (XSTRING_LENGTH (prop) == 0)
 	    continue;
 
 	  GET_C_STRING_CTEXT_DATA_ALLOCA (prop, extprop);
@@ -763,14 +763,14 @@
 
 	  /* Kludge the width/height so that we interpret them in characters
 	     instead of pixels.  Yuck yuck yuck. */
-	  if (!strcmp ((char *) string_data (XSTRING (str)), "width"))
+	  if (!strcmp ((char *) XSTRING_DATA (str), "width"))
 	    {
 	      CHECK_INT (val);
 	      width = XINT (val);
 	      width_specified_p = True;
 	      continue;
 	    }
-	  if (!strcmp ((char *) string_data (XSTRING (str)), "height"))
+	  if (!strcmp ((char *) XSTRING_DATA (str), "height"))
 	    {
 	      CHECK_INT (val);
 	      height = XINT (val);
@@ -778,14 +778,14 @@
 	      continue;
 	    }
 	  /* Further kludge the x/y. */
-	  if (!strcmp ((char *) string_data (XSTRING (str)), "x"))
+	  if (!strcmp ((char *) XSTRING_DATA (str), "x"))
 	    {
 	      CHECK_INT (val);
 	      x = XINT (val);
 	      x_position_specified_p = True;
 	      continue;
 	    }
-	  if (!strcmp ((char *) string_data (XSTRING (str)), "y"))
+	  if (!strcmp ((char *) XSTRING_DATA (str), "y"))
 	    {
 	      CHECK_INT (val);
 	      y = XINT (val);
@@ -794,7 +794,7 @@
 	    }
 	  /* Have you figured out by now that this entire function is
              one gigantic kludge? */
-	  if (!strcmp ((char *) string_data (XSTRING (str)),
+	  if (!strcmp ((char *) XSTRING_DATA (str),
 		       "internalBorderWidth"))
 	    {
 	      internal_border_width_specified = True;
@@ -803,19 +803,19 @@
 	  if (int_p)
 	    {
 	      CHECK_INT (val);
-	      XtVaSetValues (w, (char *) string_data (XSTRING (str)),
+	      XtVaSetValues (w, (char *) XSTRING_DATA (str),
 			     XINT (val), 0);
 	    }
 	  else if (EQ (val, Qt))
 	    XtVaSetValues (w,
 			   /* XtN... */
-			   (char *) string_data (XSTRING (str)),
+			   (char *) XSTRING_DATA (str),
 			   True,
 			   0);
 	  else if (EQ (val, Qnil))
 	    XtVaSetValues (w,
 			   /* XtN... */
-			   (char *) string_data (XSTRING (str)),
+			   (char *) XSTRING_DATA (str),
 			   False,
 			   0);
 	  else
@@ -823,16 +823,16 @@
 	      CHECK_STRING (val);
 	      XtVaSetValues (w, XtVaTypedArg,
 			     /* XtN... */
-			     (char *) string_data (XSTRING (str)),
+			     (char *) XSTRING_DATA (str),
 			     XtRString,
-			     string_data (XSTRING (val)),
-			     string_length (XSTRING (val)) + 1,
+			     XSTRING_DATA (val),
+			     XSTRING_LENGTH (val) + 1,
 			     0);
 	    }
 
 #ifdef HAVE_SCROLLBARS
-	  if (!strcmp ((char *) string_data (XSTRING (str)), "scrollBarWidth")
-	      || !strcmp ((char *) string_data (XSTRING (str)),
+	  if (!strcmp ((char *) XSTRING_DATA (str), "scrollBarWidth")
+	      || !strcmp ((char *) XSTRING_DATA (str),
 			  "scrollBarHeight"))
 	    {
 	      x_update_frame_scrollbars (f);
@@ -1491,7 +1491,7 @@
       char *string;
 
       CHECK_STRING (lisp_window_id);
-      string = (char *) (string_data (XSTRING (lisp_window_id)));
+      string = (char *) XSTRING_DATA (lisp_window_id);
       if (string[0] == '0' && (string[1] == 'x' || string[1] == 'X'))
 	sscanf (string+2, "%lxu", &window_id);
 #if 0
--- src/glyphs-x.c	1997/01/10 22:57:07	1.1
+++ src/glyphs-x.c	1997/01/10 23:00:22
@@ -276,11 +276,11 @@
   /* Check non-absolute pathnames with a directory component relative to
      the search path; that's the way Xt does it. */
   /* #### Unix-specific */
-  if (string_byte (XSTRING (name), 0) == '/' ||
-      (string_byte (XSTRING (name), 0) == '.' &&
-       (string_byte (XSTRING (name), 1) == '/' ||
-	(string_byte (XSTRING (name), 1) == '.' &&
-	 (string_byte (XSTRING (name), 2) == '/')))))
+  if (XSTRING_BYTE (name, 0) == '/' ||
+      (XSTRING_BYTE (name, 0) == '.' &&
+       (XSTRING_BYTE (name, 1) == '/' ||
+	(XSTRING_BYTE (name, 1) == '.' &&
+	 (XSTRING_BYTE (name, 2) == '/')))))
     {
       if (!NILP (Ffile_readable_p (name)))
 	return name;
@@ -300,7 +300,7 @@
     char *path = egetenv ("XBMLANGPATH");
     SubstitutionRec subs[1];
     subs[0].match = 'B';
-    subs[0].substitution = (char *) string_data (XSTRING (name));
+    subs[0].substitution = (char *) XSTRING_DATA (name);
     /* #### Motif uses a big hairy default if $XBMLANGPATH isn't set.
        We don't.  If you want it used, set it. */
     if (path &&
@@ -2297,7 +2297,7 @@
   char **data;
   int result;
 
-  result = XpmReadFileToData ((char *) string_data (XSTRING (name)), &data);
+  result = XpmReadFileToData ((char *) XSTRING_DATA (name), &data);
 
   if (result == XpmSuccess)
     {
@@ -2541,7 +2541,7 @@
       if (! XAllocColor (dpy, cmap, &color))
 	abort ();  /* it must be allocable since we're just duplicating it */
 
-      symbols [i].name = (char *) string_data (XSTRING (XCAR (cons)));
+      symbols [i].name = (char *) XSTRING_DATA (XCAR (cons));

