]> code.delx.au - gnu-emacs/blobdiff - src/lisp.h
(struct gl_state_s): New field `offset'.
[gnu-emacs] / src / lisp.h
index a006dd33476b37e8d21a45be32289d0815e76557..ecfc0b657c2c8bd4d1da285f83f4d4c947b17764 100644 (file)
@@ -15,12 +15,14 @@ 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, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
 
 /* These are default choices for the types to use.  */
 #ifndef EMACS_INT
 #define EMACS_INT int
+#define BITS_PER_EMACS_INT BITS_PER_INT
 #endif
 #ifndef EMACS_UINT
 #define EMACS_UINT unsigned int
@@ -79,7 +81,7 @@ enum Lisp_Misc_Type
     Lisp_Misc_Buffer_Local_Value,
     Lisp_Misc_Some_Buffer_Local_Value,
     Lisp_Misc_Overlay,
-    Lisp_Misc_Display_Objfwd,
+    Lisp_Misc_Kboard_Objfwd,
     /* Currently floats are not a misc type,
        but let's define this in case we want to change that.  */
     Lisp_Misc_Float,
@@ -96,6 +98,20 @@ enum Lisp_Misc_Type
 #define GCTYPEBITS 3
 #endif
 
+/* Make these values available in GDB, which sees enums but not macros.  */
+
+enum gdb_lisp_params
+{
+  gdb_valbits = VALBITS,
+  gdb_gctypebits = GCTYPEBITS,
+  gdb_emacs_intbits = sizeof (EMACS_INT) * BITS_PER_CHAR,
+#ifdef DATA_SEG_BITS
+  gdb_data_seg_bits = DATA_SEG_BITS
+#else
+  gdb_data_seg_bits = 0
+#endif
+};
+
 #ifndef NO_UNION_TYPE
 
 #ifndef WORDS_BIG_ENDIAN
@@ -165,12 +181,11 @@ Lisp_Object;
 #endif /* NO_UNION_TYPE */
 
 
-/* If union type is not wanted, define Lisp_Object as just a number
-   and define the macros below to extract fields by shifting */
+/* If union type is not wanted, define Lisp_Object as just a number.  */
 
 #ifdef NO_UNION_TYPE
-
 #define Lisp_Object EMACS_INT
+#endif /* NO_UNION_TYPE */
 
 #ifndef VALMASK
 #define VALMASK ((((EMACS_INT) 1)<<VALBITS) - 1)
@@ -190,7 +205,7 @@ Lisp_Object;
    rather than being part of a string block.  */
 
 #ifndef MARKBIT
-#define MARKBIT (1 << (VALBITS + GCTYPEBITS))
+#define MARKBIT ((int) ((unsigned int) 1 << (VALBITS + GCTYPEBITS)))
 #endif /*MARKBIT */
 
 /* In the size word of a vector, this bit means the vector has been marked.
@@ -212,25 +227,21 @@ Lisp_Object;
 enum pvec_type
 {
   PVEC_NORMAL_VECTOR = 0,
-  PVEC_BUFFER = 0x100,
   PVEC_PROCESS = 0x200,
   PVEC_FRAME = 0x400,
   PVEC_COMPILED = 0x800,
   PVEC_WINDOW = 0x1000,
   PVEC_WINDOW_CONFIGURATION = 0x2000,
   PVEC_SUBR = 0x4000,
-  PVEC_TYPE_MASK = 0x7f00,
-  PVEC_FLAG = PSEUDOVECTOR_FLAG,
+  PVEC_CHAR_TABLE = 0x8000,
+  PVEC_BOOL_VECTOR = 0x10000,
+  PVEC_BUFFER = 0x20000,
+  PVEC_TYPE_MASK = 0x3fe00,
+  PVEC_FLAG = PSEUDOVECTOR_FLAG
 };
 
 /* For convenience, we also store the number of elements in these bits.  */
-#define PSEUDOVECTOR_SIZE_MASK 0xff
-
-#if ARRAY_MARK_FLAG == MARKBIT || PSEUDOVECTOR_FLAG == ARRAY_MARK_FLAG || PSEUDOVECTOR_FLAG == MARKBIT
-you lose
-#endif
-
-#endif /* NO_UNION_TYPE */
+#define PSEUDOVECTOR_SIZE_MASK 0x1ff
 \f
 /* These macros extract various sorts of values from a Lisp_Object.
  For example, if tem is a Lisp_Object whose type is Lisp_Cons,
@@ -259,7 +270,7 @@ you lose
 /* Extract the value of a Lisp_Object as a signed integer.  */
 
 #ifndef XINT   /* Some machines need to do this differently.  */
-#define XINT(a) (((a) << (INTBITS-VALBITS)) >> (INTBITS-VALBITS))
+#define XINT(a) (((a) << (BITS_PER_INT-VALBITS)) >> (BITS_PER_INT-VALBITS))
 #endif
 
 /* Extract the value as an unsigned integer.  This is a basis
@@ -294,6 +305,11 @@ extern int pure_size;
    ((var) = ((EMACS_INT)(type) << VALBITS) + ((EMACS_INT) (ptr) & VALMASK))
 #endif
 
+/* Convert a C integer into a Lisp_Object integer.  */
+
+#define make_number(N)         \
+  ((((EMACS_INT) (N)) & VALMASK) | ((EMACS_INT) Lisp_Int) << VALBITS)
+
 /* During garbage collection, XGCTYPE must be used for extracting types
  so that the mark bit is ignored.  XMARKBIT accesses the markbit.
  Markbits are used only in particular slots of particular structure types.
@@ -304,7 +320,7 @@ extern int pure_size;
 #define XGCTYPE(a) ((enum Lisp_Type) (((a) >> VALBITS) & GCTYPEMASK))
 #endif
 
-#if VALBITS + GCTYPEBITS == INTBITS - 1
+#if VALBITS + GCTYPEBITS == BITS_PER_EMACS_INT - 1
 /* Make XMARKBIT faster if mark bit is sign bit.  */
 #ifndef XMARKBIT
 #define XMARKBIT(a) ((a) < 0)
@@ -342,7 +358,7 @@ extern int pure_size;
 
 #ifdef EXPLICIT_SIGN_EXTEND
 /* Make sure we sign-extend; compilers have been known to fail to do so.  */
-#define XINT(a) (((a).i << (INTBITS-VALBITS)) >> (INTBITS-VALBITS))
+#define XINT(a) (((a).i << (BITS_PER_INT-VALBITS)) >> (BITS_PER_INT-VALBITS))
 #else
 #define XINT(a) ((a).s.val)
 #endif /* EXPLICIT_SIGN_EXTEND */
@@ -353,6 +369,8 @@ extern int pure_size;
 #define XSET(var, vartype, ptr) \
    (((var).s.type = ((char) (vartype))), ((var).s.val = ((int) (ptr))))
 
+extern Lisp_Object make_number ();
+
 /* During garbage collection, XGCTYPE must be used for extracting types
  so that the mark bit is ignored.  XMARKBIT access the markbit.
  Markbits are used only in particular slots of particular structure types.
@@ -377,6 +395,7 @@ extern int pure_size;
 
 /* Misc types.  */
 #define XMISC(a)   ((union Lisp_Misc *) XPNTR(a))
+#define XMISCTYPE(a)   (XMARKER (a)->type)
 #define XMARKER(a) (&(XMISC(a)->u_marker))
 #define XINTFWD(a) (&(XMISC(a)->u_intfwd))
 #define XBOOLFWD(a) (&(XMISC(a)->u_boolfwd))
@@ -384,13 +403,15 @@ extern int pure_size;
 #define XBUFFER_OBJFWD(a) (&(XMISC(a)->u_buffer_objfwd))
 #define XBUFFER_LOCAL_VALUE(a) (&(XMISC(a)->u_buffer_local_value))
 #define XOVERLAY(a) (&(XMISC(a)->u_overlay))
-#define XDISPLAY_OBJFWD(a) (&(XMISC(a)->u_display_objfwd))
+#define XKBOARD_OBJFWD(a) (&(XMISC(a)->u_kboard_objfwd))
 
 /* Pseudovector types.  */
 #define XPROCESS(a) ((struct Lisp_Process *) XPNTR(a))
 #define XWINDOW(a) ((struct window *) XPNTR(a))
 #define XSUBR(a) ((struct Lisp_Subr *) XPNTR(a))
 #define XBUFFER(a) ((struct buffer *) XPNTR(a))
+#define XCHAR_TABLE(a) ((struct Lisp_Char_Table *) XPNTR(a))
+#define XBOOL_VECTOR(a) ((struct Lisp_Bool_Vector *) XPNTR(a))
 
 
 /* Construct a Lisp_Object from a value or address.  */
@@ -404,7 +425,7 @@ extern int pure_size;
 
 /* Misc types.  */
 #define XSETMISC(a, b) XSET (a, Lisp_Misc, b)
-#define XSETMARKER(a, b) (XSETMISC (a, b), XMISC (a)->type = Lisp_Misc_Marker)
+#define XSETMARKER(a, b) (XSETMISC (a, b), XMISCTYPE (a) = Lisp_Misc_Marker)
 
 /* Pseudovector types.  */
 #define XSETPSEUDOVECTOR(a, b, code) \
@@ -416,6 +437,8 @@ extern int pure_size;
 #define XSETSUBR(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_SUBR))
 #define XSETCOMPILED(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_COMPILED))
 #define XSETBUFFER(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_BUFFER))
+#define XSETCHAR_TABLE(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_CHAR_TABLE))
+#define XSETBOOL_VECTOR(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_BOOL_VECTOR))
 \f
 #ifdef USE_TEXT_PROPERTIES
 /* Basic data type for use of intervals.  See the macros in intervals.h.  */
@@ -485,75 +508,6 @@ typedef struct interval *INTERVAL;
 
 #endif /* USE_TEXT_PROPERTIES */
 \f
-#define ECHOBUFSIZE 300
-/* All of the per-display objects, packaged together in a struct.  */
-typedef struct PERDISPLAY PERDISPLAY;
-struct PERDISPLAY
-  {
-    PERDISPLAY *next_perdisplay;
-    Lisp_Object Vprefix_arg;
-    Lisp_Object Vcurrent_prefix_arg;
-
-#ifdef MULTI_FRAME
-    /* The frame in which the last input event occurred, or Qmacro if the
-       last event came from a macro.  We use this to determine when to
-       generate switch-frame events.  This may be cleared by functions
-       like Fselect_frame, to make sure that a switch-frame event is
-       generated by the next character.  */
-    Lisp_Object internal_last_event_frame;
-#endif
-
-    /* A user-visible version of the above, intended to allow users to
-       figure out where the last event came from, if the event doesn't
-       carry that information itself (i.e. if it was a character).  */
-    Lisp_Object Vlast_event_frame;
-
-    Lisp_Object kbd_queue;
-
-    /* Placeholder for future vars that will be moved here.  */
-    Lisp_Object unused[23];
-
-    Lisp_Object this_command_keys;
-
-    int this_command_key_count;
-
-    /* Nonzero means echo each character as typed.  */
-    int immediate_echo;
-
-    /* If we have echoed a prompt string specified by the user,
-       this is its length.  Otherwise this is -1.  */
-    int echo_after_prompt;
-
-    /* Where to append more text to echobuf if we want to.  */
-    char *echoptr;
-
-    /* The text we're echoing in the modeline - partial key sequences,
-       usually.  '\0'-terminated.  This really shouldn't have a fixed size.  */
-    char echobuf[ECHOBUFSIZE];
-  };
-
-#ifdef MULTI_PERDISPLAY
-/* The perdisplay object associated with a particular frame.  */
-extern PERDISPLAY *get_perdisplay ();
-
-/* The perdisplay object associated with the command currently being read
-   or executed.  */
-extern PERDISPLAY *current_perdisplay;
-
-/* A list of all perdisplay objects, linked through next_perdisplay.  */
-extern PERDISPLAY *all_perdisplays;
-
-/* Nonzero if current_perdisplay has exclusive use of the keyboard.
-   Usually this means that a command is being executed.  */
-extern int display_locked;
-#else
-extern PERDISPLAY the_only_perdisplay;
-#define get_perdisplay(f) (&the_only_perdisplay)
-#define current_perdisplay (&the_only_perdisplay)
-#define all_perdisplays (&the_only_perdisplay)
-#define display_locked 1
-#endif
-\f
 /* In a cons, the markbit of the car is the gc mark bit */
 
 struct Lisp_Cons
@@ -561,6 +515,21 @@ struct Lisp_Cons
     Lisp_Object car, cdr;
   };
 
+/* Take the car or cdr of something known to be a cons cell.  */
+#define XCAR(c) (XCONS ((c))->car)
+#define XCDR(c) (XCONS ((c))->cdr)
+
+/* Take the car or cdr of something whose type is not known.  */
+#define CAR(c)                                 \
+ (CONSP ((c)) ? XCAR ((c))                     \
+  : NILP ((c)) ? Qnil                          \
+  : wrong_type_argument (Qlistp, (c)))
+
+#define CDR(c)                                 \
+ (CONSP ((c)) ? XCDR ((c))                     \
+  : NILP ((c)) ? Qnil                          \
+  : wrong_type_argument (Qlistp, (c)))
+
 /* Like a cons, but records info on where the text lives that it was read from */
 /* This is not really in use now */
 
@@ -581,9 +550,10 @@ struct Lisp_String
   };
 
 /* If a struct is made to look like a vector, this macro returns the length
-   of that vector.  */
-#define VECSIZE(type) ((sizeof (type) - (sizeof (struct Lisp_Vector)   \
-                                        - sizeof (Lisp_Object)))       \
+   of the shortest vector that would hold that struct.  */
+#define VECSIZE(type) ((sizeof (type) - (sizeof (struct Lisp_Vector)  \
+                                         - sizeof (Lisp_Object))      \
+                        + sizeof(Lisp_Object) - 1) /* round up */     \
                       / sizeof (Lisp_Object))
 
 struct Lisp_Vector
@@ -593,6 +563,112 @@ struct Lisp_Vector
     Lisp_Object contents[1];
   };
 
+/* A char table is a kind of vectorlike, with contents are like a
+   vector but with a few other slots.  For some purposes, it makes
+   sense to handle a chartable with type struct Lisp_Vector.  An
+   element of a char table can be any Lisp objects, but if it is a sub
+   char-table, we treat it a table that contains information of a
+   group of characters of the same charsets or a specific character of
+   a charset.  A sub char-table has the same structure as a char table
+   except for that the former omits several slots at the tail.  A sub
+   char table appears only in an element of a char table, and there's
+   no way to access it directly from Emacs Lisp program.  */
+
+/* This is the number of slots that apply to characters or character
+   sets.  The first 128 are for ASCII, the next 128 are for 8-bit
+   European characters, and the last 128 are for multibyte characters.
+   The first 256 are indexed by the code itself, but the last 128 are
+   indexed by (charset-id + 128).  */
+#define CHAR_TABLE_ORDINARY_SLOTS 384
+
+/* This is the number of slots that apply to characters of ASCII and
+   8-bit Europeans only.  */
+#define CHAR_TABLE_SINGLE_BYTE_SLOTS 256
+
+/* This is the number of slots that every char table must have.  This
+   counts the ordinary slots and the top, defalt, parent, and purpose
+   slots.  */
+#define CHAR_TABLE_STANDARD_SLOTS (CHAR_TABLE_ORDINARY_SLOTS + 4)
+
+/* This is the number of slots that apply to position-code-1 and
+   position-code-2 of a multibyte character at the 2nd and 3rd level
+   sub char tables respectively.  */
+#define SUB_CHAR_TABLE_ORDINARY_SLOTS 128
+
+/* This is the number of slots that every sub char table must have.
+   This counts the ordinary slots and the top and defalt slot.  */
+#define SUB_CHAR_TABLE_STANDARD_SLOTS (SUB_CHAR_TABLE_ORDINARY_SLOTS + 2)
+
+/* Return the number of "extra" slots in the char table CT.  */
+
+#define CHAR_TABLE_EXTRA_SLOTS(CT)     \
+  (((CT)->size & PSEUDOVECTOR_SIZE_MASK) - CHAR_TABLE_STANDARD_SLOTS)
+
+/* Almost equivalent to Faref (CT, IDX) with optimization for ASCII
+   and 8-bit Europeans characters.  For these characters, do not check
+   validity of CT.  Do not follow parent.  */
+#define CHAR_TABLE_REF(CT, IDX)                                \
+  ((IDX) < CHAR_TABLE_SINGLE_BYTE_SLOTS                        \
+   ? (!NILP (XCHAR_TABLE (CT)->contents[IDX])          \
+      ? XCHAR_TABLE (CT)->contents[IDX]                        \
+      : XCHAR_TABLE (CT)->defalt)                      \
+   : Faref (CT, make_number (IDX)))
+
+/* Equivalent to Faset (CT, IDX, VAL) with optimization for ASCII and
+   8-bit Europeans characters.  Do not check validity of CT.  */
+#define CHAR_TABLE_SET(CT, IDX, VAL)                   \
+  do {                                                 \
+    if (XFASTINT (IDX) < CHAR_TABLE_SINGLE_BYTE_SLOTS) \
+      XCHAR_TABLE (CT)->contents[XFASTINT (IDX)] = VAL;        \
+    else                                               \
+      Faset (CT, IDX, VAL);                            \
+  } while (0)
+
+struct Lisp_Char_Table
+  {
+    /* This is the vector's size field, which also holds the
+       pseudovector type information.  It holds the size, too.
+       The size counts the top, defalt, purpose, and parent slots.
+       The last three are not counted if this is a sub char table.  */
+    EMACS_INT size;
+    struct Lisp_Vector *next;
+    /* This holds a flag to tell if this is a top level char table (t)
+       or a sub char table (nil).  */
+    Lisp_Object top;
+    /* This holds a default value,
+       which is used whenever the value for a specific character is nil.  */
+    Lisp_Object defalt;
+    /* This holds an actual value of each element.  A sub char table
+       has only SUB_CHAR_TABLE_ORDINARY_SLOTS number of elements.  */
+    Lisp_Object contents[CHAR_TABLE_ORDINARY_SLOTS];
+
+    /* A sub char table doesn't has the following slots.  */
+
+    /* This points to another char table, which we inherit from
+       when the value for a specific character is nil.
+       The `defalt' slot takes precedence over this.  */
+    Lisp_Object parent;
+    /* This should be a symbol which says what kind of use
+       this char-table is meant for.
+       Typically now the values can be `syntax-table' and `display-table'.  */
+    Lisp_Object purpose;
+    /* These hold additional data.  */
+    Lisp_Object extras[1];
+  };
+
+/* A boolvector is a kind of vectorlike, with contents are like a string.  */
+struct Lisp_Bool_Vector
+  {
+    /* This is the vector's size field.  It doesn't have the real size,
+       just the subtype information.  */
+    EMACS_INT vector_size;
+    struct Lisp_Vector *next;
+    /* This is the size in bits.  */
+    EMACS_INT size;
+    /* This contains the actual bits, packed into bytes.  */
+    unsigned char data[1];
+  };
+
 /* In a symbol, the markbit of the plist is used as the gc mark bit */
 
 struct Lisp_Symbol
