aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2010-05-27 11:49:01 -0400
committerChong Yidong2010-05-27 11:49:01 -0400
commitf44a59e61a98543d4ce8b6952f1946dd955ce988 (patch)
tree8d5c246400cfa525fd239b4c0533987f6f0221b0 /src
parentecb0ab90c41745fa95741291288ea22c7bc7561b (diff)
downloademacs-f44a59e61a98543d4ce8b6952f1946dd955ce988.tar.gz
emacs-f44a59e61a98543d4ce8b6952f1946dd955ce988.zip
Fix redisplay crash (Bug#6177).
* xdisp.c (redisplay_window): After redisplay, check if point is still valid before setting it (Bug#6177).
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/xdisp.c12
2 files changed, 15 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d7128960af7..883d603bf35 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12010-05-27 Chong Yidong <cyd@stupidchicken.com>
2
3 * xdisp.c (redisplay_window): After redisplay, check if point is
4 still valid before setting it (Bug#6177).
5
12010-05-27 Glenn Morris <rgm@gnu.org> 62010-05-27 Glenn Morris <rgm@gnu.org>
2 7
3 * Makefile.in, autodeps.mk, deps.mk, ns.mk: 8 * Makefile.in, autodeps.mk, deps.mk, ns.mk:
diff --git a/src/xdisp.c b/src/xdisp.c
index 699f375e2f4..31fa5f39d5f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -14788,8 +14788,16 @@ redisplay_window (window, just_this_one_p)
14788 (*FRAME_TERMINAL (f)->redeem_scroll_bar_hook) (w); 14788 (*FRAME_TERMINAL (f)->redeem_scroll_bar_hook) (w);
14789 } 14789 }
14790 14790
14791 /* Restore current_buffer and value of point in it. */ 14791 /* Restore current_buffer and value of point in it. The window
14792 TEMP_SET_PT_BOTH (CHARPOS (opoint), BYTEPOS (opoint)); 14792 update may have changed the buffer, so first make sure `opoint'
14793 is still valid (Bug#6177). */
14794 if (CHARPOS (opoint) < BEGV)
14795 TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE);
14796 else if (CHARPOS (opoint) > ZV)
14797 TEMP_SET_PT_BOTH (Z, Z_BYTE);
14798 else
14799 TEMP_SET_PT_BOTH (CHARPOS (opoint), BYTEPOS (opoint));
14800
14793 set_buffer_internal_1 (old); 14801 set_buffer_internal_1 (old);
14794 /* Avoid an abort in TEMP_SET_PT_BOTH if the buffer has become 14802 /* Avoid an abort in TEMP_SET_PT_BOTH if the buffer has become
14795 shorter. This can be caused by log truncation in *Messages*. */ 14803 shorter. This can be caused by log truncation in *Messages*. */