From: Gerd Moellmann Date: Thu, 11 May 2000 09:31:42 +0000 (+0000) Subject: (handle_single_display_prop): Don't try to set PT if X-Git-Tag: emacs-pretest-21.0.90~3998 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c7aca1ad8e41f26e9166056c04e523d38c00fb87;p=emacs.git (handle_single_display_prop): Don't try to set PT if we're interating over a string. --- 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; }