@@ -601,6 +677,7 @@ struct Lisp_Symbol
     Lisp_Object value;
     Lisp_Object function;
     Lisp_Object plist;
+    Lisp_Object obarray;
     struct Lisp_Symbol *next;  /* -> next symbol in this obarray bucket */
   };
 
@@ -611,7 +688,7 @@ struct Lisp_Symbol
    This type is treated in most respects as a pseudovector,
    but since we never dynamically allocate or free them,
    we don't need a next-vector field.  */
-   
+
 struct Lisp_Subr
   {
     EMACS_INT size;
@@ -632,18 +709,18 @@ struct Lisp_Free
     union Lisp_Misc *chain;
   };
 
-/* In a marker, the markbit of the chain field is used as the gc mark bit */
+/* In a marker, the markbit of the chain field is used as the gc mark bit */
 struct Lisp_Marker
-  {
-    int type : 16;     /* = Lisp_Misc_Marker */
-    int spacer : 15;
-    /* 1 means normal insertion at the marker's position
-       leaves the marker after the inserted text.  */
-    int insertion_type : 1;
-    struct buffer *buffer;
-    Lisp_Object chain;
-    int bufpos;
-  };
+{
+  int type : 16;               /* = Lisp_Misc_Marker */
+  int spacer : 15;
+  /* 1 means normal insertion at the marker's position
+     leaves the marker after the inserted text.  */
+  unsigned int insertion_type : 1;
+  struct buffer *buffer;
+  Lisp_Object chain;
+  int bufpos;
+};
 
 /* Forwarding pointer to an int variable.
    This is allowed only in the value cell of a symbol,
@@ -746,18 +823,20 @@ struct Lisp_Overlay
   };
 
 /* Like Lisp_Objfwd except that value lives in a slot in the
-   current perdisplay.  */
-struct Lisp_Display_Objfwd
+   current kboard.  */
+struct Lisp_Kboard_Objfwd
   {
-    int type : 16;     /* = Lisp_Misc_Display_Objfwd */
+    int type : 16;     /* = Lisp_Misc_Kboard_Objfwd */
     int spacer : 16;
     int offset;
   };
 
 
