Mercurial > emacs
changeset 28869:91b54118e73c
(handle_single_display_prop): Don't try to set PT if
we're interating over a string.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Thu, 11 May 2000 09:31:42 +0000 |
parents | e62636f5d724 |
children | b3629cc23098 |
files | src/xdisp.c |
diffstat | 1 files changed, 11 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/src/xdisp.c Thu May 11 09:28:06 2000 +0000 +++ b/src/xdisp.c Thu May 11 09:31:42 2000 +0000 @@ -2314,16 +2314,22 @@ struct gcpro gcpro1; struct text_pos end_pos, pt; + GCPRO1 (form); end_pos = display_prop_end (it, object, *position); - GCPRO1 (form); /* 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; }