changeset 2780:cfe7659bbc05

* lisp.h (Lisp_Overlay): New tag. (OVERLAYP): New predicate. (CHECK_OVERLAY): New type-checker. (Qoverlayp): New extern declaration. * buffer.c (Foverlayp): New function. (Qoverlayp): New atom. (overlays_at, recenter_overlay_lists): Abort if we encounter an invalid overlay. (syms_of_buffer): defsubr Soverlayp; initialize Qoverlayp. (Fdelete_overlay): Set the overlay's markers to point nowhere. Use CHECK_OVERLAY instead of signalling a special error. (Fmove_overlay, Foverlay_put): Use CHECK_OVERLAY instead of signalling a special error. (Foverlay_get): Use CHECK_OVERLAY. * fns.c (internal_equal): Define this for overlays. * buffer.h (OVERLAY_VALID): Define in terms of OVERLAYP. * print.c (print): Give overlays their own print syntax. * alloc.c (mark_object): Treat overlays like conses. * lisp.h (FLOATP): Define this appropriately when LISP_FLOAT_TYPE is not defined.
author Jim Blandy <jimb@redhat.com>
date Fri, 14 May 1993 14:41:36 +0000
parents 857bb0f59668
children fde05936aebb
files src/lisp.h
diffstat 1 files changed, 19 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/lisp.h	Fri May 14 14:40:56 1993 +0000
+++ b/src/lisp.h	Fri May 14 14:41:36 1993 +0000
@@ -153,12 +153,19 @@
     Lisp_Window,
 
     /* Used by save,set,restore-window-configuration */
-    Lisp_Window_Configuration
+    Lisp_Window_Configuration,
 
 #ifdef LISP_FLOAT_TYPE
-      ,
-    Lisp_Float
+    Lisp_Float,
 #endif /* LISP_FLOAT_TYPE */
+
+    /* The overlay type.
+       An overlay values is actually a retagged cons, the first in a
+       list of the form
+           ((START . END) nil . PLIST)
+       where START and END are markers in the overlay's buffer, and
+       PLIST is the overlay's property list.  */
+    Lisp_Overlay
   };
 
 #ifndef NO_UNION_TYPE
@@ -626,7 +633,12 @@
 #define FRAMEP(x) (XTYPE ((x)) == Lisp_Frame)
 #define WINDOWP(x) (XTYPE ((x)) == Lisp_Window)
 #define WINDOW_CONFIGURATIONP(x) (XTYPE ((x)) == Lisp_Window_Configuration)
+#ifdef LISP_FLOAT_TYPE
 #define FLOATP(x) (XTYPE ((x)) == Lisp_Float)
+#else
+#define FLOATP(x) (0)
+#endif
+#define OVERLAYP(x) (XTYPE ((x)) == Lisp_Overlay)
 
 #define EQ(x, y) (XFASTINT (x) == XFASTINT (y))
 #define GC_EQ(x, y) (XGCTYPE (x) == XGCTYPE (y) && XPNTR (x) == XPNTR (y))
@@ -713,6 +725,9 @@
 #define XFLOATINT(n) XINT((n))
 #endif /* LISP_FLOAT_TYPE */
 
+#define CHECK_OVERLAY(x, i) \
+  { if (XTYPE ((x)) != Lisp_Overlay) x = wrong_type_argument (Qoverlayp, (x));}
+
 /* Cast pointers to this type to compare them.  Some machines want int.  */
 #ifndef PNTR_COMPARISON_TYPE
 #define PNTR_COMPARISON_TYPE unsigned int
@@ -1122,6 +1137,7 @@
 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 Qoverlayp;
 extern struct buffer *all_buffers;
 
 /* defined in marker.c */