+/* To get the type field of a union Lisp_Misc, use XMISCTYPE.
+   It uses one of these struct subtypes to get the type field.  */
+
 union Lisp_Misc
   {
-    int type : 16;
     struct Lisp_Free u_free;
     struct Lisp_Marker u_marker;
     struct Lisp_Intfwd u_intfwd;
@@ -766,16 +845,16 @@ union Lisp_Misc
     struct Lisp_Buffer_Objfwd u_buffer_objfwd;
     struct Lisp_Buffer_Local_Value u_buffer_local_value;
     struct Lisp_Overlay u_overlay;
-    struct Lisp_Display_Objfwd u_display_objfwd;
+    struct Lisp_Kboard_Objfwd u_kboard_objfwd;
   };
 \f
 #ifdef LISP_FLOAT_TYPE
 /* Optional Lisp floating point type */
 struct Lisp_Float
   {
-    Lisp_Object type;          /* essentially used for mark-bit 
+    Lisp_Object type;          /* essentially used for mark-bit
                                   and chaining when on free-list */
-    double data;  
+    double data;
   };
 #endif /* LISP_FLOAT_TYPE */
 
@@ -806,6 +885,10 @@ typedef unsigned char UCHAR;
 #define CHAR_CTL   (0x4000000)
 #define CHAR_META  (0x8000000)
 
