From c7aca1ad8e41f26e9166056c04e523d38c00fb87 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Thu, 11 May 2000 09:31:42 +0000 Subject: [PATCH] (handle_single_display_prop): Don't try to set PT if we're interating over a string. --- src/xdisp.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index f377a9b61d6..46bf091230f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -2314,16 +2314,22 @@ handle_single_display_prop (it, prop, object, position) struct gcpro gcpro1; struct text_pos end_pos, pt; - end_pos = display_prop_end (it, object, *position); GCPRO1 (form); + end_pos = display_prop_end (it, object, *position); /* Temporarily set point to the end position, and then evaluate the form. This makes `(eolp)' work as FORM. */ - CHARPOS (pt) = PT; - BYTEPOS (pt) = PT_BYTE; - TEMP_SET_PT_BOTH (CHARPOS (end_pos), BYTEPOS (end_pos)); + if (BUFFERP (object)) + { + CHARPOS (pt) = PT; + BYTEPOS (pt) = PT_BYTE; + TEMP_SET_PT_BOTH (CHARPOS (end_pos), BYTEPOS (end_pos)); + } + form = eval_form (form); - TEMP_SET_PT_BOTH (CHARPOS (pt), BYTEPOS (pt)); + + if (BUFFERP (object)) + TEMP_SET_PT_BOTH (CHARPOS (pt), BYTEPOS (pt)); UNGCPRO; } -- 2.39.5