Commit cdaa87fd authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(PRINTPREPARE): Handle marker that points nowhere.

parent 7cf2444d
......@@ -145,10 +145,13 @@ glyph_to_str_cpy (glyphs, str)
original = printcharfun; \
if (NILP (printcharfun)) printcharfun = Qt; \
if (XTYPE (printcharfun) == Lisp_Buffer) \
{ if (XBUFFER (printcharfun) != current_buffer) Fset_buffer (printcharfun); \
printcharfun = Qnil;}\
{ if (XBUFFER (printcharfun) != current_buffer) \
Fset_buffer (printcharfun); \
printcharfun = Qnil;} \
if (XTYPE (printcharfun) == Lisp_Marker) \
{ if (XMARKER (original)->buffer != current_buffer) \
{ 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)); \
......@@ -159,7 +162,8 @@ glyph_to_str_cpy (glyphs, str)
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); \
SET_PT (old_point + (old_point >= start_point \
? point - start_point : 0)); \
if (old != current_buffer) \
set_buffer_internal (old)
......
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