+/* Actually, the current Emacs uses 19 bits for the character value
+   itself.  */
+#define CHARACTERBITS 19
+
 #ifdef USE_X_TOOLKIT
 #ifdef NO_UNION_TYPE
 /* Use this for turning a (void *) into a Lisp_Object, as when the
@@ -837,26 +920,37 @@ typedef unsigned char UCHAR;
 \f
 /* The glyph datatype, used to represent characters on the display.  */
 
-/* The low eight bits are the character code, and the bits above them
-   are the numeric face ID.  If FID is the face ID of a glyph on a
-   frame F, then F->display.x->faces[FID] contains the description of
-   that face.  This is an int instead of a short, so we can support a
-   good bunch of face ID's; given that we have no mechanism for
-   tossing unused frame face ID's yet, we'll probably run out of 255
-   pretty quickly.  */
+/* The low 19 bits (CHARACTERBITS) are the character code, and the
+   bits above them except for the topmost two bits are the numeric
+   face ID.  If FID is the face ID of a glyph on a frame F, then
+   F->display.x->faces[FID] contains the description of that face.
+   This is an int instead of a short, so we can support a good bunch
+   of face ID's (i.e. 2^(32 - 19 - 2) = 2048 ID's) ; given that we
+   have no mechanism for tossing unused frame face ID's yet, we'll
+   probably run out of 255 pretty quickly.  */
 #define GLYPH unsigned int
 
+/* Mask bit for a glyph of a character which should be written from
+   right to left.  */
+#define GLYPH_MASK_REV_DIR 0x80000000
+/* Mask bit for a padding glyph of a multi-column character.  */
+#define GLYPH_MASK_PADDING 0x40000000
+/* Mask bits for face.  */
+#define GLYPH_MASK_FACE    0x3FF80000
+/* Mask bits for character code.  */
+#define GLYPH_MASK_CHAR    0x0007FFFF /* The lowest 19 bits */
+
 #ifdef HAVE_FACES
 /* The FAST macros assume that we already know we're in an X window.  */
 
 /* Given a character code and a face ID, return the appropriate glyph.  */
-#define FAST_MAKE_GLYPH(char, face) ((char) | ((face) << 8))
+#define FAST_MAKE_GLYPH(char, face) ((char) | ((face) << CHARACTERBITS))
 
 /* Return a glyph's character code.  */
-#define FAST_GLYPH_CHAR(glyph) ((glyph) & 0xff)
+#define FAST_GLYPH_CHAR(glyph) ((glyph) & GLYPH_MASK_CHAR)
 
 /* Return a glyph's face ID.  */
-#define FAST_GLYPH_FACE(glyph) (((glyph) >> 8) & ((1 << 24) - 1))
+#define FAST_GLYPH_FACE(glyph) (((glyph) & GLYPH_MASK_FACE) >> CHARACTERBITS)
 
 /* Slower versions that test the frame type first.  */
 #define MAKE_GLYPH(f, char, face) (FRAME_TERMCAP_P (f) ? (char) \
@@ -865,10 +959,17 @@ typedef unsigned char UCHAR;
 #define GLYPH_FACE(f, g) (FRAME_TERMCAP_P (f) ? (0) : FAST_GLYPH_FACE (g))
 #else /* not HAVE_FACES */
 #define MAKE_GLYPH(f, char, face) (char)
-#define GLYPH_CHAR(f, g) (g)
-#define GLYPH_FACE(f, g) (g)
+#define FAST_MAKE_GLYPH(char, face) (char)
+#define GLYPH_CHAR(f, g) ((g) & GLYPH_MASK_CHAR)
+#define FAST_GLYPH_CHAR(g) ((g) & GLYPH_MASK_CHAR)
+#define GLYPH_FACE(f, g) ((g) & GLYPH_MASK_FACE)
+#define FAST_GLYPH_FACE(g) ((g) & GLYPH_MASK_FACE)
 #endif /* not HAVE_FACES */
 
+/* Return 1 iff GLYPH contains valid character code.  */
+#define GLYPH_CHAR_VALID_P(glyph) \
+  ((GLYPH) (FAST_GLYPH_CHAR (glyph)) <= MAX_CHAR)
+
 /* The ID of the mode line highlighting face.  */
 #define GLYPH_MODE_LINE_FACE 1
 \f
@@ -909,24 +1010,24 @@ typedef unsigned char UCHAR;
 #endif
 #define VECTORP(x) (VECTORLIKEP (x) && !(XVECTOR (x)->size & PSEUDOVECTOR_FLAG))
 #define GC_VECTORP(x) (GC_VECTORLIKEP (x) && !(XVECTOR (x)->size & PSEUDOVECTOR_FLAG))
-#define OVERLAYP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Overlay)
-#define GC_OVERLAYP(x) (GC_MISCP (x) && XMISC (x)->type == Lisp_Misc_Overlay)
-#define MARKERP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Marker)
-#define GC_MARKERP(x) (GC_MISCP (x) && XMISC (x)->type == Lisp_Misc_Marker)
-#define INTFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Intfwd)
-#define GC_INTFWDP(x) (GC_MISCP (x) && XMISC (x)->type == Lisp_Misc_Intfwd)
-#define BOOLFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Boolfwd)
-#define GC_BOOLFWDP(x) (GC_MISCP (x) && XMISC (x)->type == Lisp_Misc_Boolfwd)
-#define OBJFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Objfwd)
-#define GC_OBJFWDP(x) (GC_MISCP (x) && XMISC (x)->type == Lisp_Misc_Objfwd)
-#define BUFFER_OBJFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Buffer_Objfwd)
-#define GC_BUFFER_OBJFWDP(x) (GC_MISCP (x) && XMISC (x)->type == Lisp_Misc_Buffer_Objfwd)
-#define BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Buffer_Local_Value)
-#define GC_BUFFER_LOCAL_VALUEP(x) (GC_MISCP (x) && XMISC (x)->type == Lisp_Misc_Buffer_Local_Value)
-#define SOME_BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Some_Buffer_Local_Value)
-#define GC_SOME_BUFFER_LOCAL_VALUEP(x) (GC_MISCP (x) && XMISC (x)->type == Lisp_Misc_Some_Buffer_Local_Value)
-#define DISPLAY_OBJFWDP(x) (MISCP (x) && XMISC (x)->type == Lisp_Misc_Display_Objfwd)
-#define GC_DISPLAY_OBJFWDP(x) (GC_MISCP (x) && XMISC (x)->type == Lisp_Misc_Display_Objfwd)
+#define OVERLAYP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay)
+#define GC_OVERLAYP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Overlay)
+#define MARKERP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker)
+#define GC_MARKERP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Marker)
+#define INTFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Intfwd)
+#define GC_INTFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Intfwd)
+#define BOOLFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Boolfwd)
+#define GC_BOOLFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Boolfwd)
+#define OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Objfwd)
+#define GC_OBJFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Objfwd)
+#define BUFFER_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Objfwd)
+#define GC_BUFFER_OBJFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Objfwd)
+#define BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Local_Value)
+#define GC_BUFFER_LOCAL_VALUEP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Buffer_Local_Value)
+#define SOME_BUFFER_LOCAL_VALUEP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Some_Buffer_Local_Value)
+#define GC_SOME_BUFFER_LOCAL_VALUEP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Some_Buffer_Local_Value)
+#define KBOARD_OBJFWDP(x) (MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Kboard_Objfwd)
+#define GC_KBOARD_OBJFWDP(x) (GC_MISCP (x) && XMISCTYPE (x) == Lisp_Misc_Kboard_Objfwd)
 
 
 /* True if object X is a pseudovector whose code is CODE.  */
@@ -955,19 +1056,14 @@ typedef unsigned char UCHAR;
 #define GC_COMPILEDP(x) GC_PSEUDOVECTORP (x, PVEC_COMPILED)
 #define BUFFERP(x) PSEUDOVECTORP (x, PVEC_BUFFER)
 #define GC_BUFFERP(x) GC_PSEUDOVECTORP (x, PVEC_BUFFER)
-
-#ifdef MULTI_FRAME
+#define CHAR_TABLE_P(x) PSEUDOVECTORP (x, PVEC_CHAR_TABLE)
+#define GC_CHAR_TABLE_P(x) GC_PSEUDOVECTORP (x, PVEC_CHAR_TABLE)
+#define BOOL_VECTOR_P(x) PSEUDOVECTORP (x, PVEC_BOOL_VECTOR)
+#define GC_BOOL_VECTOR_P(x) GC_PSEUDOVECTORP (x, PVEC_BOOL_VECTOR)
 #define FRAMEP(x) PSEUDOVECTORP (x, PVEC_FRAME)
 #define GC_FRAMEP(x) GC_PSEUDOVECTORP (x, PVEC_FRAME)
-#else
-#ifdef HAVE_MOUSE
-/* We could use this in the !HAVE_MOUSE case also, but we prefer a compile-time
-   error message in case FRAMEP is used.  */
-#define FRAMEP(x) (EQ (x, Fselected_frame ()))
-#define GC_FRAMEP(x) (GC_EQ (x, Fselected_frame ()))
-#endif
-#endif
 
+#define SUB_CHAR_TABLE_P(x) (CHAR_TABLE_P (x) && NILP (XCHAR_TABLE (x)->top))
 \f
 #define EQ(x, y) (XFASTINT (x) == XFASTINT (y))
 #define GC_EQ(x, y) (XGCTYPE (x) == XGCTYPE (y) && XPNTR (x) == XPNTR (y))
@@ -984,9 +1080,18 @@ typedef unsigned char UCHAR;
 #define CHECK_SYMBOL(x, i) \
   do { if (!SYMBOLP ((x))) x = wrong_type_argument (Qsymbolp, (x)); } while (0)
 
+#define CHECK_CHAR_TABLE(x, i) \
+  do { if (!CHAR_TABLE_P ((x)))        \
+        x = wrong_type_argument (Qchar_table_p, (x)); } while (0)
+
 #define CHECK_VECTOR(x, i) \
   do { if (!VECTORP ((x))) x = wrong_type_argument (Qvectorp, (x)); } while (0)
 
+#define CHECK_VECTOR_OR_CHAR_TABLE(x, i)                               \
+  do { if (!VECTORP ((x)) && !CHAR_TABLE_P ((x)))                      \
+        x = wrong_type_argument (Qvector_or_char_table_p, (x));        \
+     } while (0)
+
 #define CHECK_BUFFER(x, i) \
   do { if (!BUFFERP ((x))) x = wrong_type_argument (Qbufferp, (x)); } while (0)
 
@@ -994,7 +1099,7 @@ typedef unsigned char UCHAR;
   do { if (!WINDOWP ((x))) x = wrong_type_argument (Qwindowp, (x)); } while (0)
 
 /* This macro rejects windows on the interior of the window tree as
-   "dead", which is what we want; this is an argument-checking macro, and 
+   "dead", which is what we want; this is an argument-checking macro, and
    the user should never get access to interior windows.
 
    A window of any sort, leaf or interior, is dead iff the buffer,
@@ -1129,7 +1234,7 @@ extern void defsubr ();
 extern void defvar_lisp ();
 extern void defvar_bool ();
 extern void defvar_int ();
-extern void defvar_display ();
+extern void defvar_kboard ();
 
 /* Macros we use to define forwarded Lisp variables.
    These are used in the syms_of_FILENAME functions.  */
@@ -1140,10 +1245,10 @@ extern void defvar_display ();
 #define DEFVAR_INT(lname, vname, doc) defvar_int (lname, vname)
 #define DEFVAR_PER_BUFFER(lname, vname, type, doc)  \
  defvar_per_buffer (lname, vname, type, 0)
-#define DEFVAR_DISPLAY(lname, vname, doc) \
- defvar_display (lname, \
-                (int)((char *)(&current_perdisplay->vname) \
-                      - (char *)current_perdisplay))
+#define DEFVAR_KBOARD(lname, vname, doc) \
+ defvar_kboard (lname, \
+               (int)((char *)(&current_kboard->vname) \
+                     - (char *)current_kboard))
 \f
 /* Structure for recording Lisp call stack for backtrace purposes.  */
 
@@ -1208,45 +1313,51 @@ extern char *stack_bottom;
 
 #define QUITP (!NILP (Vquit_flag) && NILP (Vinhibit_quit))
 \f
-/* 1 if CH is upper case.  */
+/* Variables used locally in the following case handling macros.  */
+extern int case_temp1;
+extern Lisp_Object case_temp2;
 
-#define UPPERCASEP(CH) \
-  (XSTRING (current_buffer->downcase_table)->data[CH] != (CH))
+/* Current buffer's map from characters to lower-case characters.  */
 
-/* 1 if CH is lower case.  */
+#define DOWNCASE_TABLE current_buffer->downcase_table
 
-#define LOWERCASEP(CH) \
-  (!UPPERCASEP (CH) \
-   && XSTRING (current_buffer->upcase_table)->data[CH] != (CH))
+/* Current buffer's map from characters to upper-case characters.  */
 
-/* 1 if CH is neither upper nor lower case.  */
+#define UPCASE_TABLE current_buffer->upcase_table
 
-#define NOCASEP(CH) (XSTRING (current_buffer->upcase_table)->data[CH] == (CH))
+/* Downcase a character, or make no change if that cannot be done.  */
 
-/* Upcase a character, or make no change if that cannot be done.  */
+#define DOWNCASE(CH)                                           \
+  ((case_temp1 = (CH),                                         \
+    case_temp2 = CHAR_TABLE_REF (DOWNCASE_TABLE, case_temp1),  \
+    NATNUMP (case_temp2))                                      \
+   ? XFASTINT (case_temp2) : case_temp1)
 
-#define UPCASE(CH) \
-  (XSTRING (current_buffer->downcase_table)->data[CH] == (CH) \
-   ? UPCASE1 (CH) : (CH))
+/* 1 if CH is upper case.  */
 
-/* Upcase a character known to be not upper case.  */
+#define UPPERCASEP(CH) (DOWNCASE (CH) != (CH))
 
