# HG changeset patch # User Chong Yidong # Date 1186421130 0 # Node ID 1830de49a52aa0e473c15d97dd1e2f11ea3fcbd8 # Parent 047f17a0a67f35eab50f80ac5e2275c2e8f33dec (redisplay_window): When restoring original buffer position, make sure it is still valid. diff -r 047f17a0a67f -r 1830de49a52a src/xdisp.c --- a/src/xdisp.c Mon Aug 06 17:25:20 2007 +0000 +++ b/src/xdisp.c Mon Aug 06 17:25:30 2007 +0000 @@ -13520,7 +13520,10 @@ /* 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); }