changeset 2193:652b38173a63

(PRINTPREPARE): Handle marker that points nowhere.
author Richard M. Stallman <rms@gnu.org>
date Mon, 15 Mar 1993 06:02:29 +0000
parents 96adb71c61ec
children 886a69457557
files src/print.c
diffstat 1 files changed, 22 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/print.c	Mon Mar 15 06:01:50 1993 +0000
+++ b/src/print.c	Mon Mar 15 06:02:29 1993 +0000
@@ -141,26 +141,30 @@
    Lisp_Object original;
 */ 
 
-#define PRINTPREPARE \
-   original = printcharfun; \
-   if (NILP (printcharfun)) printcharfun = Qt; \
-   if (XTYPE (printcharfun) == Lisp_Buffer) \
-     { if (XBUFFER (printcharfun) != current_buffer) Fset_buffer (printcharfun); \
-       printcharfun = Qnil;}\
-   if (XTYPE (printcharfun) == Lisp_Marker) \
-     { if (XMARKER (original)->buffer != current_buffer) \
-         set_buffer_internal (XMARKER (original)->buffer); \
-       old_point = point; \
-       SET_PT (marker_position (printcharfun)); \
-       start_point = point; \
+#define PRINTPREPARE						\
+   original = printcharfun;					\
+   if (NILP (printcharfun)) printcharfun = Qt;			\
+   if (XTYPE (printcharfun) == Lisp_Buffer)			\
+     { if (XBUFFER (printcharfun) != current_buffer)		\
+	 Fset_buffer (printcharfun);				\
+       printcharfun = Qnil;}					\
+   if (XTYPE (printcharfun) == Lisp_Marker)			\
+     { if (!(XMARKER (original)->buffer))			\
+         error ("Marker does not point anywhere");		\
+       if (XMARKER (original)->buffer != current_buffer)	\
+         set_buffer_internal (XMARKER (original)->buffer);	\
+       old_point = point;					\
+       SET_PT (marker_position (printcharfun));			\
+       start_point = point;					\
        printcharfun = Qnil;}
 
-#define PRINTFINISH \
-   if (XTYPE (original) == Lisp_Marker) \
-     Fset_marker (original, make_number (point), Qnil); \
-   if (old_point >= 0) \
-     SET_PT ((old_point >= start_point ? point - start_point : 0) + old_point); \
-   if (old != current_buffer) \
+#define PRINTFINISH					\
+   if (XTYPE (original) == Lisp_Marker)			\
+     Fset_marker (original, make_number (point), Qnil);	\
+   if (old_point >= 0)					\
+     SET_PT (old_point + (old_point >= start_point	\
+			  ? point - start_point : 0));	\
+   if (old != current_buffer)				\
      set_buffer_internal (old)
 
 #define PRINTCHAR(ch) printchar (ch, printcharfun)