-#define UPCASE1(CH) (XSTRING (current_buffer->upcase_table)->data[CH])
+/* 1 if CH is neither upper nor lower case.  */
 
-/* Downcase a character, or make no change if that cannot be done.  */
+#define NOCASEP(CH) (UPCASE1 (CH) == (CH))
 
-#define DOWNCASE(CH) (XSTRING (current_buffer->downcase_table)->data[CH])
+/* 1 if CH is lower case.  */
 
-/* Current buffer's map from characters to lower-case characters.  */
+#define LOWERCASEP(CH) (!UPPERCASEP (CH) && !NOCASEP(CH))
 
-#define DOWNCASE_TABLE XSTRING (current_buffer->downcase_table)->data
+/* Upcase a character, or make no change if that cannot be done.  */
 
-/* Table mapping each char to the next char with the same lowercase version.
-   This mapping is a no-op only for characters that don't have case.  */
-#define UPCASE_TABLE XSTRING (current_buffer->upcase_table)->data
+#define UPCASE(CH) (!UPPERCASEP (CH) ? UPCASE1 (CH) : (CH))
 
-extern Lisp_Object Vascii_downcase_table, Vascii_upcase_table;
-extern Lisp_Object Vascii_canon_table, Vascii_eqv_table;
+/* Upcase a character known to be not upper case.  */
+
+#define UPCASE1(CH)                                            \
+  ((case_temp1 = (CH),                                         \
+    case_temp2 = CHAR_TABLE_REF (UPCASE_TABLE, case_temp1),    \
+    NATNUMP (case_temp2))                                      \
+   ? XFASTINT (case_temp2) : case_temp1)
+
+extern Lisp_Object Vascii_downcase_table;
 \f
 /* Number of bytes of structure consed since last GC.  */
 
@@ -1311,7 +1422,7 @@ struct gcpro
 /* Call staticpro (&var) to protect static variable `var'.  */
 
 void staticpro();
-  
+
 #define UNGCPRO (gcprolist = gcpro1.next)
 
 /* Evaluate expr, UNGCPRO, and then return the value of expr.  */
@@ -1344,6 +1455,7 @@ extern Lisp_Object Qsymbolp, Qlistp, Qconsp;
 extern Lisp_Object Qstringp, Qarrayp, Qsequencep, Qbufferp;
 extern Lisp_Object Qchar_or_string_p, Qmarkerp, Qvectorp;
 extern Lisp_Object Qinteger_or_marker_p, Qnumber_or_marker_p;
+extern Lisp_Object Qchar_table_p, Qvector_or_char_table_p;
 extern Lisp_Object Qboundp, Qfboundp;
 extern Lisp_Object Qbuffer_or_string_p;
 extern Lisp_Object Qcdr;
@@ -1372,6 +1484,8 @@ extern Lisp_Object indirect_function (), Findirect_function ();
 extern Lisp_Object Ffset (), Fsetplist ();
 extern Lisp_Object Fsymbol_value (), find_symbol_value (), Fset ();
 extern Lisp_Object Fdefault_value (), Fset_default (), Fdefault_boundp ();
+extern Lisp_Object Fmake_local_variable ();
+extern Lisp_Object Flocal_variable_if_set_p ();
 
 extern Lisp_Object Faref (), Faset ();
 
@@ -1385,13 +1499,13 @@ extern Lisp_Object Flsh (), Fash ();
 
 extern Lisp_Object Fadd1 (), Fsub1 ();
 
-extern Lisp_Object make_number ();
 extern Lisp_Object   long_to_cons ();
 extern unsigned long cons_to_long ();
 extern void args_out_of_range ();
 extern void args_out_of_range_3 ();
 extern Lisp_Object wrong_type_argument ();
 extern void store_symval_forwarding ();
+extern Lisp_Object do_symval_forwarding ();
 #ifdef LISP_FLOAT_TYPE
 extern Lisp_Object Ffloat_to_int(), Fint_to_float();
 extern double extract_float();
@@ -1399,22 +1513,37 @@ extern Lisp_Object make_float ();
 extern Lisp_Object Ffloat ();
 #endif /* LISP_FLOAT_TYPE */
 
+/* Defined in cmds.c */
+extern Lisp_Object Fend_of_line (), Fforward_char (), Fforward_line ();
+
+/* Defined in coding.c */
+extern Lisp_Object Fcoding_system_p (), Fcheck_coding_system ();
+extern Lisp_Object Fread_coding_system (), Fread_non_nil_coding_system ();
+extern Lisp_Object Ffind_coding_system ();
+
+/* Defined in syntax.c */
+extern Lisp_Object Fforward_word ();
+
 /* Defined in fns.c */
 extern Lisp_Object Qstring_lessp;
 extern Lisp_Object Vfeatures;
 extern Lisp_Object Fidentity (), Frandom ();
-extern Lisp_Object Flength ();
+extern Lisp_Object Flength (), Fsafe_length ();
 extern Lisp_Object Fappend (), Fconcat (), Fvconcat (), Fcopy_sequence ();
 extern Lisp_Object Fsubstring ();
 extern Lisp_Object Fnth (), Fnthcdr (), Fmemq (), Fassq (), Fassoc ();
-extern Lisp_Object Fmember (), Frassq (), Fdelq (), Fsort ();
+extern Lisp_Object Felt (), Fmember (), Frassq (), Fdelq (), Fsort ();
 extern Lisp_Object Freverse (), Fnreverse (), Fget (), Fput (), Fequal ();
 extern Lisp_Object Ffillarray (), Fnconc (), Fmapcar (), Fmapconcat ();
 extern Lisp_Object Fy_or_n_p (), do_yes_or_no_p ();
 extern Lisp_Object Ffeaturep (), Frequire () , Fprovide ();
-extern Lisp_Object concat2 (), nconc2 ();
+extern Lisp_Object concat2 (), concat3 (), nconc2 ();
 extern Lisp_Object assq_no_quit ();
 extern Lisp_Object Fcopy_alist ();
+extern Lisp_Object Fplist_get ();
+extern Lisp_Object Fset_char_table_parent ();
+extern Lisp_Object Fchar_table_extra_slot ();
+extern Lisp_Object Frassoc ();
 
 /* Defined in insdel.c */
 extern void move_gap ();
@@ -1436,8 +1565,14 @@ extern void prepare_to_modify_buffer ();
 extern void signal_before_change ();
 extern void signal_after_change ();
 
+/* Defined in dispnew.c */
+extern Lisp_Object Fding (), Fredraw_display ();
+extern Lisp_Object Fsleep_for ();
+
 /* Defined in xdisp.c */
+extern Lisp_Object Vmessage_log_max;
 extern void message ();
+extern void message_nolog ();
 extern void message1 ();
 extern void message1_nolog ();
 extern void message2 ();
@@ -1455,6 +1590,9 @@ extern Lisp_Object Fpurecopy (), make_pure_string ();
 extern Lisp_Object pure_cons (), make_pure_vector ();
 extern Lisp_Object Fgarbage_collect ();
 extern Lisp_Object Fmake_byte_code ();
+extern Lisp_Object Fmake_bool_vector (), Fmake_char_table ();
+extern Lisp_Object make_sub_char_table ();
+extern Lisp_Object Qchar_table_extra_slots;
 extern struct Lisp_Vector *allocate_vectorlike ();
 extern int gc_in_progress;
 
