aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1994-05-06 01:49:51 +0000
committerKarl Heuer1994-05-06 01:49:51 +0000
commit00d3d838ef0eb27a289f1ba89a10a50fa060d7f4 (patch)
treecde9aa423e7edc3d564e6429678ccfcaf2ff9cb9 /src
parent5ce7b543437b8d528e62f4837c7966af5b4e186c (diff)
downloademacs-00d3d838ef0eb27a289f1ba89a10a50fa060d7f4.tar.gz
emacs-00d3d838ef0eb27a289f1ba89a10a50fa060d7f4.zip
(Fdelete_other_windows): Do nothing if w->start is outside region.
Don't temporarily move point when recomputing window position.
Diffstat (limited to 'src')
-rw-r--r--src/window.c40
1 files changed, 26 insertions, 14 deletions
diff --git a/src/window.c b/src/window.c
index c8e0988c387..ce0b05339ee 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1346,8 +1346,7 @@ value is reasonable when this function is called.")
1346 Lisp_Object window; 1346 Lisp_Object window;
1347{ 1347{
1348 struct window *w; 1348 struct window *w;
1349 struct buffer *obuf = current_buffer; 1349 int startpos;
1350 int opoint;
1351 int top; 1350 int top;
1352 1351
1353 if (NILP (window)) 1352 if (NILP (window))
@@ -1356,21 +1355,34 @@ value is reasonable when this function is called.")
1356 CHECK_LIVE_WINDOW (window, 0); 1355 CHECK_LIVE_WINDOW (window, 0);
1357 1356
1358 w = XWINDOW (window); 1357 w = XWINDOW (window);
1359 top = XFASTINT (w->top); 1358 startpos = marker_position (w->start);
1359 top = XFASTINT (w->top) - FRAME_MENU_BAR_LINES (XFRAME (WINDOW_FRAME (w)));
1360 1360
1361 window_loop (DELETE_OTHER_WINDOWS, window, 0, WINDOW_FRAME (w)); 1361 window_loop (DELETE_OTHER_WINDOWS, window, 0, WINDOW_FRAME (w));
1362 1362
1363 Fset_buffer (w->buffer); 1363 /* Try to minimize scrolling, by setting the window start to the point
1364 opoint = PT; 1364 will cause the text at the old window start to be at the same place
1365 SET_PT (marker_position (w->start)); 1365 on the frame. But don't try to do this if the window start is
1366 /* Like Frecenter but avoid setting w->force_start. */ 1366 outside the visible portion (as might happen when the display is
1367 Fvertical_motion (make_number (- (top - FRAME_MENU_BAR_LINES (XFRAME (WINDOW_FRAME (w))))), 1367 not current, due to typeahead). */
1368 window); 1368 if (startpos >= BUF_BEGV (XBUFFER (w->buffer))
1369 Fset_marker (w->start, make_number (PT), w->buffer); 1369 && startpos <= BUF_ZV (XBUFFER (w->buffer)))
1370 w->start_at_line_beg = Fbolp (); 1370 {
1371 1371 struct position pos;
1372 SET_PT (opoint); 1372 struct buffer *obuf = current_buffer;
1373 set_buffer_internal (obuf); 1373
1374 Fset_buffer (w->buffer);
1375 /* This computation used to temporarily move point, but that can
1376 have unwanted side effects due to text properties. */
1377 pos = *vmotion (startpos, -top, window_internal_width (w) - 1,
1378 XINT (w->hscroll), window);
1379 Fset_marker (w->start, make_number (pos.bufpos), w->buffer);
1380 w->start_at_line_beg = ((pos.bufpos == BEGV
1381 || FETCH_CHAR (pos.bufpos - 1) == '\n') ? Qt
1382 : Qnil);
1383
1384 set_buffer_internal (obuf);
1385 }
1374 return Qnil; 1386 return Qnil;
1375} 1387}
1376 1388