diff src/lisp.h @ 793:e38acbeb1cae

[xemacs-hg @ 2002-03-29 04:46:17 by ben] lots o' fixes etc/ChangeLog: New file. Separated out all entries for etc/ into their own ChangeLog. Includes entries for the following files: etc/BABYL, etc/BETA, etc/CHARSETS, etc/DISTRIB, etc/Emacs.ad, etc/FTP, etc/GNUS-NEWS, etc/GOATS, etc/HELLO, etc/INSTALL, etc/MACHINES, etc/MAILINGLISTS, etc/MSDOS, etc/MYTHOLOGY, etc/NEWS, etc/OXYMORONS, etc/PACKAGES, etc/README, etc/TUTORIAL, etc/TUTORIAL.de, etc/TUTORIAL.ja, etc/TUTORIAL.ko, etc/TUTORIAL.se, etc/aliases.ksh, etc/altrasoft-logo.xpm, etc/check_cygwin_setup.sh, etc/custom/example-themes/europe-theme.el, etc/custom/example-themes/ex-custom-file, etc/custom/example-themes/example-theme.el, etc/e/eterm.ti, etc/edt-user.doc, etc/enriched.doc, etc/etags.1, etc/gnuserv.1, etc/gnuserv.README, etc/package-index.LATEST.gpg, etc/package-index.LATEST.pgp, etc/photos/jan.png, etc/recycle.xpm, etc/refcard.tex, etc/sample.Xdefaults, etc/sample.emacs, etc/sgml/CATALOG, etc/sgml/HTML32.dtd, etc/skk/SKK.tut.E, etc/smilies/Face_ase.xbm, etc/smilies/Face_ase2.xbm, etc/smilies/Face_ase3.xbm, etc/smilies/Face_smile.xbm, etc/smilies/Face_weep.xbm, etc/sounds, etc/toolbar, etc/toolbar/workshop-cap-up.xpm, etc/xemacs-ja.1, etc/xemacs.1, etc/yow.lines, etc\BETA, etc\NEWS, etc\README, etc\TUTORIAL, etc\TUTORIAL.de, etc\check_cygwin_setup.sh, etc\sample.init.el, etc\unicode\README, etc\unicode\mule-ucs\*, etc\unicode\other\* unicode/unicode-consortium/8859-16.TXT: New file. mule/english.el: Define this charset now, since a bug was fixed that formerly prevented it. mule/ethio-util.el: Fix compile errors involving Unicode `characters', which should be integers. Makefile.in.in: Always include gui.c, to fix compile error when TTY-only. EmacsFrame.c, abbrev.c, alloc.c, buffer.c, buffer.h, bytecode.c, bytecode.h, callint.c, callproc.c, casetab.c, casetab.h, charset.h, chartab.c, chartab.h, cmds.c, console-msw.c, console-msw.h, console-tty.c, console-x.c, console-x.h, console.c, console.h, data.c, database.c, device-gtk.c, device-msw.c, device-x.c, device.c, device.h, dialog-msw.c, doc.c, doprnt.c, dumper.c, dynarr.c, editfns.c, eldap.c, eldap.h, elhash.c, elhash.h, emacs.c, eval.c, event-Xt.c, event-gtk.c, event-msw.c, event-stream.c, event-tty.c, event-unixoid.c, events.c, events.h, extents.c, extents.h, faces.c, faces.h, file-coding.c, file-coding.h, fileio.c, filelock.c, fns.c, frame-gtk.c, frame-msw.c, frame-tty.c, frame-x.c, frame.c, frame.h, free-hook.c, general-slots.h, glyphs-eimage.c, glyphs-gtk.c, glyphs-msw.c, glyphs-widget.c, glyphs-x.c, glyphs.c, glyphs.h, gpmevent.c, gtk-xemacs.c, gui-msw.c, gui-x.c, gui-x.h, gui.c, gui.h, gutter.c, gutter.h, indent.c, input-method-xlib.c, insdel.c, keymap.c, keymap.h, lisp-disunion.h, lisp-union.h, lisp.h, lread.c, lrecord.h, lstream.c, lstream.h, marker.c, menubar-gtk.c, menubar-msw.c, menubar-x.c, menubar.c, minibuf.c, mule-canna.c, mule-ccl.c, mule-charset.c, mule-wnnfns.c, native-gtk-toolbar.c, objects-msw.c, objects-tty.c, objects-x.c, objects.c, objects.h, opaque.c, opaque.h, postgresql.c, postgresql.h, print.c, process-unix.c, process.c, process.h, rangetab.c, rangetab.h, redisplay-gtk.c, redisplay-msw.c, redisplay-output.c, redisplay-tty.c, redisplay-x.c, redisplay.c, scrollbar-gtk.c, scrollbar-msw.c, scrollbar-x.c, scrollbar.c, scrollbar.h, search.c, select-gtk.c, select-x.c, sound.c, specifier.c, specifier.h, strftime.c, symbols.c, symeval.h, syntax.h, text.c, text.h, toolbar-common.c, toolbar-msw.c, toolbar.c, toolbar.h, tooltalk.c, tooltalk.h, ui-gtk.c, ui-gtk.h, undo.c, vm-limit.c, window.c, window.h: Eliminate XSETFOO. Replace all usages with wrap_foo(). Make symbol->name a Lisp_Object, not Lisp_String *. Eliminate nearly all uses of Lisp_String * in favor of Lisp_Object, and correct macros so most of them favor Lisp_Object. Create new error-behavior ERROR_ME_DEBUG_WARN -- output warnings, but at level `debug' (usually ignored). Use it when instantiating specifiers, so problems can be debugged. Move log-warning-minimum-level into C so that we can optimize ERROR_ME_DEBUG_WARN. Fix warning levels consistent with new definitions. Add default_ and parent fields to char table; not yet implemented. New fun Dynarr_verify(); use for further error checking on Dynarrs. Rearrange code at top of lisp.h in conjunction with dynarr changes. Fix eifree(). Use Eistrings in various places (format_event_object(), where_is_to_char(), and callers thereof) to avoid fixed-size strings buffers. New fun write_eistring(). Reindent and fix GPM code to follow standards. Set default MS Windows font to Lucida Console (same size as Courier New but less interline spacing, so more lines fit). Increase default frame size on Windows to 50 lines. (If that's too big for the workspace, the frame will be shrunk as necessary.) Fix problem with text files with no newlines (). (Change `convert-eol' coding system to use `nil' for autodetect, consistent with make-coding-system.) Correct compile warnings in vm-limit.c. Fix handling of reverse-direction charsets to avoid errors when opening (e.g.) mule-ucs/lisp/reldata/uiso8859-6.el. Recode some object printing methods to use write_fmt_string() instead of a fixed buffer and sprintf. Turn on display of png comments as warnings (level `info'), now that they're unobtrusive. Revamped the sound documentation. Fixed bug in redisplay w.r.t. hscroll/truncation/continuation glyphs causing jumping up and down of the lines, since they're bigger than the line size. (It was seen most obviously when there's a horizontal scroll bar, e.g. do C-h a glyph or something like that.) The problem was that the glyph-contrib-p setting on glyphs was ignored even if it was set properly, which it wasn't until now.
author ben
date Fri, 29 Mar 2002 04:49:13 +0000
parents 026c5bf9c134
children a5954632b187
line wrap: on
line diff
--- a/src/lisp.h	Sat Mar 23 05:08:52 2002 +0000
+++ b/src/lisp.h	Fri Mar 29 04:49:13 2002 +0000
@@ -175,74 +175,7 @@
 typedef unsigned long uintptr_t;
 #endif
 
-/* ------------------------ dynamic arrays ------------------- */
-
-#define Dynarr_declare(type)	\
-  type *base;			\
-  int elsize;			\
-  int cur;			\
-  int largest;			\
-  int max
-
-typedef struct dynarr
-{
-  Dynarr_declare (void);
-} Dynarr;
-
-void *Dynarr_newf (int elsize);
-void Dynarr_resize (void *dy, int size);
-void Dynarr_insert_many (void *d, const void *el, int len, int start);
-void Dynarr_delete_many (void *d, int start, int len);
-void Dynarr_free (void *d);
-
-#define Dynarr_new(type) ((type##_dynarr *) Dynarr_newf (sizeof (type)))
-#define Dynarr_new2(dynarr_type, type) \
-  ((dynarr_type *) Dynarr_newf (sizeof (type)))
-#define Dynarr_at(d, pos) ((d)->base[pos])
-#define Dynarr_atp(d, pos) (&Dynarr_at (d, pos))
-#define Dynarr_begin(d) Dynarr_atp (d, 0)
-#define Dynarr_end(d) Dynarr_atp (d, Dynarr_length (d))
-#define Dynarr_sizeof(d) ((d)->cur * (d)->elsize)
-#define Dynarr_length(d) ((d)->cur)
-#define Dynarr_largest(d) ((d)->largest)
-#define Dynarr_reset(d) ((d)->cur = 0)
-#define Dynarr_add_many(d, el, len) Dynarr_insert_many (d, el, len, (d)->cur)
-#define Dynarr_insert_many_at_start(d, el, len)	\
-  Dynarr_insert_many (d, el, len, 0)
-#define Dynarr_add_literal_string(d, s) Dynarr_add_many (d, s, sizeof (s) - 1)
-#define Dynarr_add_lisp_string(d, s, codesys)		\
-do {							\
-  Lisp_Object dyna_ls_s = (s);				\
-  Lisp_Object dyna_ls_cs = (codesys);			\
-  Extbyte *dyna_ls_eb;					\
-  Bytecount dyna_ls_bc;					\
-							\
-  TO_EXTERNAL_FORMAT (LISP_STRING, dyna_ls_s,		\
-                      ALLOCA, (dyna_ls_eb, dyna_ls_bc),	\
-		      dyna_ls_cs);			\
-  Dynarr_add_many (d, dyna_ls_eb, dyna_ls_bc);		\
-} while (0)
-
-#define Dynarr_add(d, el) (						\
-  (d)->cur >= (d)->max ? Dynarr_resize ((d), (d)->cur+1) : (void) 0,	\
-  ((d)->base)[(d)->cur++] = (el),					\
-  (d)->cur > (d)->largest ? (d)->largest = (d)->cur : (int) 0)
-
-/* The following defines will get you into real trouble if you aren't
-   careful.  But they can save a lot of execution time when used wisely. */
-#define Dynarr_increment(d) ((d)->cur++)
-#define Dynarr_set_size(d, n) ((d)->cur = n)
-
-#define Dynarr_pop(d) \
-  (assert ((d)->cur > 0), (d)->cur--, Dynarr_at (d, (d)->cur))
-#define Dynarr_delete(d, i) Dynarr_delete_many (d, i, len)
-#define Dynarr_delete_by_pointer(d, p) \
-  Dynarr_delete_many (d, (p) - ((d)->base), 1)
-
-#ifdef MEMORY_USAGE_STATS
-struct overhead_stats;
-Bytecount Dynarr_memory_usage (void *d, struct overhead_stats *stats);
-#endif
+/* ------------------------ basic compiler defines ------------------- */
 
 /* Also define min() and max(). (Some compilers put them in strange
    places that won't be referenced by the above include files, such
@@ -255,54 +188,6 @@
 #define max(a,b) (((a) > (b)) ? (a) : (b))
 #endif
 
-/* Memory allocation */
-void malloc_warning (const char *);
-void *xmalloc (Bytecount size);
-void *xmalloc_and_zero (Bytecount size);
-void *xrealloc (void *, Bytecount size);
-char *xstrdup (const char *);
-/* generally useful */
-#define countof(x) ((int) (sizeof(x)/sizeof((x)[0])))
-#define xnew(type) ((type *) xmalloc (sizeof (type)))
-#define xnew_array(type, len) ((type *) xmalloc ((len) * sizeof (type)))
-#define xnew_and_zero(type) ((type *) xmalloc_and_zero (sizeof (type)))
-#define xzero(lvalue) ((void) memset (&(lvalue), '\0', sizeof (lvalue)))
-#define xnew_array_and_zero(type, len) ((type *) xmalloc_and_zero ((len) * sizeof (type)))
-#define XREALLOC_ARRAY(ptr, type, len) ((void) (ptr = (type *) xrealloc (ptr, (len) * sizeof (type))))
-#define alloca_new(type) ((type *) alloca (sizeof (type)))
-#define alloca_array(type, len) ((type *) alloca ((len) * sizeof (type)))
-
-/* also generally useful if you want to avoid arbitrary size limits
-   but don't need a full dynamic array.  Assumes that BASEVAR points
-   to a malloced array of TYPE objects (or possibly a NULL pointer,
-   if SIZEVAR is 0), with the total size stored in SIZEVAR.  This
-   macro will realloc BASEVAR as necessary so that it can hold at
-   least NEEDED_SIZE objects.  The reallocing is done by doubling,
-   which ensures constant amortized time per element. */
-#define DO_REALLOC(basevar, sizevar, needed_size, type)	do {	\
-  Bytecount do_realloc_needed_size = (needed_size);		\
-  if ((sizevar) < do_realloc_needed_size)			\
-    {								\
-      if ((sizevar) < 32)					\
-	(sizevar) = 32;						\
-      while ((sizevar) < do_realloc_needed_size)		\
-	(sizevar) *= 2;						\
-      XREALLOC_ARRAY (basevar, type, (sizevar));		\
-    }								\
-} while (0)
-
-#ifdef ERROR_CHECK_MALLOC
-void xfree_1 (void *);
-#define xfree(lvalue) do			\
-{						\
-  void **xfree_ptr = (void **) &(lvalue);	\
-  xfree_1 (*xfree_ptr);				\
-  *xfree_ptr = (void *) 0xDEADBEEF;		\
-} while (0)
-#else
-void xfree (void *);
-#endif /* ERROR_CHECK_MALLOC */
-
 #ifndef PRINTF_ARGS
 # if defined (__GNUC__) && (__GNUC__ >= 2)
 #  define PRINTF_ARGS(string_index,first_to_check) \
@@ -348,6 +233,23 @@
 #define RETURN_NOT_REACHED(value) return value;
 #endif
 
+#ifndef DO_NOTHING
+#define DO_NOTHING do {} while (0)
+#endif
+
+#ifndef DECLARE_NOTHING
+#define DECLARE_NOTHING struct nosuchstruct
+#endif
+
+/*#ifdef DEBUG_XEMACS*/
+#define REGISTER
+#define register
+/*#else*/
+/*#define REGISTER register*/
+/*#endif*/
+
+/* ------------------------ alignment definitions ------------------- */
+
 /* No type has a greater alignment requirement than max_align_t.
    (except perhaps for types we don't use, like long double) */
 typedef union
@@ -404,13 +306,7 @@
 #define ALIGN_PTR(ptr, unit) \
   ((void *) ALIGN_SIZE ((size_t) (ptr), unit))
 
-#ifndef DO_NOTHING
-#define DO_NOTHING do {} while (0)
-#endif
-
-#ifndef DECLARE_NOTHING
-#define DECLARE_NOTHING struct nosuchstruct
-#endif
+/* ------------------------ assertions ------------------- */
 
 /* We define assert iff USE_ASSERTIONS or DEBUG_XEMACS is defined.
    Otherwise we define it to be empty.  Quantify has shown that the
@@ -458,13 +354,143 @@
 #endif
 #endif /* 0 */
 
-/*#ifdef DEBUG_XEMACS*/
-#define REGISTER
-#define register
-/*#else*/
-/*#define REGISTER register*/
-/*#endif*/
-
+/* ------------------------ simple memory allocation ------------------- */
+
+/* Memory allocation */
+void malloc_warning (const char *);
+void *xmalloc (Bytecount size);
+void *xmalloc_and_zero (Bytecount size);
+void *xrealloc (void *, Bytecount size);
+char *xstrdup (const char *);
+/* generally useful */
+#define countof(x) ((int) (sizeof(x)/sizeof((x)[0])))
+#define xnew(type) ((type *) xmalloc (sizeof (type)))
+#define xnew_array(type, len) ((type *) xmalloc ((len) * sizeof (type)))
+#define xnew_and_zero(type) ((type *) xmalloc_and_zero (sizeof (type)))
+#define xzero(lvalue) ((void) memset (&(lvalue), '\0', sizeof (lvalue)))
+#define xnew_array_and_zero(type, len) ((type *) xmalloc_and_zero ((len) * sizeof (type)))
+#define XREALLOC_ARRAY(ptr, type, len) ((void) (ptr = (type *) xrealloc (ptr, (len) * sizeof (type))))
+#define alloca_new(type) ((type *) alloca (sizeof (type)))
+#define alloca_array(type, len) ((type *) alloca ((len) * sizeof (type)))
+
+/* also generally useful if you want to avoid arbitrary size limits
+   but don't need a full dynamic array.  Assumes that BASEVAR points
+   to a malloced array of TYPE objects (or possibly a NULL pointer,
+   if SIZEVAR is 0), with the total size stored in SIZEVAR.  This
+   macro will realloc BASEVAR as necessary so that it can hold at
+   least NEEDED_SIZE objects.  The reallocing is done by doubling,
+   which ensures constant amortized time per element. */
+#define DO_REALLOC(basevar, sizevar, needed_size, type)	do {	\
+  Bytecount do_realloc_needed_size = (needed_size);		\
+  if ((sizevar) < do_realloc_needed_size)			\
+    {								\
+      if ((sizevar) < 32)					\
+	(sizevar) = 32;						\
+      while ((sizevar) < do_realloc_needed_size)		\
+	(sizevar) *= 2;						\
+      XREALLOC_ARRAY (basevar, type, (sizevar));		\
+    }								\
+} while (0)
+
+#ifdef ERROR_CHECK_MALLOC
+void xfree_1 (void *);
+#define xfree(lvalue) do			\
+{						\
+  void **xfree_ptr = (void **) &(lvalue);	\
+  xfree_1 (*xfree_ptr);				\
+  *xfree_ptr = (void *) 0xDEADBEEF;		\
+} while (0)
+#else
+void xfree (void *);
+#endif /* ERROR_CHECK_MALLOC */
+
+/* ------------------------ dynamic arrays ------------------- */
+
+#define Dynarr_declare(type)	\
+  type *base;			\
+  int elsize;			\
+  int cur;			\
+  int largest;			\
+  int max
+
+typedef struct dynarr
+{
+  Dynarr_declare (void);
+} Dynarr;
+
+void *Dynarr_newf (int elsize);
+void Dynarr_resize (void *dy, int size);
+void Dynarr_insert_many (void *d, const void *el, int len, int start);
+void Dynarr_delete_many (void *d, int start, int len);
+void Dynarr_free (void *d);
+
+#define Dynarr_new(type) ((type##_dynarr *) Dynarr_newf (sizeof (type)))
+#define Dynarr_new2(dynarr_type, type) \
+  ((dynarr_type *) Dynarr_newf (sizeof (type)))
+#define Dynarr_at(d, pos) ((d)->base[pos])
+#define Dynarr_atp(d, pos) (&Dynarr_at (d, pos))
+#define Dynarr_begin(d) Dynarr_atp (d, 0)
+#define Dynarr_end(d) Dynarr_atp (d, Dynarr_length (d))
+#define Dynarr_sizeof(d) ((d)->cur * (d)->elsize)
+
+#ifdef ERROR_CHECK_TYPECHECK
+DECLARE_INLINE_HEADER (
+Dynarr *
+Dynarr_verify_1 (void *d, const char *file, int line)
+)
+{
+  Dynarr *dy = (Dynarr *) d;
+  assert_at_line (dy->cur >= 0 && dy->cur <= dy->largest &&
+		  dy->largest <= dy->max, file, line);
+  return dy;
+}
+
+#define Dynarr_verify(d) Dynarr_verify_1 (d, __FILE__, __LINE__)
+#else
+#define Dynarr_verify(d) (d)
+#endif /* ERROR_CHECK_TYPECHECK */
+
+#define Dynarr_length(d) (Dynarr_verify (d)->cur)
+#define Dynarr_largest(d) (Dynarr_verify (d)->largest)
+#define Dynarr_reset(d) (Dynarr_verify (d)->cur = 0)
+#define Dynarr_add_many(d, el, len) Dynarr_insert_many (d, el, len, (d)->cur)
+#define Dynarr_insert_many_at_start(d, el, len)	\
+  Dynarr_insert_many (d, el, len, 0)
+#define Dynarr_add_literal_string(d, s) Dynarr_add_many (d, s, sizeof (s) - 1)
+#define Dynarr_add_lisp_string(d, s, codesys)		\
+do {							\
+  Lisp_Object dyna_ls_s = (s);				\
+  Lisp_Object dyna_ls_cs = (codesys);			\
+  Extbyte *dyna_ls_eb;					\
+  Bytecount dyna_ls_bc;					\
+							\
+  TO_EXTERNAL_FORMAT (LISP_STRING, dyna_ls_s,		\
+                      ALLOCA, (dyna_ls_eb, dyna_ls_bc),	\
+		      dyna_ls_cs);			\
+  Dynarr_add_many (d, dyna_ls_eb, dyna_ls_bc);		\
+} while (0)
+
+#define Dynarr_add(d, el) (						 \
+  Dynarr_verify (d)->cur >= (d)->max ? Dynarr_resize ((d), (d)->cur+1) : \
+      (void) 0,								 \
+  ((d)->base)[(d)->cur++] = (el),					 \
+  (d)->cur > (d)->largest ? (d)->largest = (d)->cur : (int) 0)
+
+/* The following defines will get you into real trouble if you aren't
+   careful.  But they can save a lot of execution time when used wisely. */
+#define Dynarr_increment(d) ((d)->cur++)
+#define Dynarr_set_size(d, n) ((d)->cur = n)
+
+#define Dynarr_pop(d) \
+  (assert ((d)->cur > 0), (d)->cur--, Dynarr_at (d, (d)->cur))
+#define Dynarr_delete(d, i) Dynarr_delete_many (d, i, len)
+#define Dynarr_delete_by_pointer(d, p) \
+  Dynarr_delete_many (d, (p) - ((d)->base), 1)
+
+#ifdef MEMORY_USAGE_STATS
+struct overhead_stats;
+Bytecount Dynarr_memory_usage (void *d, struct overhead_stats *stats);
+#endif
 
 
 /************************************************************************/
@@ -488,7 +514,8 @@
 {
   ERROR_ME,
   ERROR_ME_NOT,
-  ERROR_ME_WARN
+  ERROR_ME_WARN,
+  ERROR_ME_DEBUG_WARN
 } Error_Behavior;
 
 #define ERRB_EQ(a, b) ((a) == (b))
@@ -506,6 +533,7 @@
 extern Error_Behavior ERROR_ME;
 extern Error_Behavior ERROR_ME_NOT;
 extern Error_Behavior ERROR_ME_WARN;
+extern Error_Behavior ERROR_ME_DEBUG_WARN;
 
 #define ERRB_EQ(a, b)							   \
  ((a).really_unlikely_name_to_have_accidentally_in_a_non_errb_structure == \
@@ -828,7 +856,6 @@
 
 DECLARE_LRECORD (cons, Lisp_Cons);
 #define XCONS(x) XRECORD (x, cons, Lisp_Cons)
-#define XSETCONS(x, p) XSETRECORD (x, p, cons)
 #define wrap_cons(p) wrap_record (p, cons)
 #define CONSP(x) RECORDP (x, cons)
 #define CHECK_CONS(x) CHECK_RECORD (x, cons)
@@ -1323,8 +1350,8 @@
 	  unsigned int ascii_begin :21;
 	} v;
     } u;
-  Bytecount size;
-  Intbyte *data;
+  Bytecount size_;
+  Intbyte *data_;
   Lisp_Object plist;
 };
 typedef struct Lisp_String Lisp_String;
@@ -1333,7 +1360,6 @@
 
 DECLARE_LRECORD (string, Lisp_String);
 #define XSTRING(x) XRECORD (x, string, Lisp_String)
-#define XSETSTRING(x, p) XSETRECORD (x, p, string)
 #define wrap_string(p) wrap_record (p, string)
 #define STRINGP(x) RECORDP (x, string)
 #define CHECK_STRING(x) CHECK_RECORD (x, string)
@@ -1351,33 +1377,27 @@
 
 #endif /* not MULE */
 
-#define string_length(s) ((s)->size)
-#define XSTRING_LENGTH(s) string_length (XSTRING (s))
-#define string_data(s) ((s)->data + 0)
-#define XSTRING_DATA(s) string_data (XSTRING (s))
-#define string_ascii_begin(s) ((s)->u.v.ascii_begin + 0)
-#define XSTRING_ASCII_BEGIN(s) string_ascii_begin (XSTRING (s))
-#define string_char_length(s) string_index_byte_to_char (s, string_length (s))
-#define XSTRING_CHAR_LENGTH(s) string_char_length (XSTRING (s))
-#define string_byte(s, i) ((s)->data[i] + 0)
-#define XSTRING_BYTE(s, i) string_byte (XSTRING (s), i)
-#define string_byte_addr(s, i) (&((s)->data[i]))
-#define string_char(s, i) charptr_emchar (string_char_addr (s, i))
-#define XSTRING_CHAR(s, i) string_char (XSTRING (s), i)
-#define XSTRING_INDEX_CHAR_TO_BYTE(s, idx) \
-  string_index_char_to_byte (XSTRING (s), idx)
-#define XSTRING_INDEX_BYTE_TO_CHAR(s, idx) \
-  string_index_byte_to_char (XSTRING (s), idx)
-#define XSTRING_OFFSET_BYTE_TO_CHAR_LEN(s, off, len) \
-  string_offset_byte_to_char_len (XSTRING (s), off, len)
-#define XSTRING_OFFSET_CHAR_TO_BYTE_LEN(s, off, len) \
-  string_offset_char_to_byte_len (XSTRING (s), off, len)
-#define set_string_length(s, len) ((void) ((s)->size = (len)))
-#define set_string_data(s, ptr) ((void) ((s)->data = (ptr)))
+/* Operations on Lisp_String *'s; only ones left */
+#define set_string_length(s, len) ((void) ((s)->size_ = (len)))
+#define set_string_data(s, ptr) ((void) ((s)->data_ = (ptr)))
+
+#define XSTRING_LENGTH(s) (XSTRING (s)->size_)
+#define XSTRING_PLIST(s) (XSTRING (s)->plist)
+#define XSTRING_DATA(s) (XSTRING (s)->data_ + 0)
+#define XSTRING_ASCII_BEGIN(s) (XSTRING (s)->u.v.ascii_begin + 0)
+#define XSTRING_CHAR_LENGTH(s) \
+  string_index_byte_to_char (s, XSTRING_LENGTH (s))
+#define XSTRING_BYTE(s, i) (XSTRING (s)->data_[i] + 0)
+#define set_string_byte(s, i, c) (XSTRING (s)->data_[i] = (c))
+
+#define string_byte_addr(s, i) (&((XSTRING (s))->data_[i]))
+#define XSTRING_CHAR(s, i) charptr_emchar (string_char_addr (s, i))
+#define XSET_STRING_LENGTH(s, ptr) set_string_length (XSTRING (s), ptr)
+#define XSET_STRING_DATA(s, ptr) set_string_data (XSTRING (s), ptr)
 /* WARNING: If you modify an existing string, you must call
    bump_string_modiff() afterwards. */
-#define set_string_byte(s, i, b) ((void) ((s)->data[i] = (b)))
-#define set_string_ascii_begin(s, val) ((void) ((s)->u.v.ascii_begin = (val)))
+#define XSET_STRING_ASCII_BEGIN(s, val) \
+  ((void) (XSTRING (s)->u.v.ascii_begin = (val)))
 
 #ifdef ERROR_CHECK_CHARBPOS
 #define SLEDGEHAMMER_CHECK_ASCII_BEGIN
@@ -1411,25 +1431,26 @@
 #define alloca_intbytes(num) alloca_array (Intbyte, num)
 #define alloca_extbytes(num) alloca_array (Extbyte, num)
 
-void resize_string (Lisp_String *s, Bytecount pos, Bytecount delta);
+void resize_string (Lisp_Object s, Bytecount pos, Bytecount delta);
 
 #ifdef MULE
 
 /* Convert a byte index into a string into a char index. */
 DECLARE_INLINE_HEADER (
 Charcount
-string_index_byte_to_char (Lisp_String *s, Bytecount idx)
+string_index_byte_to_char (Lisp_Object s, Bytecount idx)
 )
 {
   Charcount retval;
-  if (idx <= (Bytecount) string_ascii_begin (s))
+  if (idx <= (Bytecount) XSTRING_ASCII_BEGIN (s))
     retval = idx;
   else
-    retval = (string_ascii_begin (s) +
-	      bytecount_to_charcount (string_data (s) + string_ascii_begin (s),
-				      idx - string_ascii_begin (s)));
+    retval = (XSTRING_ASCII_BEGIN (s) +
+	      bytecount_to_charcount (XSTRING_DATA (s) +
+				      XSTRING_ASCII_BEGIN (s),
+				      idx - XSTRING_ASCII_BEGIN (s)));
 #ifdef SLEDGEHAMMER_CHECK_ASCII_BEGIN
-  assert (retval == bytecount_to_charcount (string_data (s), idx));
+  assert (retval == bytecount_to_charcount (XSTRING_DATA (s), idx));
 #endif
   return retval;
 }
@@ -1437,18 +1458,19 @@
 /* Convert a char index into a string into a byte index. */
 DECLARE_INLINE_HEADER (
 Bytecount
-string_index_char_to_byte (Lisp_String *s, Charcount idx)
+string_index_char_to_byte (Lisp_Object s, Charcount idx)
 )
 {
   Bytecount retval;
-  if (idx <= (Charcount) string_ascii_begin (s))
+  if (idx <= (Charcount) XSTRING_ASCII_BEGIN (s))
     retval = idx;
   else
-    retval = (string_ascii_begin (s) +
-	      charcount_to_bytecount (string_data (s) + string_ascii_begin (s),
-				      idx - string_ascii_begin (s)));
+    retval = (XSTRING_ASCII_BEGIN (s) +
+	      charcount_to_bytecount (XSTRING_DATA (s) +
+				      XSTRING_ASCII_BEGIN (s),
+				      idx - XSTRING_ASCII_BEGIN (s)));
 #ifdef SLEDGEHAMMER_CHECK_ASCII_BEGIN
-  assert (retval == charcount_to_bytecount (string_data (s), idx));
+  assert (retval == charcount_to_bytecount (XSTRING_DATA (s), idx));
 #endif
   return retval;
 }
@@ -1457,21 +1479,21 @@
    chars. */
 DECLARE_INLINE_HEADER (
 Charcount
-string_offset_byte_to_char_len (Lisp_String *s, Bytecount off, Bytecount len)
+string_offset_byte_to_char_len (Lisp_Object s, Bytecount off, Bytecount len)
 )
 {
   Charcount retval;
-  if (off + len <= (Bytecount) string_ascii_begin (s))
+  if (off + len <= (Bytecount) XSTRING_ASCII_BEGIN (s))
     retval = len;
-  else if (off < (Bytecount) string_ascii_begin (s))
+  else if (off < (Bytecount) XSTRING_ASCII_BEGIN (s))
     retval =
-      string_ascii_begin (s) - off +
-	bytecount_to_charcount (string_data (s) + string_ascii_begin (s),
-				len - (string_ascii_begin (s) - off));
+      XSTRING_ASCII_BEGIN (s) - off +
+	bytecount_to_charcount (XSTRING_DATA (s) + XSTRING_ASCII_BEGIN (s),
+				len - (XSTRING_ASCII_BEGIN (s) - off));
   else
-    retval = bytecount_to_charcount (string_data (s) + off, len);
+    retval = bytecount_to_charcount (XSTRING_DATA (s) + off, len);
 #ifdef SLEDGEHAMMER_CHECK_ASCII_BEGIN
-  assert (retval == bytecount_to_charcount (string_data (s) + off, len));
+  assert (retval == bytecount_to_charcount (XSTRING_DATA (s) + off, len));
 #endif
   return retval;
 }
@@ -1480,34 +1502,34 @@
    bytes. */
 DECLARE_INLINE_HEADER (
 Bytecount
-string_offset_char_to_byte_len (Lisp_String *s, Bytecount off, Charcount len)
+string_offset_char_to_byte_len (Lisp_Object s, Bytecount off, Charcount len)
 )
 {
   Bytecount retval;
-  if (off + len <= (Bytecount) string_ascii_begin (s))
+  if (off + len <= (Bytecount) XSTRING_ASCII_BEGIN (s))
     retval = len;
-  else if (off < (Bytecount) string_ascii_begin (s))
+  else if (off < (Bytecount) XSTRING_ASCII_BEGIN (s))
     retval =
-      string_ascii_begin (s) - off +
-	charcount_to_bytecount (string_data (s) + string_ascii_begin (s),
-				len - (string_ascii_begin (s) - off));
+      XSTRING_ASCII_BEGIN (s) - off +
+	charcount_to_bytecount (XSTRING_DATA (s) + XSTRING_ASCII_BEGIN (s),
+				len - (XSTRING_ASCII_BEGIN (s) - off));
   else
-    retval = charcount_to_bytecount (string_data (s) + off, len);
+    retval = charcount_to_bytecount (XSTRING_DATA (s) + off, len);
 #ifdef SLEDGEHAMMER_CHECK_ASCII_BEGIN
-  assert (retval == charcount_to_bytecount (string_data (s) + off, len));
+  assert (retval == charcount_to_bytecount (XSTRING_DATA (s) + off, len));
 #endif
   return retval;
 }
 
 DECLARE_INLINE_HEADER (
 Intbyte *
-string_char_addr (Lisp_String *s, Charcount idx)
+string_char_addr (Lisp_Object s, Charcount idx)
 )
 {
-  return string_data (s) + string_index_char_to_byte (s, idx);
+  return XSTRING_DATA (s) + string_index_char_to_byte (s, idx);
 }
 
-void set_string_char (Lisp_String *s, Charcount i, Emchar c);
+void set_string_char (Lisp_Object s, Charcount i, Emchar c);
 
 #else /* not MULE */
 
@@ -1518,7 +1540,7 @@
 # define string_char_addr(s, i) string_byte_addr (s, i)
 /* WARNING: If you modify an existing string, you must call
    bump_string_modiff() afterwards. */
-# define set_string_char(s, i, c) set_string_byte (s, i, (Intbyte) c)
+# define set_string_char(s, i, c) set_string_byte (s, i, c)
 
 #endif /* not MULE */
 
@@ -1560,7 +1582,6 @@
 
 DECLARE_LRECORD (vector, Lisp_Vector);
 #define XVECTOR(x) XRECORD (x, vector, Lisp_Vector)
-#define XSETVECTOR(x, p) XSETRECORD (x, p, vector)
 #define wrap_vector(p) wrap_record (p, vector)
 #define VECTORP(x) RECORDP (x, vector)
 #define CHECK_VECTOR(x) CHECK_RECORD (x, vector)
@@ -1599,7 +1620,6 @@
 
 DECLARE_LRECORD (bit_vector, Lisp_Bit_Vector);
 #define XBIT_VECTOR(x) XRECORD (x, bit_vector, Lisp_Bit_Vector)
-#define XSETBIT_VECTOR(x, p) XSETRECORD (x, p, bit_vector)
 #define wrap_bit_vector(p) wrap_record (p, bit_vector)
 #define BIT_VECTORP(x) RECORDP (x, bit_vector)
 #define CHECK_BIT_VECTOR(x) CHECK_RECORD (x, bit_vector)
@@ -1650,22 +1670,21 @@
   struct lrecord_header lheader;
   /* next symbol in this obarray bucket */
   Lisp_Symbol *next;
-  Lisp_String *name;
+  Lisp_Object name;
   Lisp_Object value;
   Lisp_Object function;
   Lisp_Object plist;
 };
 
 #define SYMBOL_IS_KEYWORD(sym)						\
-  ((string_byte (symbol_name (XSYMBOL (sym)), 0) == ':')		\
+  ((XSTRING_BYTE (symbol_name (XSYMBOL (sym)), 0) == ':')		\
    && EQ (sym, oblookup (Vobarray,					\
-			 string_data (symbol_name (XSYMBOL (sym))),	\
-			 string_length (symbol_name (XSYMBOL (sym))))))
+			 XSTRING_DATA (symbol_name (XSYMBOL (sym))),	\
+			 XSTRING_LENGTH (symbol_name (XSYMBOL (sym))))))
 #define KEYWORDP(obj) (SYMBOLP (obj) && SYMBOL_IS_KEYWORD (obj))
 
 DECLARE_LRECORD (symbol, Lisp_Symbol);
 #define XSYMBOL(x) XRECORD (x, symbol, Lisp_Symbol)
-#define XSETSYMBOL(x, p) XSETRECORD (x, p, symbol)
 #define wrap_symbol(p) wrap_record (p, symbol)
 #define SYMBOLP(x) RECORDP (x, symbol)
 #define CHECK_SYMBOL(x) CHECK_RECORD (x, symbol)
@@ -1677,6 +1696,13 @@
 #define symbol_function(s) ((s)->function)
 #define symbol_plist(s) ((s)->plist)
 
+#define XSYMBOL_NEXT(s) (XSYMBOL (s)->next)
+#define XSYMBOL_NAME(s) (XSYMBOL (s)->name)
+#define XSYMBOL_VALUE(s) (XSYMBOL (s)->value)
+#define XSYMBOL_FUNCTION(s) (XSYMBOL (s)->function)
+#define XSYMBOL_PLIST(s) (XSYMBOL (s)->plist)
+
+
 /*------------------------------- subr ---------------------------------*/
 
 typedef Lisp_Object (*lisp_fn_t) (void);
@@ -1695,7 +1721,6 @@
 
 DECLARE_LRECORD (subr, Lisp_Subr);
 #define XSUBR(x) XRECORD (x, subr, Lisp_Subr)
-#define XSETSUBR(x, p) XSETRECORD (x, p, subr)
 #define wrap_subr(p) wrap_record (p, subr)
 #define SUBRP(x) RECORDP (x, subr)
 #define CHECK_SUBR(x) CHECK_RECORD (x, subr)
@@ -1722,7 +1747,6 @@
 
 DECLARE_LRECORD (marker, Lisp_Marker);
 #define XMARKER(x) XRECORD (x, marker, Lisp_Marker)
-#define XSETMARKER(x, p) XSETRECORD (x, p, marker)
 #define wrap_marker(p) wrap_record (p, marker)
 #define MARKERP(x) RECORDP (x, marker)
 #define CHECK_MARKER(x) CHECK_RECORD (x, marker)
@@ -1778,7 +1802,6 @@
 
 DECLARE_LRECORD (float, Lisp_Float);
 #define XFLOAT(x) XRECORD (x, float, Lisp_Float)
-#define XSETFLOAT(x, p) XSETRECORD (x, p, float)
 #define wrap_float(p) wrap_record (p, float)
 #define FLOATP(x) RECORDP (x, float)
 #define CHECK_FLOAT(x) CHECK_RECORD (x, float)
@@ -1804,7 +1827,6 @@
 #else /* not LISP_FLOAT_TYPE */
 
 #define XFLOAT(x) --- error!  No float support. ---
-#define XSETFLOAT(x, p) --- error!  No float support. ---
 #define FLOATP(x) 0
 #define CHECK_FLOAT(x) --- error!  No float support. ---
 #define CONCHECK_FLOAT(x) --- error!  No float support. ---
@@ -1982,7 +2004,6 @@
 
 DECLARE_LRECORD (weak_list, struct weak_list);
 #define XWEAK_LIST(x) XRECORD (x, weak_list, struct weak_list)
-#define XSETWEAK_LIST(x, p) XSETRECORD (x, p, weak_list)
 #define wrap_weak_list(p) wrap_record (p, weak_list)
 #define WEAK_LISTP(x) RECORDP (x, weak_list)
 #define CHECK_WEAK_LIST(x) CHECK_RECORD (x, weak_list)
@@ -2008,7 +2029,6 @@
 
 DECLARE_LRECORD (lcrecord_list, struct lcrecord_list);
 #define XLCRECORD_LIST(x) XRECORD (x, lcrecord_list, struct lcrecord_list)
-#define XSETLCRECORD_LIST(x, p) XSETRECORD (x, p, lcrecord_list)
 #define wrap_lcrecord_list(p) wrap_record (p, lcrecord_list)
 #define LCRECORD_LISTP(x) RECORDP (x, lcrecord_list)
 /* #define CHECK_LCRECORD_LIST(x) CHECK_RECORD (x, lcrecord_list)
@@ -3219,7 +3239,7 @@
 /* Defined in indent.c */
 int bi_spaces_at_point (struct buffer *, Bytebpos);
 int column_at_point (struct buffer *, Charbpos, int);
-int string_column_at_point (Lisp_String *, Charbpos, int);
+int string_column_at_point (Lisp_Object, Charbpos, int);
 int current_column (struct buffer *);
 void invalidate_current_column (void);
 Charbpos vmotion (struct window *, Charbpos, int, int *);
@@ -3242,7 +3262,7 @@
 extern Lisp_Object Qmswindows_multibyte, Qmswindows_multibyte_to_unicode;
 
 /* Defined in keymap.c */
-void where_is_to_char (Lisp_Object, char *);
+void where_is_to_char (Lisp_Object, Eistring *);
 
 /* Defined in lread.c */
 void ebolify_bytecode_constants (Lisp_Object);
@@ -3326,6 +3346,7 @@
 void write_string (const Intbyte *str, Lisp_Object stream);
 /* Same goes for this function. */
 void write_string_1 (const Intbyte *str, Bytecount size, Lisp_Object stream);
+void write_eistring (const Eistring *ei, Lisp_Object stream);
 
 /* Higher-level (printf-style) ways to output data: */
 void write_fmt_string (Lisp_Object stream, const CIntbyte *fmt, ...);
@@ -3394,7 +3415,7 @@
 Charbpos find_next_newline (struct buffer *, Charbpos, int);
 Charbpos find_next_newline_no_quit (struct buffer *, Charbpos, int);
 Bytebpos bi_find_next_newline_no_quit (struct buffer *, Bytebpos, int);
-Bytebpos bi_find_next_emchar_in_string (Lisp_String*, Emchar, Bytebpos, EMACS_INT);
+Bytebpos bi_find_next_emchar_in_string (Lisp_Object, Emchar, Bytebpos, EMACS_INT);
 Charbpos find_before_next_newline (struct buffer *, Charbpos, Charbpos, int);
 struct re_pattern_buffer *compile_pattern (Lisp_Object, struct re_registers *,
 					   Lisp_Object, int, Error_Behavior);