comparison src/xdisp.c @ 10764:a3e635f3501e

(redisplay_window): If we update the mode line, switch to the buffer for real, and switch back for real.
author Richard M. Stallman <rms@gnu.org>
date Wed, 15 Feb 1995 22:23:18 +0000
parents 340ceb6ae024
children 813b186e70d8
comparison
equal deleted inserted replaced
10763:d5a22f90865d 10764:a3e635f3501e
1243 register int startp; 1243 register int startp;
1244 register int hscroll = XINT (w->hscroll); 1244 register int hscroll = XINT (w->hscroll);
1245 struct position pos; 1245 struct position pos;
1246 int opoint = PT; 1246 int opoint = PT;
1247 int tem; 1247 int tem;
1248 int window_needs_modeline; 1248 int update_mode_line;
1249 1249
1250 if (FRAME_HEIGHT (f) == 0) abort (); /* Some bug zeros some core */ 1250 if (FRAME_HEIGHT (f) == 0) abort (); /* Some bug zeros some core */
1251 1251
1252 /* If this is a combination window, do its children; that's all. */ 1252 /* If this is a combination window, do its children; that's all. */
1253 1253
1289 1289
1290 goto finish_scroll_bars; 1290 goto finish_scroll_bars;
1291 } 1291 }
1292 } 1292 }
1293 1293
1294 if (update_mode_lines) 1294 update_mode_line = (!NILP (w->update_mode_line) || update_mode_lines);
1295 w->update_mode_line = Qt;
1296 1295
1297 /* Otherwise set up data on this window; select its buffer and point value */ 1296 /* Otherwise set up data on this window; select its buffer and point value */
1298 1297
1299 set_buffer_temp (XBUFFER (w->buffer)); 1298 if (update_mode_line)
1299 set_buffer_internal (XBUFFER (w->buffer));
1300 else
1301 set_buffer_temp (XBUFFER (w->buffer));
1302
1300 opoint = PT; 1303 opoint = PT;
1301 1304
1302 /* Count number of windows showing the selected buffer. 1305 /* Count number of windows showing the selected buffer.
1303 An indirect buffer counts as its base buffer. */ 1306 An indirect buffer counts as its base buffer. */
1304 1307
1364 unless the specified location is outside the accessible range. */ 1367 unless the specified location is outside the accessible range. */
1365 if (!NILP (w->force_start)) 1368 if (!NILP (w->force_start))
1366 { 1369 {
1367 /* Forget any recorded base line for line number display. */ 1370 /* Forget any recorded base line for line number display. */
1368 w->base_line_number = Qnil; 1371 w->base_line_number = Qnil;
1369 w->update_mode_line = Qt; 1372 /* Redisplay the mode line. Select the buffer properly for that. */
1373 if (!update_mode_line)
1374 {
1375 set_buffer_temp (old);
1376 set_buffer_internal (XBUFFER (w->buffer));
1377 update_mode_line = 1;
1378 w->update_mode_line = Qt;
1379 }
1370 w->force_start = Qnil; 1380 w->force_start = Qnil;
1371 XSETFASTINT (w->last_modified, 0); 1381 XSETFASTINT (w->last_modified, 0);
1372 if (startp < BEGV) startp = BEGV; 1382 if (startp < BEGV) startp = BEGV;
1373 if (startp > ZV) startp = ZV; 1383 if (startp > ZV) startp = ZV;
1374 try_window (window, startp); 1384 try_window (window, startp);
1502 else 1512 else
1503 cancel_my_columns (w); 1513 cancel_my_columns (w);
1504 } 1514 }
1505 1515
1506 XSETFASTINT (w->last_modified, 0); 1516 XSETFASTINT (w->last_modified, 0);
1507 w->update_mode_line = Qt; 1517 /* Redisplay the mode line. Select the buffer properly for that. */
1518 if (!update_mode_line)
1519 {
1520 set_buffer_temp (old);
1521 set_buffer_internal (XBUFFER (w->buffer));
1522 update_mode_line = 1;
1523 w->update_mode_line = Qt;
1524 }
1508 1525
1509 /* Try to scroll by specified few lines */ 1526 /* Try to scroll by specified few lines */
1510 1527
1511 if (scroll_step && !clip_changed) 1528 if (scroll_step && !clip_changed)
1512 { 1529 {
1549 startp = marker_position (w->start); 1566 startp = marker_position (w->start);
1550 w->start_at_line_beg 1567 w->start_at_line_beg
1551 = (startp == BEGV || FETCH_CHAR (startp - 1) == '\n') ? Qt : Qnil; 1568 = (startp == BEGV || FETCH_CHAR (startp - 1) == '\n') ? Qt : Qnil;
1552 1569
1553 done: 1570 done:
1554 if ((!NILP (w->update_mode_line) 1571 if ((update_mode_line
1555 /* If window not full width, must redo its mode line 1572 /* If window not full width, must redo its mode line
1556 if the window to its side is being redone */ 1573 if the window to its side is being redone */
1557 || (!just_this_one && width < FRAME_WIDTH (f) - 1) 1574 || (!just_this_one && width < FRAME_WIDTH (f) - 1)
1558 || INTEGERP (w->base_line_pos) 1575 || INTEGERP (w->base_line_pos)
1559 || (!NILP (w->column_number_displayed) 1576 || (!NILP (w->column_number_displayed)
1566 w->base_line_pos = Qnil; 1583 w->base_line_pos = Qnil;
1567 w->base_line_number = Qnil; 1584 w->base_line_number = Qnil;
1568 } 1585 }
1569 1586
1570 /* When we reach a frame's selected window, redo the frame's menu bar. */ 1587 /* When we reach a frame's selected window, redo the frame's menu bar. */
1571 if (!NILP (w->update_mode_line) 1588 if (update_mode_line
1572 #ifdef USE_X_TOOLKIT 1589 #ifdef USE_X_TOOLKIT
1573 && FRAME_EXTERNAL_MENU_BAR (f) 1590 && FRAME_EXTERNAL_MENU_BAR (f)
1574 #else 1591 #else
1575 && FRAME_MENU_BAR_LINES (f) > 0 1592 && FRAME_MENU_BAR_LINES (f) > 0
1576 #endif 1593 #endif
1611 so it shouldn't be deleted at the end of redisplay. */ 1628 so it shouldn't be deleted at the end of redisplay. */
1612 (*redeem_scroll_bar_hook) (w); 1629 (*redeem_scroll_bar_hook) (w);
1613 } 1630 }
1614 1631
1615 BUF_PT (current_buffer) = opoint; 1632 BUF_PT (current_buffer) = opoint;
1616 set_buffer_temp (old); 1633 if (update_mode_line)
1634 set_buffer_internal (old);
1635 else
1636 set_buffer_temp (old);
1617 BUF_PT (current_buffer) = lpoint; 1637 BUF_PT (current_buffer) = lpoint;
1618 } 1638 }
1619 1639
1620 /* Do full redisplay on one window, starting at position `pos'. */ 1640 /* Do full redisplay on one window, starting at position `pos'. */
1621 1641