From 83c6387178580a4ca8897e057cbf1ede0bfda3f6 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 5 Nov 2013 23:11:04 -0500 Subject: [PATCH] *.[chm]: Number every assignment to windows_or_buffers_changed. --- src/ChangeLog | 21 +++++++++++++-------- src/buffer.c | 6 +++--- src/dispnew.c | 2 +- src/frame.c | 10 +++++----- src/image.c | 2 +- src/insdel.c | 2 +- src/keyboard.c | 2 +- src/minibuf.c | 2 +- src/nsfns.m | 14 +++++++------- src/nsterm.m | 2 +- src/w32fns.c | 2 +- src/window.c | 34 +++++++++++++++++----------------- src/xdisp.c | 24 ++++++++++++------------ src/xfaces.c | 14 +++++++------- src/xfns.c | 6 +++--- 15 files changed, 74 insertions(+), 69 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index d3b53292452..001da2f2e41 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,10 +1,15 @@ +2013-11-06 Stefan Monnier + + * *.[chm]: Number every assignment to windows_or_buffers_changed so we + can track why it is set. + 2013-11-06 Paul Eggert Integer-related fixes for term.c etc. * dispextern.h (face_tty_specified_color): New function. * term.c (turn_on_face): Don't rely on undefined behavior when - assigning an out-of-range value to 'long'. Simplify - test for toggling highlight. + assigning an out-of-range value to 'long'. + Simplify test for toggling highlight. (tty_capable_p): Omit last two (unused) args. All callers changed. * term.c (tty_capable_p, tty_menu_display, tty_menu_add_selection) (read_menu_input, tty_menu_activate, tty_menu_show): @@ -232,8 +237,8 @@ 2013-11-02 Jan Djärv - * xfaces.c (check_lface_attrs, realize_default_face): Add - LFACE_DISTANT_FOREGROUND_INDEX (Bug#15788). + * xfaces.c (check_lface_attrs, realize_default_face): + Add LFACE_DISTANT_FOREGROUND_INDEX (Bug#15788). (realize_default_face): Set DISTANT_FOREGROUND to unspecified_fg. 2013-11-02 Paul Eggert @@ -257,13 +262,13 @@ foreground. (syms_of_xfaces): DEFSYM QCdistant_foreground. - * dispextern.h (lface_attribute_index): Add - LFACE_DISTANT_FOREGROUND_INDEX. + * dispextern.h (lface_attribute_index): + Add LFACE_DISTANT_FOREGROUND_INDEX. 2013-11-01 Claudio Bley - * image.c (pbm_next_char): New function. See - http://netpbm.sourceforge.net/doc/pbm.html for the details. + * image.c (pbm_next_char): New function. + See http://netpbm.sourceforge.net/doc/pbm.html for the details. (pbm_scan_number): Use it. (Qlibjpeg_version): New variable. (syms_of_image): DEFSYM and initialize it. diff --git a/src/buffer.c b/src/buffer.c index 63198cd1018..9aed1909bbd 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -2705,7 +2705,7 @@ current buffer is cleared. */) /* If buffer is shown in a window, let redisplay consider other windows. */ if (buffer_window_count (current_buffer)) - ++windows_or_buffers_changed; + windows_or_buffers_changed = 10; /* Copy this buffer's new multibyte status into all of its indirect buffers. */ @@ -3911,11 +3911,11 @@ modify_overlay (struct buffer *buf, ptrdiff_t start, ptrdiff_t end) { /* ... it's visible in other window than selected, */ if (buf != XBUFFER (XWINDOW (selected_window)->contents)) - windows_or_buffers_changed = 1; + windows_or_buffers_changed = 11; /* ... or if we modify an overlay at the end of the buffer and so we cannot be sure that window end is still valid. */ else if (end >= ZV && start <= ZV) - windows_or_buffers_changed = 1; + windows_or_buffers_changed = 12; } ++BUF_OVERLAY_MODIFF (buf); diff --git a/src/dispnew.c b/src/dispnew.c index 0379573b50a..3207f4a0018 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -2940,7 +2940,7 @@ redraw_frame (struct frame *f) clear_frame (f); clear_current_matrices (f); update_end (f); - windows_or_buffers_changed++; + windows_or_buffers_changed = 13; /* Mark all windows as inaccurate, so that every window will have its redisplay done. */ mark_window_display_accurate (FRAME_ROOT_WINDOW (f), 0); diff --git a/src/frame.c b/src/frame.c index 14e8fabd149..05f74e4b621 100644 --- a/src/frame.c +++ b/src/frame.c @@ -231,7 +231,7 @@ set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) if (nlines != olines) { - windows_or_buffers_changed++; + windows_or_buffers_changed = 14; FRAME_WINDOW_SIZES_CHANGED (f) = 1; FRAME_MENU_BAR_LINES (f) = nlines; set_menu_bar_lines_1 (f->root_window, nlines - olines); @@ -1699,7 +1699,7 @@ If omitted, FRAME defaults to the currently selected frame. */) make_frame_visible_1 (f->root_window); /* Make menu bar update for the Buffers and Frames menus. */ - windows_or_buffers_changed++; + windows_or_buffers_changed = 15; XSETFRAME (frame, f); return frame; @@ -1753,7 +1753,7 @@ displayed in the terminal. */) #endif /* Make menu bar update for the Buffers and Frames menus. */ - windows_or_buffers_changed++; + windows_or_buffers_changed = 16; return Qnil; } @@ -1776,7 +1776,7 @@ If omitted, FRAME defaults to the currently selected frame. */) #endif /* Make menu bar update for the Buffers and Frames menus. */ - windows_or_buffers_changed++; + windows_or_buffers_changed = 17; return Qnil; } @@ -3245,7 +3245,7 @@ x_set_font_backend (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu XSETFRAME (frame, f); x_set_font (f, Fframe_parameter (frame, Qfont), Qnil); ++face_change_count; - ++windows_or_buffers_changed; + windows_or_buffers_changed = 18; } } diff --git a/src/image.c b/src/image.c index 02565fa7b08..37a19e4f5a5 100644 --- a/src/image.c +++ b/src/image.c @@ -1521,7 +1521,7 @@ clear_image_cache (struct frame *f, Lisp_Object filter) clear_current_matrices (fr); } - ++windows_or_buffers_changed; + windows_or_buffers_changed = 19; } unblock_input (); diff --git a/src/insdel.c b/src/insdel.c index 08349fffe45..4b8ab19fe24 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1803,7 +1803,7 @@ prepare_to_modify_buffer_1 (ptrdiff_t start, ptrdiff_t end, let redisplay consider other windows if this buffer is visible. */ if (XBUFFER (XWINDOW (selected_window)->contents) != current_buffer && buffer_window_count (current_buffer)) - ++windows_or_buffers_changed; + windows_or_buffers_changed = 20; if (buffer_intervals (current_buffer)) { diff --git a/src/keyboard.c b/src/keyboard.c index 9dba631986b..81713dc5115 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1667,7 +1667,7 @@ command_loop_1 (void) cluster to prevent automatic composition. To recover the automatic composition, we must update the display. */ - windows_or_buffers_changed++; + windows_or_buffers_changed = 21; if (!already_adjusted) adjust_point_for_property (last_point_position, MODIFF != prev_modiff); diff --git a/src/minibuf.c b/src/minibuf.c index cc6f234f7da..7ca4dae089b 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -866,7 +866,7 @@ read_minibuf_unwind (void) resize_mini_window (XWINDOW (window), 0); /* Enforce full redisplay. FIXME: make it more selective. */ - windows_or_buffers_changed++; + windows_or_buffers_changed = 22; /* In case the previous minibuffer displayed in this miniwindow is dead, we may keep displaying this buffer (tho it's inactive), so reset it, diff --git a/src/nsfns.m b/src/nsfns.m index ee36439b1b4..7dea868e341 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -403,23 +403,23 @@ x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) if (!NILP (f->title)) arg = f->title; else - /* explicit name and no icon-name -> explicit_name */ + /* Explicit name and no icon-name -> explicit_name. */ if (f->explicit_name) arg = f->name; else { - /* no explicit name and no icon-name -> - name has to be rebuild from icon_title_format */ - windows_or_buffers_changed++; + /* No explicit name and no icon-name -> + name has to be rebuild from icon_title_format. */ + windows_or_buffers_changed = 62; return; } } /* Don't change the name if it's already NAME. */ - if ([[view window] miniwindowTitle] && - ([[[view window] miniwindowTitle] + if ([[view window] miniwindowTitle] + && ([[[view window] miniwindowTitle] isEqualToString: [NSString stringWithUTF8String: - SSDATA (arg)]])) + SSDATA (arg)]])) return; [[view window] setMiniwindowTitle: diff --git a/src/nsterm.m b/src/nsterm.m index 12f182968b3..0e7667b6dc6 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -6089,7 +6089,7 @@ if (cols > 0 && rows > 0) SET_FRAME_ICONIFIED (emacsframe, 0); SET_FRAME_VISIBLE (emacsframe, 1); - windows_or_buffers_changed++; + windows_or_buffers_changed = 63; if (emacs_event) { diff --git a/src/w32fns.c b/src/w32fns.c index c98c84c8542..84a504e84c2 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -1664,7 +1664,7 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) nlines = 0; /* Make sure we redisplay all windows in this frame. */ - ++windows_or_buffers_changed; + windows_or_buffers_changed = 23; delta = nlines - FRAME_TOOL_BAR_LINES (f); diff --git a/src/window.c b/src/window.c index cb505eda819..ac6bac42800 100644 --- a/src/window.c +++ b/src/window.c @@ -500,7 +500,7 @@ select_window (Lisp_Object window, Lisp_Object norecord, int inhibit_point_swap) select_window_1 (window, inhibit_point_swap); bset_last_selected_window (XBUFFER (w->contents), window); - windows_or_buffers_changed++; + windows_or_buffers_changed = 24; record_and_return: /* record_buffer can run QUIT, so make sure it is run only after we have @@ -1553,7 +1553,7 @@ Return POS. */) set_marker_restricted (w->pointm, pos, w->contents); /* We have to make sure that redisplay updates the window to show the new value of point. */ - ++windows_or_buffers_changed; + windows_or_buffers_changed = 25; } return pos; @@ -1576,7 +1576,7 @@ overriding motion of point in order to display at this exact start. */) w->update_mode_line = 1; if (w != XWINDOW (selected_window)) /* Enforce full redisplay. FIXME: make it more selective. */ - windows_or_buffers_changed++; + windows_or_buffers_changed = 26; return pos; } @@ -2837,7 +2837,7 @@ window-start value is reasonable when this function is called. */) } free_window_matrices (r); - windows_or_buffers_changed++; + windows_or_buffers_changed = 27; Vwindow_list = Qnil; FRAME_WINDOW_SIZES_CHANGED (f) = 1; resize_failed = 0; @@ -3171,7 +3171,7 @@ set_window_buffer (Lisp_Object window, Lisp_Object buffer, } /* Maybe we could move this into the `if' but it's not obviously safe and I doubt it's worth the trouble. */ - windows_or_buffers_changed++; + windows_or_buffers_changed = 28; /* We must select BUFFER for running the window-scroll-functions. */ /* We can't check ! NILP (Vwindow_scroll_functions) here @@ -3278,7 +3278,7 @@ displaying that buffer. */) { if (NILP (object)) { - windows_or_buffers_changed++; + windows_or_buffers_changed = 29; update_mode_lines++; return Qt; } @@ -3646,7 +3646,7 @@ be applied on the Elisp level. */) block_input (); window_resize_apply (r, horflag); - windows_or_buffers_changed++; + windows_or_buffers_changed = 30; FRAME_WINDOW_SIZES_CHANGED (f) = 1; adjust_frame_glyphs (f); @@ -3741,7 +3741,7 @@ resize_frame_windows (struct frame *f, int size, bool horflag) } } - windows_or_buffers_changed++; + windows_or_buffers_changed = 31; } @@ -3862,7 +3862,7 @@ set correctly. See the code of `split-window' for how this is done. */) else p = XWINDOW (o->parent); - windows_or_buffers_changed++; + windows_or_buffers_changed = 32; FRAME_WINDOW_SIZES_CHANGED (f) = 1; new = make_window (); n = XWINDOW (new); @@ -4012,7 +4012,7 @@ Signal an error when WINDOW is the only window on its frame. */) hlinfo->mouse_face_window = Qnil; } - windows_or_buffers_changed++; + windows_or_buffers_changed = 33; Vwindow_list = Qnil; FRAME_WINDOW_SIZES_CHANGED (f) = 1; @@ -4134,7 +4134,7 @@ grow_mini_window (struct window *w, int delta) w->top_line = r->top_line + r->total_lines; w->total_lines -= XINT (value); /* Enforce full redisplay. FIXME: make it more selective. */ - windows_or_buffers_changed++; + windows_or_buffers_changed = 34; adjust_frame_glyphs (f); unblock_input (); } @@ -4168,7 +4168,7 @@ shrink_mini_window (struct window *w) w->top_line = r->top_line + r->total_lines; w->total_lines = 1; /* Enforce full redisplay. FIXME: make it more selective. */ - windows_or_buffers_changed++; + windows_or_buffers_changed = 35; adjust_frame_glyphs (f); unblock_input (); } @@ -4208,7 +4208,7 @@ DEFUN ("resize-mini-window-internal", Fresize_mini_window_internal, Sresize_mini w->total_lines = XFASTINT (w->new_total); w->top_line = r->top_line + r->total_lines; - windows_or_buffers_changed++; + windows_or_buffers_changed = 36; FRAME_WINDOW_SIZES_CHANGED (f) = 1; adjust_frame_glyphs (f); unblock_input (); @@ -4830,7 +4830,7 @@ scroll_command (Lisp_Object n, int direction) Fset_buffer (XWINDOW (selected_window)->contents); /* Make redisplay consider other windows than just selected_window. */ - ++windows_or_buffers_changed; + windows_or_buffers_changed = 37; } if (NILP (n)) @@ -4940,7 +4940,7 @@ specifies the window to scroll. This takes precedence over /* Don't screw up if window_scroll gets an error. */ record_unwind_protect (save_excursion_restore, save_excursion_save ()); - ++windows_or_buffers_changed; + windows_or_buffers_changed = 38; Fset_buffer (w->contents); SET_PT_BOTH (marker_position (w->pointm), marker_byte_position (w->pointm)); @@ -5575,7 +5575,7 @@ the return value is nil. Otherwise the value is t. */) BUF_PT_BYTE (XBUFFER (w->contents))); } - windows_or_buffers_changed++; + windows_or_buffers_changed = 39; FRAME_WINDOW_SIZES_CHANGED (f) = 1; /* Problem: Freeing all matrices and later allocating them again @@ -6103,7 +6103,7 @@ apply_window_adjustment (struct window *w) adjust_window_margins (w); clear_glyph_matrix (w->current_matrix); w->window_end_valid = 0; - windows_or_buffers_changed++; + windows_or_buffers_changed = 40; adjust_frame_glyphs (XFRAME (WINDOW_FRAME (w))); } diff --git a/src/xdisp.c b/src/xdisp.c index 296ab458946..0ec1bd2cea9 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -9633,7 +9633,7 @@ message_dolog (const char *m, ptrdiff_t nbytes, bool nlflag, bool multibyte) shown in some window. So we must manually incrementing windows_or_buffers_changed here to make up for that. */ if (shown) - windows_or_buffers_changed++; + windows_or_buffers_changed = 41; else windows_or_buffers_changed = old_windows_or_buffers_changed; message_log_need_newline = !nlflag; @@ -10336,7 +10336,7 @@ resize_echo_area_exactly (void) (intptr_t) w, resize_exactly); if (resized_p) { - ++windows_or_buffers_changed; + windows_or_buffers_changed = 42; ++update_mode_lines; redisplay_internal (); } @@ -10733,7 +10733,7 @@ clear_garbaged_frames (void) frame_garbaged = 0; if (changed_count) - ++windows_or_buffers_changed; + windows_or_buffers_changed = 43; } } @@ -10802,7 +10802,7 @@ echo_area_display (int update_frame_p) pending input. */ ptrdiff_t count = SPECPDL_INDEX (); specbind (Qredisplay_dont_pause, Qt); - windows_or_buffers_changed = 1; + windows_or_buffers_changed = 44; redisplay_internal (); unbind_to (count, Qnil); } @@ -10821,11 +10821,11 @@ echo_area_display (int update_frame_p) redisplay displays the minibuffer, so that the cursor will be replaced with what the minibuffer wants. */ if (cursor_in_echo_area) - ++windows_or_buffers_changed; + windows_or_buffers_changed = 45; } } else if (!EQ (mini_window, selected_window)) - windows_or_buffers_changed++; + windows_or_buffers_changed = 46; /* Last displayed message is now the current message. */ echo_area_buffer[1] = echo_area_buffer[0]; @@ -12947,7 +12947,7 @@ redisplay_internal (void) realized faces, which includes the faces referenced from current matrices. So, we can't reuse current matrices in this case. */ if (face_change_count) - ++windows_or_buffers_changed; + windows_or_buffers_changed = 47; if ((FRAME_TERMCAP_P (sf) || FRAME_MSDOS_P (sf)) && FRAME_TTY (sf)->previous_frame != sf) @@ -12955,7 +12955,7 @@ redisplay_internal (void) /* Since frames on a single ASCII terminal share the same display area, displaying a different frame means redisplay the whole thing. */ - windows_or_buffers_changed++; + windows_or_buffers_changed = 48; SET_FRAME_GARBAGED (sf); #ifndef DOS_NT set_tty_color_mode (FRAME_TTY (sf), sf); @@ -13031,7 +13031,7 @@ redisplay_internal (void) /* If specs for an arrow have changed, do thorough redisplay to ensure we remove any arrow that should no longer exist. */ if (overlay_arrows_changed_p ()) - consider_all_windows_p = windows_or_buffers_changed = 1; + consider_all_windows_p = windows_or_buffers_changed = 49; /* Normally the message* functions will have already displayed and updated the echo area, but the frame may have been trashed, or @@ -13064,7 +13064,7 @@ redisplay_internal (void) { consider_all_windows_p = 1; ++update_mode_lines; - ++windows_or_buffers_changed; + windows_or_buffers_changed = 50; /* If window configuration was changed, frames may have been marked garbaged. Clear them or we will experience @@ -13084,7 +13084,7 @@ redisplay_internal (void) needs to be rewritten with two variables, consider_all_windows and consider_all_frames. */ consider_all_windows_p = 1; - ++windows_or_buffers_changed; + windows_or_buffers_changed = 51; ++update_mode_lines; /* If window configuration was changed, frames may have been @@ -13524,7 +13524,7 @@ redisplay_internal (void) } if (new_count != number_of_visible_frames) - windows_or_buffers_changed++; + windows_or_buffers_changed = 52; } /* Change frame size now if a change is pending. */ diff --git a/src/xfaces.c b/src/xfaces.c index 30658f9c4a8..de7636e960b 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -788,7 +788,7 @@ Optional THOROUGHLY non-nil means try to free unused fonts, too. */) { clear_face_cache (!NILP (thoroughly)); ++face_change_count; - ++windows_or_buffers_changed; + windows_or_buffers_changed = 53; return Qnil; } @@ -2637,7 +2637,7 @@ Value is a vector of face attributes. */) if (NILP (Fget (face, Qface_no_inherit))) { ++face_change_count; - ++windows_or_buffers_changed; + windows_or_buffers_changed = 54; } eassert (LFACEP (lface)); @@ -2716,7 +2716,7 @@ The value is TO. */) if (NILP (Fget (to, Qface_no_inherit))) { ++face_change_count; - ++windows_or_buffers_changed; + windows_or_buffers_changed = 55; } return to; @@ -3207,7 +3207,7 @@ FRAME 0 means change the face on all frames, and change the default && NILP (Fequal (old_value, value))) { ++face_change_count; - ++windows_or_buffers_changed; + windows_or_buffers_changed = 56; } if (!UNSPECIFIEDP (value) && !IGNORE_DEFFACE_P (value) @@ -3221,7 +3221,7 @@ FRAME 0 means change the face on all frames, and change the default { #ifdef HAVE_WINDOW_SYSTEM /* Changed font-related attributes of the `default' face are - reflected in changed `font' frame parameters. */ + reflected in changed `font' frame parameters. */ if (FRAMEP (frame) && (prop_index || EQ (attr, QCfont)) && lface_fully_specified_p (XVECTOR (lface)->contents)) @@ -3380,7 +3380,7 @@ update_face_from_frame_parameter (struct frame *f, Lisp_Object param, && NILP (Fget (face, Qface_no_inherit))) { ++face_change_count; - ++windows_or_buffers_changed; + windows_or_buffers_changed = 57; } } @@ -4273,7 +4273,7 @@ free_realized_faces (struct face_cache *c) if (WINDOWP (f->root_window)) { clear_current_matrices (f); - ++windows_or_buffers_changed; + windows_or_buffers_changed = 58; } unblock_input (); diff --git a/src/xfns.c b/src/xfns.c index 695a72a7024..624c16fe0fb 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -959,7 +959,7 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) nlines = 0; /* Make sure we redisplay all windows in this frame. */ - windows_or_buffers_changed++; + windows_or_buffers_changed = 59; #if defined (USE_X_TOOLKIT) || defined (USE_GTK) FRAME_MENU_BAR_LINES (f) = 0; @@ -1068,8 +1068,8 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) #else /* !USE_GTK */ - /* Make sure we redisplay all windows in this frame. */ - ++windows_or_buffers_changed; + /* Make sure we redisplay all windows in this frame. */ + windows_or_buffers_changed = 60; delta = nlines - FRAME_TOOL_BAR_LINES (f); -- 2.11.4.GIT