aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/window.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/window.c b/src/window.c
index ecce77d6df1..dc01b2faedf 100644
--- a/src/window.c
+++ b/src/window.c
@@ -720,8 +720,21 @@ if it isn't already recorded.")
720 && XFASTINT (w->last_modified) >= MODIFF)) 720 && XFASTINT (w->last_modified) >= MODIFF))
721 { 721 {
722 int opoint = PT, opoint_byte = PT_BYTE; 722 int opoint = PT, opoint_byte = PT_BYTE;
723 TEMP_SET_PT_BOTH (XMARKER (w->start)->charpos, 723
724 XMARKER (w->start)->bytepos); 724 /* In case W->start is out of the range, use something
725 reasonable. This situation occured when loading a file with
726 `-l' containing a call to `rmail' with subsequent other
727 commands. At the end, W->start happened to be BEG, while
728 rmail had already narrowed the buffer. This leads to an
729 abort in temp_set_pt_both. */
730 if (XMARKER (w->start)->charpos < BEGV)
731 TEMP_SET_PT_BOTH (BEGV, BEGV_BYTE);
732 else if (XMARKER (w->start)->charpos > ZV)
733 TEMP_SET_PT_BOTH (ZV, ZV_BYTE);
734 else
735 TEMP_SET_PT_BOTH (XMARKER (w->start)->charpos,
736 XMARKER (w->start)->bytepos);
737
725 Fvertical_motion (make_number (window_internal_height (w)), Qnil); 738 Fvertical_motion (make_number (window_internal_height (w)), Qnil);
726 XSETINT (value, PT); 739 XSETINT (value, PT);
727 TEMP_SET_PT_BOTH (opoint, opoint_byte); 740 TEMP_SET_PT_BOTH (opoint, opoint_byte);