diff options
| author | Chong Yidong | 2007-04-15 21:50:27 +0000 |
|---|---|---|
| committer | Chong Yidong | 2007-04-15 21:50:27 +0000 |
| commit | f22611c26a83722c257eb198ac85f800d0062ec4 (patch) | |
| tree | 96205ffca8c464995505915f454606c188f423f5 /src | |
| parent | bc4aed8fbaf8bfe9ba1393299c81f85ccde4209f (diff) | |
| download | emacs-f22611c26a83722c257eb198ac85f800d0062ec4.tar.gz emacs-f22611c26a83722c257eb198ac85f800d0062ec4.zip | |
(redisplay_window): When deciding whether or not to recenter, don't
use the reset values of BEG_UNCHANGED and END_UNCHANGED.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 90977aa3d7d..9c8f7b6a814 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -12777,6 +12777,8 @@ redisplay_window (window, just_this_one_p) | |||
| 12777 | int rc; | 12777 | int rc; |
| 12778 | int centering_position = -1; | 12778 | int centering_position = -1; |
| 12779 | int last_line_misfit = 0; | 12779 | int last_line_misfit = 0; |
| 12780 | int save_beg_unchanged = BEG_UNCHANGED; | ||
| 12781 | int save_end_unchanged = END_UNCHANGED; | ||
| 12780 | 12782 | ||
| 12781 | SET_TEXT_POS (lpoint, PT, PT_BYTE); | 12783 | SET_TEXT_POS (lpoint, PT, PT_BYTE); |
| 12782 | opoint = lpoint; | 12784 | opoint = lpoint; |
| @@ -13145,11 +13147,20 @@ redisplay_window (window, just_this_one_p) | |||
| 13145 | && NILP (do_mouse_tracking) | 13147 | && NILP (do_mouse_tracking) |
| 13146 | && CHARPOS (startp) > BEGV) | 13148 | && CHARPOS (startp) > BEGV) |
| 13147 | { | 13149 | { |
| 13148 | /* Make sure beg_unchanged and end_unchanged are up to date. | 13150 | #if 0 |
| 13149 | Do it only if buffer has really changed. This may or may | 13151 | /* The following code tried to make BEG_UNCHANGED and |
| 13150 | not have been done by try_window_id (see which) already. */ | 13152 | END_UNCHANGED up to date (similar to try_window_id). |
| 13153 | Is it important to do so? | ||
| 13154 | |||
| 13155 | The trouble is that it's a little too strict when it | ||
| 13156 | comes to overlays: modify_overlay can call | ||
| 13157 | BUF_COMPUTE_UNCHANGED, which alters BUF_BEG_UNCHANGED and | ||
| 13158 | BUF_END_UNCHANGED directly without moving the gap. | ||
| 13159 | |||
| 13160 | This can result in spurious recentering when overlays are | ||
| 13161 | altered in the buffer. So unless it's proven necessary, | ||
| 13162 | let's leave this commented out for now. -- cyd. */ | ||
| 13151 | if (MODIFF > SAVE_MODIFF | 13163 | if (MODIFF > SAVE_MODIFF |
| 13152 | /* This seems to happen sometimes after saving a buffer. */ | ||
| 13153 | || BEG_UNCHANGED + END_UNCHANGED > Z_BYTE) | 13164 | || BEG_UNCHANGED + END_UNCHANGED > Z_BYTE) |
| 13154 | { | 13165 | { |
| 13155 | if (GPT - BEG < BEG_UNCHANGED) | 13166 | if (GPT - BEG < BEG_UNCHANGED) |
| @@ -13157,9 +13168,10 @@ redisplay_window (window, just_this_one_p) | |||
| 13157 | if (Z - GPT < END_UNCHANGED) | 13168 | if (Z - GPT < END_UNCHANGED) |
| 13158 | END_UNCHANGED = Z - GPT; | 13169 | END_UNCHANGED = Z - GPT; |
| 13159 | } | 13170 | } |
| 13171 | #endif | ||
| 13160 | 13172 | ||
| 13161 | if (CHARPOS (startp) > BEG + BEG_UNCHANGED | 13173 | if (CHARPOS (startp) > BEG + save_beg_unchanged |
| 13162 | && CHARPOS (startp) <= Z - END_UNCHANGED) | 13174 | && CHARPOS (startp) <= Z - save_end_unchanged) |
| 13163 | { | 13175 | { |
| 13164 | /* There doesn't seems to be a simple way to find a new | 13176 | /* There doesn't seems to be a simple way to find a new |
| 13165 | window start that is near the old window start, so | 13177 | window start that is near the old window start, so |