aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2001-08-30 12:14:48 +0000
committerGerd Moellmann2001-08-30 12:14:48 +0000
commitb384d6f81390b88206d61e7075e2017ec6ccdd1c (patch)
treef2d87a4e36c0475d738a3ef28482062f6bdb77f4
parent5fd2dcb8ca2e73f77703a29ec4c5a2fffb4968eb (diff)
downloademacs-b384d6f81390b88206d61e7075e2017ec6ccdd1c.tar.gz
emacs-b384d6f81390b88206d61e7075e2017ec6ccdd1c.zip
(Qbuffer_position, Qposition, Qobject): New variables.
(syms_of_xdisp): Initialize them. (handle_single_display_prop): Don't change point, bind `object', `position', and `buffer-position' instead to the object having the `display' property, position in the object and position in the buffer.
-rw-r--r--src/xdisp.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index b7b9712f479..8b3fc8ea654 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -227,6 +227,7 @@ Lisp_Object QCeval, Qwhen, QCfile, QCdata;
227Lisp_Object Qfontified; 227Lisp_Object Qfontified;
228Lisp_Object Qgrow_only; 228Lisp_Object Qgrow_only;
229Lisp_Object Qinhibit_eval_during_redisplay; 229Lisp_Object Qinhibit_eval_during_redisplay;
230Lisp_Object Qbuffer_position, Qposition, Qobject;
230 231
231/* Functions called to fontify regions of text. */ 232/* Functions called to fontify regions of text. */
232 233
@@ -2815,26 +2816,22 @@ handle_single_display_prop (it, prop, object, position,
2815 2816
2816 if (!NILP (form) && !EQ (form, Qt)) 2817 if (!NILP (form) && !EQ (form, Qt))
2817 { 2818 {
2819 int count = BINDING_STACK_SIZE ();
2818 struct gcpro gcpro1; 2820 struct gcpro gcpro1;
2819 struct text_pos end_pos, pt;
2820
2821 GCPRO1 (form);
2822 end_pos = display_prop_end (it, object, *position);
2823 2821
2824 /* Temporarily set point to the end position, and then evaluate 2822 /* Bind `object' to the object having the `display' property, a
2825 the form. This makes `(eolp)' work as FORM. */ 2823 buffer or string. Bind `position' to the position in the
2826 if (BUFFERP (object)) 2824 object where the property was found, and `buffer-position'
2827 { 2825 to the current position in the buffer. */
2828 CHARPOS (pt) = PT; 2826 specbind (Qobject, object);
2829 BYTEPOS (pt) = PT_BYTE; 2827 specbind (Qposition, CHARPOS (*position));
2830 TEMP_SET_PT_BOTH (CHARPOS (end_pos), BYTEPOS (end_pos)); 2828 specbind (Qbuffer_position, (STRINGP (object)
2831 } 2829 ? make_number (IT_CHARPOS (*it))
2832 2830 : make_number (CHARPOS (*position))));
2831 GCPRO1 (form);
2833 form = safe_eval (form); 2832 form = safe_eval (form);
2834 2833 UNGCPRO;
2835 if (BUFFERP (object)) 2834 unbind_to (count, Qnil);
2836 TEMP_SET_PT_BOTH (CHARPOS (pt), BYTEPOS (pt));
2837 UNGCPRO;
2838 } 2835 }
2839 2836
2840 if (NILP (form)) 2837 if (NILP (form))
@@ -14587,6 +14584,12 @@ syms_of_xdisp ()
14587 staticpro (&Qinhibit_menubar_update); 14584 staticpro (&Qinhibit_menubar_update);
14588 Qinhibit_eval_during_redisplay = intern ("inhibit-eval-during-redisplay"); 14585 Qinhibit_eval_during_redisplay = intern ("inhibit-eval-during-redisplay");
14589 staticpro (&Qinhibit_eval_during_redisplay); 14586 staticpro (&Qinhibit_eval_during_redisplay);
14587 Qposition = intern ("position");
14588 staticpro (&Qposition);
14589 Qbuffer_position = intern ("buffer-position");
14590 staticpro (&Qbuffer_position);
14591 Qobject = intern ("object");
14592 staticpro (&Qobject);
14590 14593
14591 last_arrow_position = Qnil; 14594 last_arrow_position = Qnil;
14592 last_arrow_string = Qnil; 14595 last_arrow_string = Qnil;