summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/alloc.c1
-rw-r--r--src/buffer.h3
-rw-r--r--src/fns.c3
-rw-r--r--src/print.c17
4 files changed, 21 insertions, 3 deletions
diff --git a/src/alloc.c b/src/alloc.c
index b0c120bad81..6aaa34dfc21 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1609,6 +1609,7 @@ mark_object (objptr)
case Lisp_Cons:
case Lisp_Buffer_Local_Value:
case Lisp_Some_Buffer_Local_Value:
+ case Lisp_Overlay:
{
register struct Lisp_Cons *ptr = XCONS (obj);
if (XMARKBIT (ptr->car)) break;
diff --git a/src/buffer.h b/src/buffer.h
index 34d92fd61c7..3ab666c07bf 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -370,7 +370,7 @@ extern Lisp_Object Vtransient_mark_mode;
Therefore, we cannot assume that they remain valid--we must check. */
/* 1 if the OV is a cons cell whose car is a cons cell. */
-#define OVERLAY_VALID(OV) (CONSP ((OV)) && CONSP (XCONS ((OV))->car))
+#define OVERLAY_VALID(OV) (OVERLAYP (OV))
/* Return the marker that stands for where OV starts in the buffer. */
#define OVERLAY_START(OV) (XCONS (XCONS ((OV))->car)->car)
@@ -386,7 +386,6 @@ extern Lisp_Object Vtransient_mark_mode;
((MARKERP ((P)) && XMARKER ((P))->buffer == current_buffer) \
? marker_position ((P)) : 0)
-
/* Allocation of buffer text. */
#ifdef REL_ALLOC
diff --git a/src/fns.c b/src/fns.c
index 7990bf431de..328cf984c71 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -844,7 +844,8 @@ do_cdr:
}
#endif
if (XTYPE (o1) != XTYPE (o2)) return Qnil;
- if (XTYPE (o1) == Lisp_Cons)
+ if (XTYPE (o1) == Lisp_Cons
+ || XTYPE (o1) == Lisp_Overlay)
{
Lisp_Object v1;
v1 = internal_equal (Fcar (o1), Fcar (o2), depth + 1);
diff --git a/src/print.c b/src/print.c
index ba41e46454e..23901175de1 100644
--- a/src/print.c
+++ b/src/print.c
@@ -952,6 +952,23 @@ print (obj, printcharfun, escapeflag)
}
PRINTCHAR ('>');
break;
+
+ case Lisp_Overlay:
+ strout ("#<overlay ", -1, printcharfun);
+ if (!(XMARKER (OVERLAY_START (obj))->buffer))
+ strout ("in no buffer", -1, printcharfun);
+ else
+ {
+ sprintf (buf, "from %d to %d in ",
+ marker_position (OVERLAY_START (obj)),
+ marker_position (OVERLAY_END (obj)));
+ strout (buf, -1, printcharfun);
+ print_string (XMARKER (OVERLAY_START (obj))->buffer->name,
+ printcharfun);
+ }
+ PRINTCHAR ('>');
+ break;
+
#endif /* standalone */
case Lisp_Subr: