diff options
| author | Chong Yidong | 2010-05-27 11:42:50 -0400 |
|---|---|---|
| committer | Chong Yidong | 2010-05-27 11:42:50 -0400 |
| commit | 5ca3929b197ff0bc2db24635228f07653836a3b8 (patch) | |
| tree | 42ed0f3735131ede41e231402edbec515424b8d0 | |
| parent | 4da3541bbe03a21225fd0d409c54b2fc3778c6ee (diff) | |
| download | emacs-5ca3929b197ff0bc2db24635228f07653836a3b8.tar.gz emacs-5ca3929b197ff0bc2db24635228f07653836a3b8.zip | |
* xdisp.c (redisplay_window): After redisplay, check if point is
still valid before setting it (Bug#6177).
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/xdisp.c | 12 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ddf73eaf3c5..a4a9e041879 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2010-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 | |||
| 1 | 2010-05-20 enami tsugutomo <tsugutomo.enami@jp.sony.com> | 6 | 2010-05-20 enami tsugutomo <tsugutomo.enami@jp.sony.com> |
| 2 | 7 | ||
| 3 | * s/netbsd.h: If terminfo is found, use it in preference to | 8 | * s/netbsd.h: If terminfo is found, use it in preference to |
diff --git a/src/xdisp.c b/src/xdisp.c index 734b60bc1dd..7dcdf19431a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -13936,8 +13936,16 @@ redisplay_window (window, just_this_one_p) | |||
| 13936 | (*FRAME_TERMINAL (f)->redeem_scroll_bar_hook) (w); | 13936 | (*FRAME_TERMINAL (f)->redeem_scroll_bar_hook) (w); |
| 13937 | } | 13937 | } |
| 13938 | 13938 | ||
| 13939 | /* Restore current_buffer and value of point in it. */ | 13939 | /* Restore current_buffer and value of point in it. The window |
| 13940 | TEMP_SET_PT_BOTH (CHARPOS (opoint), BYTEPOS (opoint)); | 13940 | update may have changed the buffer, so first make sure `opoint' |
| 13941 | is still valid (Bug#6177). */ | ||
| 13942 | if (CHARPOS (opoint) < BEGV) | ||
| 13943 | TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE); | ||
| 13944 | else if (CHARPOS (opoint) > ZV) | ||
| 13945 | TEMP_SET_PT_BOTH (Z, Z_BYTE); | ||
| 13946 | else | ||
| 13947 | TEMP_SET_PT_BOTH (CHARPOS (opoint), BYTEPOS (opoint)); | ||
| 13948 | |||
| 13941 | set_buffer_internal_1 (old); | 13949 | set_buffer_internal_1 (old); |
| 13942 | /* Avoid an abort in TEMP_SET_PT_BOTH if the buffer has become | 13950 | /* Avoid an abort in TEMP_SET_PT_BOTH if the buffer has become |
| 13943 | shorter. This can be caused by log truncation in *Messages*. */ | 13951 | shorter. This can be caused by log truncation in *Messages*. */ |