Mercurial > emacs
diff 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 |
line wrap: on
line diff
--- a/src/xdisp.c Tue Aug 02 01:29:20 1994 +0000 +++ b/src/xdisp.c Tue Aug 02 01:31:07 1994 +0000 @@ -1069,17 +1069,19 @@ if (!EQ (window, selected_window)) { - SET_PT (marker_position (w->pointm)); - if (PT < BEGV) + int new_pt = marker_position (w->pointm); + if (new_pt < BEGV) { - SET_PT (BEGV); - Fset_marker (w->pointm, make_number (PT), Qnil); + new_pt = BEGV; + Fset_marker (w->pointm, make_number (new_pt), Qnil); } - else if (PT > (ZV - 1)) + else if (new_pt > (ZV - 1)) { - SET_PT (ZV); - Fset_marker (w->pointm, make_number (PT), Qnil); + new_pt = ZV; + Fset_marker (w->pointm, make_number (new_pt), Qnil); } + /* We don't use SET_PT so that the point-motion hooks don't run. */ + BUF_PT (current_buffer) = new_pt; } /* If window-start is screwed up, choose a new one. */ @@ -1112,7 +1114,7 @@ ZV, height / 2, - (1 << (SHORTBITS - 1)), width, hscroll, pos_tab_offset (w, startp), w); - SET_PT (pos.bufpos); + BUF_PT (current_buffer) = pos.bufpos; if (w != XWINDOW (selected_window)) Fset_marker (w->pointm, make_number (PT), Qnil); else @@ -1331,9 +1333,9 @@ (*redeem_scroll_bar_hook) (w); } - SET_PT (opoint); + BUF_PT (current_buffer) = opoint; current_buffer = old; - SET_PT (lpoint); + BUF_PT (current_buffer) = lpoint; } /* Do full redisplay on one window, starting at position `pos'. */