]> code.delx.au - gnu-emacs/blobdiff - src/xdisp.c
Merge from emacs-23.
[gnu-emacs] / src / xdisp.c
index 4d0ff88f9a312f653ad8fd692e9bb6acbf2c42fe..09a3cae5754d3db343e6a2a0ec558954c70a7457 100644 (file)
@@ -3173,6 +3173,8 @@ handle_fontified_prop (struct it *it)
       val = Vfontification_functions;
       specbind (Qfontification_functions, Qnil);
 
+      xassert (it->end_charpos == ZV);
+      
       if (!CONSP (val) || EQ (XCAR (val), Qlambda))
        safe_call1 (val, pos);
       else
@@ -3212,6 +3214,13 @@ handle_fontified_prop (struct it *it)
 
       unbind_to (count, Qnil);
 
+      /* The fontification code may have added/removed text.
+        It could do even a lot worse, but let's at least protect against
+        the most obvious case where only the text past `pos' gets changed',
+        as is/was done in grep.el where some escapes sequences are turned
+        into face properties (bug#7876).  */
+      it->end_charpos = ZV;
+      
       /* Return HANDLED_RECOMPUTE_PROPS only if function fontified
         something.  This avoids an endless loop if they failed to
         fontify the text for which reason ever.  */