@@ -1462,6 +1600,7 @@ extern int gc_in_progress;
 extern Lisp_Object Vprin1_to_string_buffer;
 extern Lisp_Object Fprin1 (), Fprin1_to_string (), Fprinc ();
 extern Lisp_Object Fterpri (), Fprint ();
+extern Lisp_Object Ferror_message_string ();
 extern Lisp_Object Vstandard_output, Qstandard_output;
 extern Lisp_Object Qexternal_debugging_output;
 extern void temp_output_buffer_setup (), temp_output_buffer_show ();
@@ -1476,7 +1615,7 @@ extern Lisp_Object Fintern (), Fintern_soft (), Fload ();
 extern Lisp_Object Fget_file_char (), Fread_char ();
 extern Lisp_Object read_filtered_event ();
 extern Lisp_Object Feval_current_buffer (), Feval_region ();
-extern Lisp_Object intern (), oblookup ();
+extern Lisp_Object intern (), make_symbol (), oblookup ();
 #define LOADHIST_ATTACH(x) \
  if (initialized) Vcurrent_load_list = Fcons (x, Vcurrent_load_list)
 extern Lisp_Object Vcurrent_load_list;
@@ -1488,10 +1627,17 @@ extern Lisp_Object Vinhibit_quit, Qinhibit_quit, Vquit_flag;
 extern Lisp_Object Vmocklisp_arguments, Qmocklisp, Qmocklisp_arguments;
 extern Lisp_Object Vautoload_queue;
 extern Lisp_Object Vdebug_on_error;
-/* To run a normal hook, do
+/* To run a normal hook, use the appropriate function from the list below.
+   The calling convention:
+
    if (!NILP (Vrun_hooks))
-     call1 (Vrun_hooks, Qmy_funny_hook);  */
+     call1 (Vrun_hooks, Qmy_funny_hook);
+
+   should no longer be used.  */
 extern Lisp_Object Vrun_hooks;
+extern Lisp_Object Frun_hooks (), Frun_hook_with_args ();
+extern Lisp_Object Frun_hook_with_args_until_success ();
+extern Lisp_Object Frun_hook_with_args_until_failure ();
 extern Lisp_Object Fand (), For (), Fif (), Fprogn (), Fprog1 (), Fprog2 ();
 extern Lisp_Object Fsetq (), Fquote ();
 extern Lisp_Object Fuser_variable_p (), Finteractive_p ();
@@ -1512,14 +1658,19 @@ extern Lisp_Object internal_condition_case_1 ();
 extern Lisp_Object unbind_to ();
 extern void error ();
 extern Lisp_Object un_autoload ();
+extern Lisp_Object Ffetch_bytecode ();
 
 /* Defined in editfns.c */
 extern Lisp_Object Fgoto_char ();
 extern Lisp_Object Fpoint_min_marker (), Fpoint_max_marker ();
 extern Lisp_Object Fpoint_min (), Fpoint_max ();
 extern Lisp_Object Fpoint (), Fpoint_marker (), Fmark_marker ();
+extern Lisp_Object Fline_beginning_position (), Fline_end_position ();
 extern Lisp_Object Ffollowing_char (), Fprevious_char (), Fchar_after ();
-extern Lisp_Object Finsert ();
+extern Lisp_Object Finsert (), Finsert_and_inherit ();
+extern Lisp_Object Finsert_before_markers ();
+extern Lisp_Object Finsert_buffer_substring ();
+extern Lisp_Object Finsert_char ();
 extern Lisp_Object Feolp (), Feobp (), Fbolp (), Fbobp ();
 extern Lisp_Object Fformat (), format1 ();
 extern Lisp_Object make_buffer_string (), Fbuffer_substring ();
