diff options
| author | Stefan Monnier | 2011-01-24 17:05:52 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2011-01-24 17:05:52 -0500 |
| commit | f996bbcb94dd456d0c5644885e8269f396b54707 (patch) | |
| tree | c6c601367ab5e94cd62e994f660e8f9e65498d10 /src | |
| parent | 10e1d5f30f7ccb099106a3644776ed68db98b2d7 (diff) | |
| download | emacs-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/ChangeLog | 5 | ||||
| -rw-r--r-- | src/xdisp.c | 9 |
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 @@ | |||
| 1 | 2011-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 | |||
| 1 | 2011-01-23 Chong Yidong <cyd@stupidchicken.com> | 6 | 2011-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. */ |