aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-08-02 01:31:07 +0000
committerRichard M. Stallman1994-08-02 01:31:07 +0000
commitf67a0f51a55bfab32b772a387160398c6399aa34 (patch)
tree5076ad3d3392b52980781b374394ab6a3fbc98ee /src
parentbfc77306f5aee1e0f4c84660d01f24015baaf5ff (diff)
downloademacs-f67a0f51a55bfab32b772a387160398c6399aa34.tar.gz
emacs-f67a0f51a55bfab32b772a387160398c6399aa34.zip
(redisplay_window): Avoid using SET_PT to change point temporarily.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index edb2f7caacd..1e1ae928f8f 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1069,17 +1069,19 @@ redisplay_window (window, just_this_one)
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. */
@@ -1112,7 +1114,7 @@ redisplay_window (window, just_this_one)
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
@@ -1331,9 +1333,9 @@ done:
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'. */