@@ -1528,16 +1679,29 @@ extern Lisp_Object Fstring_equal (), Fstring_lessp (), Fbuffer_substring_lessp (
 extern Lisp_Object save_excursion_save (), save_restriction_save ();
 extern Lisp_Object save_excursion_restore (), save_restriction_restore ();
 extern Lisp_Object Fchar_to_string ();
+extern Lisp_Object Fdelete_region (), Fnarrow_to_region (), Fwiden ();
+extern Lisp_Object Fuser_login_name (), Fsystem_name ();
 
 /* defined in buffer.c */
+extern Lisp_Object Foverlay_start (), Foverlay_end ();
+extern void adjust_overlays_for_insert ();
+extern void adjust_overlays_for_delete ();
+extern void fix_overlays_in_range ();
+extern int overlay_touches_p ();
 extern Lisp_Object Vbuffer_alist, Vinhibit_read_only;
 extern Lisp_Object Fget_buffer (), Fget_buffer_create (), Fset_buffer ();
 extern Lisp_Object Fbarf_if_buffer_read_only ();
 extern Lisp_Object Fcurrent_buffer (), Fswitch_to_buffer (), Fpop_to_buffer ();
 extern Lisp_Object Fother_buffer ();
 extern Lisp_Object Foverlay_get ();
+extern Lisp_Object Fbuffer_modified_p (), Fset_buffer_modified_p ();
+extern Lisp_Object Fkill_buffer (), Fkill_all_local_variables ();
+extern Lisp_Object Fbuffer_disable_undo (), Fbuffer_enable_undo ();
+extern Lisp_Object Ferase_buffer ();
 extern Lisp_Object Qoverlayp;
+extern Lisp_Object get_truename_buffer ();
 extern struct buffer *all_buffers;
+extern Lisp_Object Fprevious_overlay_change ();
 
 /* defined in marker.c */
 
@@ -1554,11 +1718,15 @@ extern Lisp_Object Fsubstitute_in_file_name ();
 extern Lisp_Object Ffile_symlink_p ();
 extern Lisp_Object Fverify_visited_file_modtime ();
 extern Lisp_Object Ffile_exists_p ();
+extern Lisp_Object Ffile_name_absolute_p ();
 extern Lisp_Object Fdirectory_file_name ();
 extern Lisp_Object Ffile_name_directory ();
 extern Lisp_Object expand_and_dir_to_file ();
 extern Lisp_Object Ffile_accessible_directory_p ();
 extern Lisp_Object Funhandled_file_name_directory ();
+extern Lisp_Object Ffile_directory_p ();
+extern Lisp_Object Fwrite_region ();
+extern Lisp_Object Ffile_readable_p (), Ffile_executable_p ();
 
 /* Defined in abbrev.c */
 
@@ -1568,67 +1736,94 @@ extern Lisp_Object Vfundamental_mode_abbrev_table;
 extern Lisp_Object Fstring_match ();
 extern Lisp_Object Fscan_buffer ();
 extern void restore_match_data ();
+extern Lisp_Object Fmatch_data (), Fstore_match_data ();
+extern Lisp_Object Fmatch_beginning (), Fmatch_end ();
+extern Lisp_Object Fskip_chars_forward (), Fskip_chars_backward ();
 
 /* defined in minibuf.c */
 
 extern Lisp_Object last_minibuf_string;
-extern Lisp_Object read_minibuf (), Fcompleting_read ();
+extern Lisp_Object Fcompleting_read ();
 extern Lisp_Object Fread_from_minibuffer ();
 extern Lisp_Object Fread_variable (), Fread_buffer (), Fread_key_sequence ();
 extern Lisp_Object Fread_minibuffer (), Feval_minibuffer ();
 extern Lisp_Object Fread_string (), Fread_file_name ();
 extern Lisp_Object Fread_no_blanks_input ();
+extern Lisp_Object get_minibuffer ();
 
 /* Defined in callint.c */
 
-extern Lisp_Object Qminus, Qplus;
+extern Lisp_Object Qminus, Qplus, Vcurrent_prefix_arg;
 extern Lisp_Object Vcommand_history;
-extern Lisp_Object Qcall_interactively;
+extern Lisp_Object Qcall_interactively, Qmouse_leave_buffer_hook;
 extern Lisp_Object Fcall_interactively ();
 extern Lisp_Object Fprefix_numeric_value ();
 
 /* defined in casefiddle.c */
 
 extern Lisp_Object Fdowncase (), Fupcase (), Fcapitalize ();
+extern Lisp_Object Fupcase_region ();
+extern Lisp_Object Fupcase_initials (), Fupcase_initials_region ();
+
+/* defined in casetab.c */
+
+extern Lisp_Object Fset_case_table ();
+extern Lisp_Object Fset_standard_case_table ();
 
 /* defined in keyboard.c */
 
 extern Lisp_Object Qdisabled;
-extern Lisp_Object Vhelp_form, Vtop_level;
+extern Lisp_Object Vtty_erase_char, Vhelp_form, Vtop_level;
 extern Lisp_Object Fdiscard_input (), Frecursive_edit ();
 extern Lisp_Object Fcommand_execute (), Finput_pending_p ();
+extern Lisp_Object menu_bar_items ();
 extern Lisp_Object Qvertical_scroll_bar;
+extern Lisp_Object Fevent_convert_list ();
+#ifdef MULTI_KBOARD
+extern void delete_kboard ();
+#endif
 
 /* defined in keymap.c */
 
 extern Lisp_Object Qkeymap, Qmenu_bar;
 extern Lisp_Object current_global_map;
+extern Lisp_Object Fdefine_key ();
 extern Lisp_Object Fkey_description (), Fsingle_key_description ();
 extern Lisp_Object Fwhere_is_internal ();
 extern Lisp_Object access_keymap (), store_in_keymap ();
-extern Lisp_Object get_keyelt (), get_keymap();
+extern Lisp_Object get_keyelt (), get_keymap (), get_keymap_1 ();
+extern void describe_map_tree ();
 
 /* defined in indent.c */
 extern Lisp_Object Fvertical_motion (), Findent_to (), Fcurrent_column ();
+extern Lisp_Object Fmove_to_column ();
 
 /* defined in window.c */
 extern Lisp_Object Qwindowp, Qwindow_live_p;
+extern Lisp_Object Fselected_window ();
 extern Lisp_Object Fget_buffer_window ();
 extern Lisp_Object Fsave_window_excursion ();
 extern Lisp_Object Fset_window_configuration (), Fcurrent_window_configuration ();
 extern Lisp_Object Fcoordinates_in_window_p ();
 extern Lisp_Object Fwindow_at ();
+extern Lisp_Object Fpos_visible_in_window_p ();
 extern int window_internal_height (), window_internal_width ();
+extern Lisp_Object Frecenter ();
+extern Lisp_Object Fscroll_other_window ();
+extern Lisp_Object Fset_window_start ();
 
 /* defined in frame.c */
 extern Lisp_Object Qvisible;
+extern void store_frame_param (), store_in_alist ();
+extern Lisp_Object do_switch_frame ();
+extern Lisp_Object get_frame_param();
+extern Lisp_Object frame_buffer_predicate ();
 extern Lisp_Object Fframep ();
 extern Lisp_Object Fselect_frame ();
-extern Lisp_Object Ffocus_frame ();
-extern Lisp_Object Funfocus_frame ();
 extern Lisp_Object Fselected_frame ();
 extern Lisp_Object Fwindow_frame ();
 extern Lisp_Object Fframe_root_window ();
+extern Lisp_Object Fframe_first_window ();
 extern Lisp_Object Fframe_selected_window ();
 extern Lisp_Object Fframe_list ();
 extern Lisp_Object Fnext_frame ();
@@ -1650,9 +1845,9 @@ extern Lisp_Object Fset_frame_height ();
 extern Lisp_Object Fset_frame_width ();
 extern Lisp_Object Fset_frame_size ();
 extern Lisp_Object Fset_frame_position ();
-#ifndef HAVE_X11
-extern Lisp_Object Frubber_band_rectangle ();
-#endif /* HAVE_X11 */
+extern Lisp_Object Fraise_frame ();
+extern Lisp_Object Fredirect_frame_focus ();
+extern Lisp_Object frame_buffer_list ();
 
 /* defined in emacs.c */
 extern Lisp_Object decode_env_path ();
@@ -1670,6 +1865,7 @@ extern int running_asynch_code;
 extern Lisp_Object Fget_process (), Fget_buffer_process (), Fprocessp ();
 extern Lisp_Object Fprocess_status (), Fkill_process ();
 extern Lisp_Object Fprocess_send_eof ();
+extern Lisp_Object Fwaiting_for_user_input_p ();
 extern Lisp_Object Qprocessp;
 
 /* defined in callproc.c */
@@ -1680,6 +1876,7 @@ extern Lisp_Object Vdoc_directory;
 extern Lisp_Object Vdoc_file_name;
 extern Lisp_Object Fsubstitute_command_keys ();
 extern Lisp_Object Fdocumentation (), Fdocumentation_property ();
+extern Lisp_Object read_doc_string ();
 
 /* defined in bytecode.c */
 extern Lisp_Object Qbytecode;
@@ -1690,16 +1887,29 @@ extern Lisp_Object Qexecute_kbd_macro;
 extern Lisp_Object Fexecute_kbd_macro ();
 
 /* defined in undo.c */
+extern Lisp_Object Qinhibit_read_only;
 extern Lisp_Object Fundo_boundary ();
 extern Lisp_Object truncate_undo_list ();
 
 /* defined in textprop.c */
 extern Lisp_Object Qmodification_hooks;
-extern Lisp_Object Qrear_nonsticky;
+extern Lisp_Object Qrear_nonsticky, Qfont;
 extern Lisp_Object Qinsert_in_front_hooks, Qinsert_behind_hooks;
 extern Lisp_Object Fnext_property_change ();
 extern Lisp_Object Fnext_single_property_change ();
-
+extern Lisp_Object Fprevious_single_property_change ();
+extern Lisp_Object Fget_text_property (), Fput_text_property ();
+extern Lisp_Object Fset_text_properties ();
+extern Lisp_Object Ftext_property_not_all ();
+extern Lisp_Object Fprevious_char_property_change ();
+extern Lisp_Object Fnext_char_property_change ();
+
+/* defined in intervals.c */
+extern Lisp_Object get_local_map ();
+
+/* defined in xmenu.c */
+extern Lisp_Object Fx_popup_menu (), Fx_popup_dialog ();
+\f
 /* Nonzero means Emacs has already been initialized.
    Used during startup to detect startup of dumped Emacs.  */
 extern int initialized;
@@ -1713,7 +1923,7 @@ extern long *xmalloc (), *xrealloc ();
 extern void xfree ();
 
 extern char *egetenv ();
+
 /* Set up the name of the machine we're running on.  */
 extern void init_system_name ();
 
@@ -1721,6 +1931,10 @@ extern void init_system_name ();
    in addition to a device separator.  Default the path separator
    to '/', and don't test for a device separator in IS_ANY_SEP.  */
 
+#ifdef WINDOWSNT
+extern Lisp_Object Vdirectory_sep_char;
+#endif
+
 #ifndef DIRECTORY_SEP
 #define DIRECTORY_SEP '/'
 #endif