Commit 20280af7 authored by Jim Blandy's avatar Jim Blandy
Browse files

* 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.
parent 62056764
......@@ -153,12 +153,19 @@ enum Lisp_Type
/* Used by save,set,restore-window-configuration */
#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. */
......@@ -626,7 +633,12 @@ typedef unsigned char UCHAR;
#define FRAMEP(x) (XTYPE ((x)) == Lisp_Frame)
#define WINDOWP(x) (XTYPE ((x)) == Lisp_Window)
#define WINDOW_CONFIGURATIONP(x) (XTYPE ((x)) == Lisp_Window_Configuration)
#define FLOATP(x) (XTYPE ((x)) == Lisp_Float)
#define FLOATP(x) (0)
#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 @@ typedef unsigned char UCHAR;
#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. */
#define PNTR_COMPARISON_TYPE unsigned int
......@@ -1122,6 +1137,7 @@ 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 Qoverlayp;
extern struct buffer *all_buffers;
/* defined in marker.c */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment