Mercurial > emacs
comparison src/xdisp.c @ 8417:3f2854a14982
(redisplay_window): Avoid using SET_PT to change point temporarily.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 02 Aug 1994 01:31:07 +0000 |
parents | 1c42688133ee |
children | 64c299dd51b8 |
comparison
equal
deleted
inserted
replaced
8416:31a71761eeae | 8417:3f2854a14982 |
---|---|
1067 /* POINT refers normally to the selected window. | 1067 /* POINT refers normally to the selected window. |
1068 For any other window, set up appropriate value. */ | 1068 For any other window, set up appropriate value. */ |
1069 | 1069 |
1070 if (!EQ (window, selected_window)) | 1070 if (!EQ (window, selected_window)) |
1071 { | 1071 { |
1072 SET_PT (marker_position (w->pointm)); | 1072 int new_pt = marker_position (w->pointm); |
1073 if (PT < BEGV) | 1073 if (new_pt < BEGV) |
1074 { | 1074 { |
1075 SET_PT (BEGV); | 1075 new_pt = BEGV; |
1076 Fset_marker (w->pointm, make_number (PT), Qnil); | 1076 Fset_marker (w->pointm, make_number (new_pt), Qnil); |
1077 } | 1077 } |
1078 else if (PT > (ZV - 1)) | 1078 else if (new_pt > (ZV - 1)) |
1079 { | 1079 { |
1080 SET_PT (ZV); | 1080 new_pt = ZV; |
1081 Fset_marker (w->pointm, make_number (PT), Qnil); | 1081 Fset_marker (w->pointm, make_number (new_pt), Qnil); |
1082 } | 1082 } |
1083 /* We don't use SET_PT so that the point-motion hooks don't run. */ | |
1084 BUF_PT (current_buffer) = new_pt; | |
1083 } | 1085 } |
1084 | 1086 |
1085 /* If window-start is screwed up, choose a new one. */ | 1087 /* If window-start is screwed up, choose a new one. */ |
1086 if (XMARKER (w->start)->buffer != current_buffer) | 1088 if (XMARKER (w->start)->buffer != current_buffer) |
1087 goto recenter; | 1089 goto recenter; |
1110 + | 1112 + |
1111 (hscroll ? 1 - hscroll : 0), | 1113 (hscroll ? 1 - hscroll : 0), |
1112 ZV, height / 2, | 1114 ZV, height / 2, |
1113 - (1 << (SHORTBITS - 1)), | 1115 - (1 << (SHORTBITS - 1)), |
1114 width, hscroll, pos_tab_offset (w, startp), w); | 1116 width, hscroll, pos_tab_offset (w, startp), w); |
1115 SET_PT (pos.bufpos); | 1117 BUF_PT (current_buffer) = pos.bufpos; |
1116 if (w != XWINDOW (selected_window)) | 1118 if (w != XWINDOW (selected_window)) |
1117 Fset_marker (w->pointm, make_number (PT), Qnil); | 1119 Fset_marker (w->pointm, make_number (PT), Qnil); |
1118 else | 1120 else |
1119 { | 1121 { |
1120 if (current_buffer == old) | 1122 if (current_buffer == old) |
1329 /* Note that we actually used the scroll bar attached to this window, | 1331 /* Note that we actually used the scroll bar attached to this window, |
1330 so it shouldn't be deleted at the end of redisplay. */ | 1332 so it shouldn't be deleted at the end of redisplay. */ |
1331 (*redeem_scroll_bar_hook) (w); | 1333 (*redeem_scroll_bar_hook) (w); |
1332 } | 1334 } |
1333 | 1335 |
1334 SET_PT (opoint); | 1336 BUF_PT (current_buffer) = opoint; |
1335 current_buffer = old; | 1337 current_buffer = old; |
1336 SET_PT (lpoint); | 1338 BUF_PT (current_buffer) = lpoint; |
1337 } | 1339 } |
1338 | 1340 |
1339 /* Do full redisplay on one window, starting at position `pos'. */ | 1341 /* Do full redisplay on one window, starting at position `pos'. */ |
1340 | 1342 |
1341 static void | 1343 static void |