aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2011-01-24 17:05:52 -0500
committerStefan Monnier2011-01-24 17:05:52 -0500
commitf996bbcb94dd456d0c5644885e8269f396b54707 (patch)
treec6c601367ab5e94cd62e994f660e8f9e65498d10 /src
parent10e1d5f30f7ccb099106a3644776ed68db98b2d7 (diff)
downloademacs-f996bbcb94dd456d0c5644885e8269f396b54707.tar.gz
emacs-f996bbcb94dd456d0c5644885e8269f396b54707.zip
* xdisp.c (handle_fontified_prop): Be careful with font-lock changing
the buffer's point-max. Fixes: debbugs:7876
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/xdisp.c9
2 files changed, 14 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 297ea12aee7..0539b849efc 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12011-01-24 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * xdisp.c (handle_fontified_prop): Be careful with font-lock changing
4 the buffer's point-max (bug#7876).
5
12011-01-23 Chong Yidong <cyd@stupidchicken.com> 62011-01-23 Chong Yidong <cyd@stupidchicken.com>
2 7
3 * lisp.h (XPNTR): Obey DATA_SEG_BITS in all non-USE_LSB_TAG cases. 8 * lisp.h (XPNTR): Obey DATA_SEG_BITS in all non-USE_LSB_TAG cases.
diff --git a/src/xdisp.c b/src/xdisp.c
index 219150b9f97..d625b05075d 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -3337,6 +3337,8 @@ handle_fontified_prop (it)
3337 val = Vfontification_functions; 3337 val = Vfontification_functions;
3338 specbind (Qfontification_functions, Qnil); 3338 specbind (Qfontification_functions, Qnil);
3339 3339
3340 xassert (it->end_charpos == ZV);
3341
3340 if (!CONSP (val) || EQ (XCAR (val), Qlambda)) 3342 if (!CONSP (val) || EQ (XCAR (val), Qlambda))
3341 safe_call1 (val, pos); 3343 safe_call1 (val, pos);
3342 else 3344 else
@@ -3376,6 +3378,13 @@ handle_fontified_prop (it)
3376 3378
3377 unbind_to (count, Qnil); 3379 unbind_to (count, Qnil);
3378 3380
3381 /* The fontification code may have added/removed text.
3382 It could do even a lot worse, but let's at least protect against
3383 the most obvious case where only the text past `pos' gets changed',
3384 as is/was done in grep.el where some escapes sequences are turned
3385 into face properties (bug#7876). */
3386 it->end_charpos = ZV;
3387
3379 /* Return HANDLED_RECOMPUTE_PROPS only if function fontified 3388 /* Return HANDLED_RECOMPUTE_PROPS only if function fontified
3380 something. This avoids an endless loop if they failed to 3389 something. This avoids an endless loop if they failed to
3381 fontify the text for which reason ever. */ 3390 fontify the text for which reason ever. */