diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2007-08-06 17:23:03 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2007-08-06 17:23:03 +0000 |
commit | 4768bcf144aba88676cc5644a8ea690ef8872227 (patch) | |
tree | a4cbadd2f636d53448701dfb1f6bd2ff878a43c7 /src/xdisp.c | |
parent | 957d4071e1fd094a3bd416717ad661204d29fb31 (diff) | |
download | emacs-4768bcf144aba88676cc5644a8ea690ef8872227.tar.gz |
(redisplay_window): When restoring original buffer position, make sure
it is still valid.
Diffstat (limited to 'src/xdisp.c')
-rw-r--r-- | src/xdisp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 46247beb10f..1dd69e34590 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13520,7 +13520,10 @@ redisplay_window (window, just_this_one_p) /* Restore current_buffer and value of point in it. */ TEMP_SET_PT_BOTH (CHARPOS (opoint), BYTEPOS (opoint)); set_buffer_internal_1 (old); - TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint)); + /* Avoid an abort in TEMP_SET_PT_BOTH if the buffer has become + shorter. This can be caused by log truncation in *Messages*. */ + if (CHARPOS (lpoint) <= ZV) + TEMP_SET_PT_BOTH (CHARPOS (lpoint), BYTEPOS (lpoint)); unbind_to (count, Qnil); } |