diff options
| author | Richard M. Stallman | 1996-06-28 08:10:29 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-06-28 08:10:29 +0000 |
| commit | 538f13d4d76bccdd18184098c90491b7019f66c9 (patch) | |
| tree | 794d29521bf0cd519fd522c940962fd4b1baad4e /src | |
| parent | 30308d5e7268831202b8a4f37e01e78d6b97462e (diff) | |
| download | emacs-538f13d4d76bccdd18184098c90491b7019f66c9.tar.gz emacs-538f13d4d76bccdd18184098c90491b7019f66c9.zip | |
(redisplay_internal): Use last_had_star to decide
whether to update the mode line to update the star.
(update_menu_bar): Likewise.
Also, don't set w->update_mode_line for frames that use set_frame_menubar.
(redisplay_internal, mark_window_display_accurate): Set last_had_star.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index d1f74c5fe12..5b1b9e24a7a 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -881,9 +881,8 @@ redisplay_internal (preserve_echo_area) | |||
| 881 | if (windows_or_buffers_changed) | 881 | if (windows_or_buffers_changed) |
| 882 | update_mode_lines++; | 882 | update_mode_lines++; |
| 883 | 883 | ||
| 884 | /* Detect case that we need to write a star in the mode line. */ | 884 | /* Detect case that we need to write or remove a star in the mode line. */ |
| 885 | if (XFASTINT (w->last_modified) < MODIFF | 885 | if ((SAVE_MODIFF < MODIFF) != !NILP (w->last_had_star)) |
| 886 | && XFASTINT (w->last_modified) <= SAVE_MODIFF) | ||
| 887 | { | 886 | { |
| 888 | w->update_mode_line = Qt; | 887 | w->update_mode_line = Qt; |
| 889 | if (buffer_shared > 1) | 888 | if (buffer_shared > 1) |
| @@ -1201,6 +1200,9 @@ update: | |||
| 1201 | b->clip_changed = 0; | 1200 | b->clip_changed = 0; |
| 1202 | w->update_mode_line = Qnil; | 1201 | w->update_mode_line = Qnil; |
| 1203 | XSETFASTINT (w->last_modified, BUF_MODIFF (b)); | 1202 | XSETFASTINT (w->last_modified, BUF_MODIFF (b)); |
| 1203 | w->last_had_star | ||
| 1204 | = (BUF_MODIFF (XBUFFER (w->buffer)) > BUF_SAVE_MODIFF (XBUFFER (w->buffer)) | ||
| 1205 | ? Qt : Qnil); | ||
| 1204 | w->window_end_valid = w->buffer; | 1206 | w->window_end_valid = w->buffer; |
| 1205 | last_arrow_position = Voverlay_arrow_position; | 1207 | last_arrow_position = Voverlay_arrow_position; |
| 1206 | last_arrow_string = Voverlay_arrow_string; | 1208 | last_arrow_string = Voverlay_arrow_string; |
| @@ -1269,6 +1271,9 @@ mark_window_display_accurate (window, flag) | |||
| 1269 | { | 1271 | { |
| 1270 | XSETFASTINT (w->last_modified, | 1272 | XSETFASTINT (w->last_modified, |
| 1271 | !flag ? 0 : BUF_MODIFF (XBUFFER (w->buffer))); | 1273 | !flag ? 0 : BUF_MODIFF (XBUFFER (w->buffer))); |
| 1274 | w->last_had_star | ||
| 1275 | = (BUF_MODIFF (XBUFFER (w->buffer)) > BUF_SAVE_MODIFF (XBUFFER (w->buffer)) | ||
| 1276 | ? Qt : Qnil); | ||
| 1272 | 1277 | ||
| 1273 | /* Record if we are showing a region, so can make sure to | 1278 | /* Record if we are showing a region, so can make sure to |
| 1274 | update it fully at next redisplay. */ | 1279 | update it fully at next redisplay. */ |
| @@ -1341,9 +1346,9 @@ update_menu_bar (f, save_match_data) | |||
| 1341 | windows_or_buffers_changed anyway. */ | 1346 | windows_or_buffers_changed anyway. */ |
| 1342 | if (windows_or_buffers_changed | 1347 | if (windows_or_buffers_changed |
| 1343 | || !NILP (w->update_mode_line) | 1348 | || !NILP (w->update_mode_line) |
| 1344 | || (XFASTINT (w->last_modified) < MODIFF | 1349 | || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer)) |
| 1345 | && (XFASTINT (w->last_modified) | 1350 | < BUF_MODIFF (XBUFFER (w->buffer))) |
| 1346 | <= BUF_SAVE_MODIFF (XBUFFER (w->buffer)))) | 1351 | != !NILP (w->last_had_star)) |
| 1347 | || ((!NILP (Vtransient_mark_mode) | 1352 | || ((!NILP (Vtransient_mark_mode) |
| 1348 | && !NILP (XBUFFER (w->buffer)->mark_active)) | 1353 | && !NILP (XBUFFER (w->buffer)->mark_active)) |
| 1349 | != !NILP (w->region_showing))) | 1354 | != !NILP (w->region_showing))) |
| @@ -1368,12 +1373,19 @@ update_menu_bar (f, save_match_data) | |||
| 1368 | call0 (Qrecompute_lucid_menubar); | 1373 | call0 (Qrecompute_lucid_menubar); |
| 1369 | safe_run_hooks (Qmenu_bar_update_hook); | 1374 | safe_run_hooks (Qmenu_bar_update_hook); |
| 1370 | FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); | 1375 | FRAME_MENU_BAR_ITEMS (f) = menu_bar_items (FRAME_MENU_BAR_ITEMS (f)); |
| 1371 | /* Make sure to redisplay the menu bar in case we change it. */ | 1376 | /* Redisplay the menu bar in case we changed it. */ |
| 1372 | w->update_mode_line = Qt; | ||
| 1373 | #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) | 1377 | #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) |
| 1374 | if (FRAME_WINDOW_P (f)) | 1378 | if (FRAME_WINDOW_P (f)) |
| 1375 | set_frame_menubar (f, 0, 0); | 1379 | set_frame_menubar (f, 0, 0); |
| 1376 | #endif /* USE_X_TOOLKIT || HAVE_NTGUI */ | 1380 | else |
| 1381 | /* On a terminal screen, the menu bar is an ordinary screen | ||
| 1382 | line, and this makes it get updated. */ | ||
| 1383 | w->update_mode_line = Qt; | ||
| 1384 | #else /* ! (USE_X_TOOLKIT || HAVE_NTGUI) */ | ||
| 1385 | /* In the non-toolkit version, the menu bar is an ordinary screen | ||
| 1386 | line, and this makes it get updated. */ | ||
| 1387 | w->update_mode_line = Qt; | ||
| 1388 | #endif /* ! (USE_X_TOOLKIT || HAVE_NTGUI) */ | ||
| 1377 | 1389 | ||
| 1378 | unbind_to (count, Qnil); | 1390 | unbind_to (count, Qnil); |
| 1379 | set_buffer_internal_1 (prev); | 1391 | set_buffer_internal_1 (prev); |