Now on revision 108441. ------------------------------------------------------------ revno: 108441 committer: Dmitry Antipov branch nick: trunk timestamp: Fri 2012-06-01 07:41:03 +0400 message: For a 'struct window', replace some Lisp_Object fields to bitfields where appropriate, remove unused fields. * window.h (struct window): Remove unused 'last_mark_x' and 'last_mark_y' fields. Rename 'mini_p' field to 'mini', change it's type from Lisp_Object to bitfield. Change type of 'force_start', 'optional_new_start', 'last_had_star', 'update_mode_line' and 'start_at_line_beg' fields from Lisp_Object to bitfield. Adjust users accordingly. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-05-31 07:22:33 +0000 +++ src/ChangeLog 2012-06-01 03:41:03 +0000 @@ -1,3 +1,14 @@ +2012-06-01 Dmitry Antipov + + For a 'struct window', replace some Lisp_Object fields to + bitfields where appropriate, remove unused fields. + * window.h (struct window): Remove unused 'last_mark_x' and + 'last_mark_y' fields. Rename 'mini_p' field to 'mini', + change it's type from Lisp_Object to bitfield. + Change type of 'force_start', 'optional_new_start', + 'last_had_star', 'update_mode_line' and 'start_at_line_beg' + fields from Lisp_Object to bitfield. Adjust users accordingly. + 2012-05-31 Paul Eggert Pacify gcc -Wdouble-precision when using Xaw. === modified file 'src/fileio.c' --- src/fileio.c 2012-05-25 18:19:24 +0000 +++ src/fileio.c 2012-06-01 03:41:03 +0000 @@ -3735,7 +3735,7 @@ /* If display currently starts at beginning of line, keep it that way. */ if (XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer) - XWINDOW (selected_window)->start_at_line_beg = Fbolp (); + XWINDOW (selected_window)->start_at_line_beg = !NILP (Fbolp ()); replace_handled = 1; } @@ -3892,7 +3892,7 @@ /* If display currently starts at beginning of line, keep it that way. */ if (XBUFFER (XWINDOW (selected_window)->buffer) == current_buffer) - XWINDOW (selected_window)->start_at_line_beg = Fbolp (); + XWINDOW (selected_window)->start_at_line_beg = !NILP (Fbolp ()); /* Replace the chars that we need to replace, and update INSERTED to equal the number of bytes === modified file 'src/frame.c' --- src/frame.c 2012-04-09 22:54:59 +0000 +++ src/frame.c 2012-06-01 03:41:03 +0000 @@ -331,7 +331,7 @@ mini_window = make_window (); XWINDOW (root_window)->next = mini_window; XWINDOW (mini_window)->prev = root_window; - XWINDOW (mini_window)->mini_p = Qt; + XWINDOW (mini_window)->mini = 1; XWINDOW (mini_window)->frame = frame; f->minibuffer_window = mini_window; } @@ -480,7 +480,7 @@ as nil. */ mini_window = f->minibuffer_window = f->root_window; - XWINDOW (mini_window)->mini_p = Qt; + XWINDOW (mini_window)->mini = 1; XWINDOW (mini_window)->next = Qnil; XWINDOW (mini_window)->prev = Qnil; XWINDOW (mini_window)->frame = frame; === modified file 'src/keyboard.c' --- src/keyboard.c 2012-05-25 18:19:24 +0000 +++ src/keyboard.c 2012-06-01 03:41:03 +0000 @@ -1484,10 +1484,10 @@ from that position. But also throw away beg_unchanged and end_unchanged information in that case, so that redisplay will update the whole window properly. */ - if (!NILP (XWINDOW (selected_window)->force_start)) + if (XWINDOW (selected_window)->force_start) { struct buffer *b; - XWINDOW (selected_window)->force_start = Qnil; + XWINDOW (selected_window)->force_start = 0; b = XBUFFER (XWINDOW (selected_window)->buffer); BUF_BEG_UNCHANGED (b) = BUF_END_UNCHANGED (b) = 0; } === modified file 'src/window.c' --- src/window.c 2012-05-25 18:19:24 +0000 +++ src/window.c 2012-06-01 03:41:03 +0000 @@ -1393,10 +1393,10 @@ CHECK_NUMBER_COERCE_MARKER (pos); set_marker_restricted (w->start, pos, w->buffer); /* this is not right, but much easier than doing what is right. */ - w->start_at_line_beg = Qnil; + w->start_at_line_beg = 0; if (NILP (noforce)) - w->force_start = Qt; - w->update_mode_line = Qt; + w->force_start = 1; + w->update_mode_line = 1; XSETFASTINT (w->last_modified, 0); XSETFASTINT (w->last_overlay_modified, 0); if (!EQ (window, selected_window)) @@ -2472,7 +2472,7 @@ if (EQ (w->buffer, obj)) { mark_window_display_accurate (window, 0); - w->update_mode_line = Qt; + w->update_mode_line = 1; XBUFFER (obj)->prevent_redisplay_optimizations_p = 1; ++update_mode_lines; best_window = window; @@ -2771,12 +2771,11 @@ set_marker_both (w->start, w->buffer, pos.bufpos, pos.bytepos); w->window_end_valid = Qnil; - w->start_at_line_beg = ((pos.bytepos == BEGV_BYTE - || FETCH_BYTE (pos.bytepos - 1) == '\n') ? Qt - : Qnil); + w->start_at_line_beg = (pos.bytepos == BEGV_BYTE + || FETCH_BYTE (pos.bytepos - 1) == '\n'); /* We need to do this, so that the window-scroll-functions get called. */ - w->optional_new_start = Qt; + w->optional_new_start = 1; set_buffer_internal (obuf); } @@ -3006,8 +3005,8 @@ set_marker_restricted (w->start, make_number (b->last_window_start), buffer); - w->start_at_line_beg = Qnil; - w->force_start = Qnil; + w->start_at_line_beg = 0; + w->force_start = 0; XSETFASTINT (w->last_modified, 0); XSETFASTINT (w->last_overlay_modified, 0); } @@ -3143,7 +3142,7 @@ { struct window *w = XWINDOW (object); mark_window_display_accurate (object, 0); - w->update_mode_line = Qt; + w->update_mode_line = 1; if (BUFFERP (w->buffer)) XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; ++update_mode_lines; @@ -3275,7 +3274,8 @@ w = allocate_window (); /* Initialize all Lisp data. */ - w->frame = w->mini_p = Qnil; + w->frame = Qnil; + w->mini = 0; w->next = w->prev = w->hchild = w->vchild = w->parent = Qnil; XSETFASTINT (w->left_col, 0); XSETFASTINT (w->top_line, 0); @@ -3288,7 +3288,7 @@ w->buffer = Qnil; w->start = Fmake_marker (); w->pointm = Fmake_marker (); - w->force_start = w->optional_new_start = Qnil; + w->force_start = w->optional_new_start = 0; XSETFASTINT (w->hscroll, 0); XSETFASTINT (w->min_hscroll, 0); XSETFASTINT (w->use_time, 0); @@ -3296,17 +3296,18 @@ XSETFASTINT (w->sequence_number, sequence_number); w->temslot = w->last_modified = w->last_overlay_modified = Qnil; XSETFASTINT (w->last_point, 0); - w->last_had_star = w->vertical_scroll_bar = Qnil; + w->last_had_star = 0; + w->vertical_scroll_bar = Qnil; w->left_margin_cols = w->right_margin_cols = Qnil; w->left_fringe_width = w->right_fringe_width = Qnil; w->fringes_outside_margins = Qnil; w->scroll_bar_width = Qnil; w->vertical_scroll_bar_type = Qt; - w->last_mark_x = w->last_mark_y = Qnil; XSETFASTINT (w->window_end_pos, 0); XSETFASTINT (w->window_end_vpos, 0); - w->window_end_valid = w->update_mode_line = Qnil; - w->start_at_line_beg = w->display_table = w->dedicated = Qnil; + w->window_end_valid = w->display_table = Qnil; + w->update_mode_line = w->start_at_line_beg = 0; + w->dedicated = Qnil; w->base_line_number = w->base_line_pos = w->region_showing = Qnil; w->column_number_displayed = w->redisplay_end_trigger = Qnil; w->combination_limit = w->window_parameters = Qnil; @@ -4305,13 +4306,13 @@ spos = min (XINT (Fline_end_position (Qnil)) + 1, ZV); set_marker_restricted (w->start, make_number (spos), w->buffer); - w->start_at_line_beg = Qt; - w->update_mode_line = Qt; + w->start_at_line_beg = 1; + w->update_mode_line = 1; XSETFASTINT (w->last_modified, 0); XSETFASTINT (w->last_overlay_modified, 0); /* Set force_start so that redisplay_window will run the window-scroll-functions. */ - w->force_start = Qt; + w->force_start = 1; return; } } @@ -4451,14 +4452,13 @@ set_marker_restricted (w->start, make_number (pos), w->buffer); bytepos = XMARKER (w->start)->bytepos; - w->start_at_line_beg = ((pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n') - ? Qt : Qnil); - w->update_mode_line = Qt; + w->start_at_line_beg = (pos == BEGV || FETCH_BYTE (bytepos - 1) == '\n'); + w->update_mode_line = 1; XSETFASTINT (w->last_modified, 0); XSETFASTINT (w->last_overlay_modified, 0); /* Set force_start so that redisplay_window will run the window-scroll-functions. */ - w->force_start = Qt; + w->force_start = 1; } /* The rest of this function uses current_y in a nonstandard way, @@ -4651,13 +4651,13 @@ max (0, min (scroll_margin, XINT (w->total_lines) / 4)); set_marker_restricted_both (w->start, w->buffer, pos, pos_byte); - w->start_at_line_beg = bolp; - w->update_mode_line = Qt; + w->start_at_line_beg = !NILP (bolp); + w->update_mode_line = 1; XSETFASTINT (w->last_modified, 0); XSETFASTINT (w->last_overlay_modified, 0); /* Set force_start so that redisplay_window will run the window-scroll-functions. */ - w->force_start = Qt; + w->force_start = 1; if (!NILP (Vscroll_preserve_screen_position) && (whole || !EQ (Vscroll_preserve_screen_position, Qt))) @@ -5201,12 +5201,10 @@ set_marker_both (w->start, w->buffer, charpos, bytepos); w->window_end_valid = Qnil; - w->optional_new_start = Qt; + w->optional_new_start = 1; - if (bytepos == BEGV_BYTE || FETCH_BYTE (bytepos - 1) == '\n') - w->start_at_line_beg = Qt; - else - w->start_at_line_beg = Qnil; + w->start_at_line_beg = (bytepos == BEGV_BYTE || + FETCH_BYTE (bytepos - 1) == '\n'); set_buffer_internal (obuf); return Qnil; @@ -5257,8 +5255,8 @@ int height = window_internal_height (w); Fvertical_motion (make_number (- (height / 2)), window); set_marker_both (w->start, w->buffer, PT, PT_BYTE); - w->start_at_line_beg = Fbolp (); - w->force_start = Qt; + w->start_at_line_beg = !NILP (Fbolp ()); + w->force_start = 1; } else Fgoto_char (w->start); @@ -5607,7 +5605,7 @@ /* If saved buffer is alive, install it. */ { w->buffer = p->buffer; - w->start_at_line_beg = p->start_at_line_beg; + w->start_at_line_beg = !NILP (p->start_at_line_beg); set_marker_restricted (w->start, p->start, w->buffer); set_marker_restricted (w->pointm, p->pointm, w->buffer); Fset_marker (BVAR (XBUFFER (w->buffer), mark), @@ -5632,7 +5630,7 @@ set_marker_restricted_both (w->pointm, w->buffer, BUF_PT (XBUFFER (w->buffer)), BUF_PT_BYTE (XBUFFER (w->buffer))); - w->start_at_line_beg = Qt; + w->start_at_line_beg = 1; } else if (STRINGP (auto_buffer_name = Fwindow_parameter (window, Qauto_buffer_name)) @@ -5641,7 +5639,7 @@ { set_marker_restricted (w->start, make_number (0), w->buffer); set_marker_restricted (w->pointm, make_number (0), w->buffer); - w->start_at_line_beg = Qt; + w->start_at_line_beg = 1; } else /* Window has no live buffer, get one. */ @@ -5655,7 +5653,7 @@ range. */ set_marker_restricted (w->start, make_number (0), w->buffer); set_marker_restricted (w->pointm, make_number (0), w->buffer); - w->start_at_line_beg = Qt; + w->start_at_line_beg = 1; if (!NILP (w->dedicated)) /* Record this window as dead. */ dead_windows = Fcons (window, dead_windows); @@ -5956,7 +5954,7 @@ = !NILP (Vwindow_point_insertion_type); p->start = Fcopy_marker (w->start, Qnil); - p->start_at_line_beg = w->start_at_line_beg; + p->start_at_line_beg = w->start_at_line_beg ? Qt : Qnil; tem = BVAR (XBUFFER (w->buffer), mark); p->mark = Fcopy_marker (tem, Qnil); === modified file 'src/window.h' --- src/window.h 2012-05-24 06:13:51 +0000 +++ src/window.h 2012-06-01 03:41:03 +0000 @@ -94,9 +94,6 @@ /* The frame this window is on. */ Lisp_Object frame; - /* t if this window is a minibuffer window. */ - Lisp_Object mini_p; - /* Following (to right or down) and preceding (to left or up) child at same level of tree. */ Lisp_Object next, prev; @@ -144,15 +141,6 @@ each one can have its own value of point. */ Lisp_Object pointm; - /* Non-nil means next redisplay must use the value of start - set up for it in advance. Set by scrolling commands. */ - Lisp_Object force_start; - /* Non-nil means we have explicitly changed the value of start, - but that the next redisplay is not obliged to use the new value. - This is used in Fdelete_other_windows to force a call to - Vwindow_scroll_functions; also by Frecenter with argument. */ - Lisp_Object optional_new_start; - /* Number of columns display within the window is scrolled to the left. */ Lisp_Object hscroll; /* Minimum hscroll for automatic hscrolling. This is the value @@ -176,9 +164,6 @@ Lisp_Object last_overlay_modified; /* Value of point at that time. */ Lisp_Object last_point; - /* Non-nil if the buffer was "modified" when the window - was last updated. */ - Lisp_Object last_had_star; /* This window's vertical scroll bar. This field is only for use by the window-system-dependent code which implements the @@ -206,11 +191,6 @@ no scroll bar. A value of t means use frame value. */ Lisp_Object vertical_scroll_bar_type; - /* Frame coords of mark as of last time display completed */ - /* May be nil if mark does not exist or was not on frame */ - Lisp_Object last_mark_x; - Lisp_Object last_mark_y; - /* Z - the buffer position of the last glyph in the current matrix of W. Only valid if WINDOW_END_VALID is not nil. */ Lisp_Object window_end_pos; @@ -223,18 +203,13 @@ did not get onto the frame. */ Lisp_Object window_end_valid; - /* Non-nil means must regenerate mode line of this window */ - Lisp_Object update_mode_line; - - /* Non-nil means current value of `start' - was the beginning of a line when it was chosen. */ - Lisp_Object start_at_line_beg; - /* Display-table to use for displaying chars in this window. Nil means use the buffer's own display-table. */ Lisp_Object display_table; - /* Non-nil means window is marked as dedicated. */ + /* Non-nil usually means window is marked as dedicated. + Note Lisp code may set this to something beyond Qnil + and Qt, so bitfield can't be used here. */ Lisp_Object dedicated; /* Line number and position of a line somewhere above the top of the @@ -302,6 +277,30 @@ /* This is handy for undrawing the cursor. */ int phys_cursor_ascent, phys_cursor_height; + /* Non-zero if this window is a minibuffer window. */ + unsigned mini : 1; + + /* Non-zero means must regenerate mode line of this window */ + unsigned update_mode_line : 1; + + /* Non-nil if the buffer was "modified" when the window + was last updated. */ + unsigned last_had_star : 1; + + /* Non-zero means current value of `start' + was the beginning of a line when it was chosen. */ + unsigned start_at_line_beg : 1; + + /* Non-zero means next redisplay must use the value of start + set up for it in advance. Set by scrolling commands. */ + unsigned force_start : 1; + + /* Non-zero means we have explicitly changed the value of start, + but that the next redisplay is not obliged to use the new value. + This is used in Fdelete_other_windows to force a call to + Vwindow_scroll_functions; also by Frecenter with argument. */ + unsigned optional_new_start : 1; + /* Non-zero means the cursor is currently displayed. This can be set to zero by functions overpainting the cursor image. */ unsigned phys_cursor_on_p : 1; @@ -337,7 +336,7 @@ /* 1 if W is a minibuffer window. */ -#define MINI_WINDOW_P(W) (!NILP ((W)->mini_p)) +#define MINI_WINDOW_P(W) ((W)->mini) /* General window layout: === modified file 'src/xdisp.c' --- src/xdisp.c 2012-05-31 06:06:42 +0000 +++ src/xdisp.c 2012-06-01 03:41:03 +0000 @@ -11169,7 +11169,7 @@ || update_mode_lines || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer)) < BUF_MODIFF (XBUFFER (w->buffer))) - != !NILP (w->last_had_star)) + != w->last_had_star) || ((!NILP (Vtransient_mark_mode) && !NILP (BVAR (XBUFFER (w->buffer), mark_active))) != !NILP (w->region_showing))) @@ -11221,11 +11221,11 @@ else /* On a terminal screen, the menu bar is an ordinary screen line, and this makes it get updated. */ - w->update_mode_line = Qt; + w->update_mode_line = 1; #else /* ! (USE_X_TOOLKIT || HAVE_NTGUI || HAVE_NS || USE_GTK) */ /* In the non-toolkit version, the menu bar is an ordinary screen line, and this makes it get updated. */ - w->update_mode_line = Qt; + w->update_mode_line = 1; #endif /* ! (USE_X_TOOLKIT || HAVE_NTGUI || HAVE_NS || USE_GTK) */ unbind_to (count, Qnil); @@ -11363,11 +11363,11 @@ the rest of the redisplay algorithm is about the same as windows_or_buffers_changed anyway. */ if (windows_or_buffers_changed - || !NILP (w->update_mode_line) + || w->update_mode_line || update_mode_lines || ((BUF_SAVE_MODIFF (XBUFFER (w->buffer)) < BUF_MODIFF (XBUFFER (w->buffer))) - != !NILP (w->last_had_star)) + != w->last_had_star) || ((!NILP (Vtransient_mark_mode) && !NILP (BVAR (XBUFFER (w->buffer), mark_active))) != !NILP (w->region_showing))) @@ -11418,7 +11418,7 @@ BLOCK_INPUT; f->tool_bar_items = new_tool_bar; f->n_tool_bar_items = new_n_tool_bar; - w->update_mode_line = Qt; + w->update_mode_line = 1; UNBLOCK_INPUT; } @@ -12967,9 +12967,9 @@ update_mode_lines++; /* Detect case that we need to write or remove a star in the mode line. */ - if ((SAVE_MODIFF < MODIFF) != !NILP (w->last_had_star)) + if ((SAVE_MODIFF < MODIFF) != w->last_had_star) { - w->update_mode_line = Qt; + w->update_mode_line = 1; if (buffer_shared > 1) update_mode_lines++; } @@ -12986,7 +12986,7 @@ && XFASTINT (w->last_modified) >= MODIFF && XFASTINT (w->last_overlay_modified) >= OVERLAY_MODIFF) && (XFASTINT (w->column_number_displayed) != current_column ())) - w->update_mode_line = Qt; + w->update_mode_line = 1; unbind_to (count1, Qnil); @@ -13089,7 +13089,7 @@ tlendpos = this_line_end_pos; if (!consider_all_windows_p && CHARPOS (tlbufpos) > 0 - && NILP (w->update_mode_line) + && !w->update_mode_line && !current_buffer->clip_changed && !current_buffer->prevent_redisplay_optimizations_p && FRAME_VISIBLE_P (XFRAME (w->frame)) @@ -13097,8 +13097,8 @@ /* Make sure recorded data applies to current buffer, etc. */ && this_line_buffer == current_buffer && current_buffer == XBUFFER (w->buffer) - && NILP (w->force_start) - && NILP (w->optional_new_start) + && !w->force_start + && !w->optional_new_start /* Point must be on the line that we have info recorded about. */ && PT >= CHARPOS (tlbufpos) && PT <= Z - CHARPOS (tlendpos) @@ -13633,7 +13633,7 @@ w->last_overlay_modified = make_number (accurate_p ? BUF_OVERLAY_MODIFF (b) : 0); w->last_had_star - = BUF_MODIFF (b) > BUF_SAVE_MODIFF (b) ? Qt : Qnil; + = BUF_MODIFF (b) > BUF_SAVE_MODIFF (b); if (accurate_p) { @@ -13662,7 +13662,7 @@ if (accurate_p) { w->window_end_valid = w->buffer; - w->update_mode_line = Qnil; + w->update_mode_line = 0; } } @@ -15291,7 +15291,7 @@ reconsider_clip_changes (w, buffer); /* Has the mode line to be updated? */ - update_mode_line = (!NILP (w->update_mode_line) + update_mode_line = (w->update_mode_line || update_mode_lines || buffer->clip_changed || buffer->prevent_redisplay_optimizations_p); @@ -15463,32 +15463,31 @@ /* If someone specified a new starting point but did not insist, check whether it can be used. */ - if (!NILP (w->optional_new_start) + if (w->optional_new_start && CHARPOS (startp) >= BEGV && CHARPOS (startp) <= ZV) { - w->optional_new_start = Qnil; + w->optional_new_start = 0; start_display (&it, w, startp); move_it_to (&it, PT, 0, it.last_visible_y, -1, MOVE_TO_POS | MOVE_TO_X | MOVE_TO_Y); if (IT_CHARPOS (it) == PT) - w->force_start = Qt; + w->force_start = 1; /* IT may overshoot PT if text at PT is invisible. */ else if (IT_CHARPOS (it) > PT && CHARPOS (startp) <= PT) - w->force_start = Qt; + w->force_start = 1; } force_start: /* Handle case where place to start displaying has been specified, unless the specified location is outside the accessible range. */ - if (!NILP (w->force_start) - || w->frozen_window_start_p) + if (w->force_start || w->frozen_window_start_p) { /* We set this later on if we have to adjust point. */ int new_vpos = -1; - w->force_start = Qnil; + w->force_start = 0; w->vscroll = 0; w->window_end_valid = Qnil; @@ -15507,7 +15506,7 @@ || ! NILP (Vwindow_scroll_functions)) { update_mode_line = 1; - w->update_mode_line = Qt; + w->update_mode_line = 1; startp = run_window_scroll_functions (window, startp); } @@ -15525,7 +15524,7 @@ the scroll margin (bug#148) -- cyd */ if (!try_window (window, startp, 0)) { - w->force_start = Qt; + w->force_start = 1; clear_glyph_matrix (w->desired_matrix); goto need_larger_matrices; } @@ -15604,7 +15603,7 @@ } /* If current starting point was originally the beginning of a line but no longer is, find a new starting point. */ - else if (!NILP (w->start_at_line_beg) + else if (w->start_at_line_beg && !(CHARPOS (startp) <= BEGV || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n')) { @@ -15651,7 +15650,7 @@ new window start, since that would change the position under the mouse, resulting in an unwanted mouse-movement rather than a simple mouse-click. */ - if (NILP (w->start_at_line_beg) + if (!w->start_at_line_beg && NILP (do_mouse_tracking) && CHARPOS (startp) > BEGV && CHARPOS (startp) > BEG + beg_unchanged @@ -15671,7 +15670,7 @@ See bug#9324. */ && pos_visible_p (w, PT, &d1, &d2, &d3, &d4, &d5, &d6)) { - w->force_start = Qt; + w->force_start = 1; SET_TEXT_POS_FROM_MARKER (startp, w->start); goto force_start; } @@ -15732,7 +15731,7 @@ if (!update_mode_line) { update_mode_line = 1; - w->update_mode_line = Qt; + w->update_mode_line = 1; } /* Try to scroll by specified few lines. */ @@ -15987,9 +15986,8 @@ done: SET_TEXT_POS_FROM_MARKER (startp, w->start); - w->start_at_line_beg = ((CHARPOS (startp) == BEGV - || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n') - ? Qt : Qnil); + w->start_at_line_beg = (CHARPOS (startp) == BEGV + || FETCH_BYTE (BYTEPOS (startp) - 1) == '\n'); /* Display the mode line, if we must. */ if ((update_mode_line @@ -16206,7 +16204,7 @@ /* If bottom moved off end of frame, change mode line percentage. */ if (XFASTINT (w->window_end_pos) <= 0 && Z != IT_CHARPOS (it)) - w->update_mode_line = Qt; + w->update_mode_line = 1; /* Set window_end_pos to the offset of the last character displayed on the window from the end of current_buffer. Set === modified file 'src/xfns.c' --- src/xfns.c 2012-05-31 05:08:37 +0000 +++ src/xfns.c 2012-06-01 03:41:03 +0000 @@ -1207,7 +1207,7 @@ FRAME_EXTERNAL_MENU_BAR (f) = 1; if (FRAME_X_P (f) && f->output_data.x->menubar_widget == 0) /* Make sure next redisplay shows the menu bar. */ - XWINDOW (FRAME_SELECTED_WINDOW (f))->update_mode_line = Qt; + XWINDOW (FRAME_SELECTED_WINDOW (f))->update_mode_line = 1; } else { ------------------------------------------------------------ revno: 108440 committer: Glenn Morris branch nick: trunk timestamp: Thu 2012-05-31 16:06:04 -0400 message: ChangeLog merge fix diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-05-31 17:14:46 +0000 +++ lisp/ChangeLog 2012-05-31 20:06:04 +0000 @@ -19,12 +19,6 @@ * desktop.el (desktop-read): Clear previous and next buffers for all windows and bury *Messages* buffer (bug#11556). -2012-05-31 Eli Zaretskii - - * mail/sendmail.el (mail-yank-region): Recognize - rmail-yank-current-message in addition to insert-buffer. Fixes - mail-mode's "C-c C-r" that otherwise does nothing when invoked in - 2012-05-31 Stefan Monnier Add `declare' for `defun'. Align `defmacro's with it. ------------------------------------------------------------ revno: 108439 committer: Glenn Morris branch nick: trunk timestamp: Thu 2012-05-31 13:21:31 -0400 message: Fix imagemagick-filter-types for imagemagick-types-enable = t. diff: === modified file 'lisp/image.el' --- lisp/image.el 2012-05-31 17:14:46 +0000 +++ lisp/image.el 2012-05-31 17:21:31 +0000 @@ -698,18 +698,19 @@ (when (fboundp 'imagemagick-types) (cond ((null imagemagick-types-enable) nil) ((eq imagemagick-types-inhibit t) nil) - ((eq imagemagick-types-enable t) (imagemagick-types)) (t (delq nil (mapcar (lambda (type) (unless (memq type imagemagick-types-inhibit) - (catch 'found - (dolist (enable imagemagick-types-enable nil) - (if (cond ((symbolp enable) (eq enable type)) - ((stringp enable) - (string-match enable (symbol-name type)))) - (throw 'found type)))))) + (if (eq imagemagick-types-enable t) type + (catch 'found + (dolist (enable imagemagick-types-enable nil) + (if (cond ((symbolp enable) (eq enable type)) + ((stringp enable) + (string-match enable + (symbol-name type)))) + (throw 'found type))))))) (imagemagick-types))))))) (defvar imagemagick--file-regexp nil ------------------------------------------------------------ revno: 108438 committer: Glenn Morris branch nick: trunk timestamp: Thu 2012-05-31 13:14:46 -0400 message: Split off imagemagick-filter-types from imagemagick-register-types * lisp/image.el: (imagemagick-filter-types): New function. (Bug#7406) (imagemagick-register-types): Use imagemagick-filter-types. * etc/NEWS: Mention this. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-05-31 07:22:33 +0000 +++ etc/NEWS 2012-05-31 17:14:46 +0000 @@ -68,7 +68,9 @@ afterwards if you do not use customize to change this. *** The new variable `imagemagick-types-enable' also affects which -ImageMagick types are treated as images. +ImageMagick types are treated as images. The function +`imagemagick-filter-types' returns the list of types that will be +treated as images. ** String values for `initial-buffer-choice' also apply to emacsclient frames, if emacsclient is only told to open a new frame without === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-05-31 07:22:33 +0000 +++ lisp/ChangeLog 2012-05-31 17:14:46 +0000 @@ -3,7 +3,8 @@ * image.el: For clarity, call imagemagick-register-types at top-level, rather than relying on a custom :initialize. (imagemagick-types-enable): New option. (Bug#11557) - (imagemagick-register-types): Respect imagemagick-types-inhibit. + (imagemagick-filter-types): New function. (Bug#7406) + (imagemagick-register-types): Use imagemagick-filter-types. If disabling support, remove elements altogether rather than using an impossible regexp. (imagemagick-types-inhibit): Give it the default init function. === modified file 'lisp/image.el' --- lisp/image.el 2012-05-31 07:22:33 +0000 +++ lisp/image.el 2012-05-31 17:14:46 +0000 @@ -687,21 +687,41 @@ image n count time-elapsed limit)))) +(defvar imagemagick-types-inhibit) +(defvar imagemagick-types-enable) + +(defun imagemagick-filter-types () + "Return a list of the ImageMagick types to be treated as images, or nil. +This is the result of `imagemagick-types', including only elements +that match `imagemagick-types-enable' and do not match +`imagemagick-types-inhibit'." + (when (fboundp 'imagemagick-types) + (cond ((null imagemagick-types-enable) nil) + ((eq imagemagick-types-inhibit t) nil) + ((eq imagemagick-types-enable t) (imagemagick-types)) + (t + (delq nil + (mapcar + (lambda (type) + (unless (memq type imagemagick-types-inhibit) + (catch 'found + (dolist (enable imagemagick-types-enable nil) + (if (cond ((symbolp enable) (eq enable type)) + ((stringp enable) + (string-match enable (symbol-name type)))) + (throw 'found type)))))) + (imagemagick-types))))))) + (defvar imagemagick--file-regexp nil "File extension regexp for ImageMagick files, if any. This is the extension installed into `auto-mode-alist' and `image-type-file-name-regexps' by `imagemagick-register-types'.") -(defvar imagemagick-types-inhibit) -(defvar imagemagick-types-enable) - ;;;###autoload (defun imagemagick-register-types () "Register file types that can be handled by ImageMagick. This function is called at startup, after loading the init file. -It registers the ImageMagick types returned by `imagemagick-types', -including only those from `imagemagick-types-enable', and excluding -those from `imagemagick-types-inhibit'. +It registers the ImageMagick types returned by `imagemagick-filter-types'. Registered image types are added to `auto-mode-alist', so that Emacs visits them in Image mode. They are also added to @@ -710,27 +730,9 @@ If Emacs is compiled without ImageMagick support, this does nothing." (when (fboundp 'imagemagick-types) - (let* ((include - (cond ((null imagemagick-types-enable) nil) - ((eq imagemagick-types-inhibit t) nil) - ((eq imagemagick-types-enable t) (imagemagick-types)) - (t - (delq nil - (mapcar - (lambda (type) - (catch 'found - (dolist (enable imagemagick-types-enable nil) - (if (cond ((symbolp enable) (eq enable type)) - ((stringp enable) - (string-match enable - (symbol-name type)))) - (throw 'found type))))) - (imagemagick-types)))))) - (re (let (types) - (dolist (type include) - (unless (memq type imagemagick-types-inhibit) - (push (downcase (symbol-name type)) types))) - (if types (concat "\\." (regexp-opt types) "\\'")))) + (let* ((types (mapcar (lambda (type) (downcase (symbol-name type))) + (imagemagick-filter-types))) + (re (if types (concat "\\." (regexp-opt types) "\\'"))) (ama-elt (car (member (cons imagemagick--file-regexp 'image-mode) auto-mode-alist))) (itfnr-elt (car (member (cons imagemagick--file-regexp 'imagemagick) ------------------------------------------------------------ revno: 108437 fixes bug(s): http://debbugs.gnu.org/11557 committer: Glenn Morris branch nick: trunk timestamp: Thu 2012-05-31 00:22:33 -0700 message: Add option imagemagick-types-enable * lisp/image.el: For clarity, call imagemagick-register-types at top-level, rather than relying on a custom :initialize. (imagemagick-types-enable): New option. (imagemagick-register-types): Respect imagemagick-types-inhibit. If disabling support, remove elements altogether rather than using an impossible regexp. (imagemagick-types-inhibit): Give it the default init function. * src/image.c (Fimagemagick_types): Doc fix. * etc/NEWS: Mention this. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-05-31 01:41:17 +0000 +++ etc/NEWS 2012-05-31 07:22:33 +0000 @@ -60,12 +60,16 @@ ** ImageMagick support, if available, is automatically enabled. It is no longer necessary to call `imagemagick-register-types' explicitly to install ImageMagick image types; that function is called -automatically at startup or when customizing `imagemagick-types-inhibit'. +automatically at startup, or when customizing imagemagick-types-enable +or imagemagick-types-inhibit. *** Setting `imagemagick-types-inhibit' to t now disables the use of ImageMagick to view images. You must call imagemagick-register-types afterwards if you do not use customize to change this. +*** The new variable `imagemagick-types-enable' also affects which +ImageMagick types are treated as images. + ** String values for `initial-buffer-choice' also apply to emacsclient frames, if emacsclient is only told to open a new frame without specifying any file to visit or expression to evaluate. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-05-31 06:06:42 +0000 +++ lisp/ChangeLog 2012-05-31 07:22:33 +0000 @@ -1,3 +1,13 @@ +2012-05-31 Glenn Morris + + * image.el: For clarity, call imagemagick-register-types at + top-level, rather than relying on a custom :initialize. + (imagemagick-types-enable): New option. (Bug#11557) + (imagemagick-register-types): Respect imagemagick-types-inhibit. + If disabling support, remove elements altogether rather + than using an impossible regexp. + (imagemagick-types-inhibit): Give it the default init function. + 2012-05-31 Stefan Monnier * emacs-lisp/bytecomp.el (byte-compile-fix-header): Handle === modified file 'lisp/image.el' --- lisp/image.el 2012-05-25 20:24:58 +0000 +++ lisp/image.el 2012-05-31 07:22:33 +0000 @@ -692,38 +692,59 @@ This is the extension installed into `auto-mode-alist' and `image-type-file-name-regexps' by `imagemagick-register-types'.") +(defvar imagemagick-types-inhibit) +(defvar imagemagick-types-enable) + ;;;###autoload (defun imagemagick-register-types () "Register file types that can be handled by ImageMagick. This function is called at startup, after loading the init file. -It registers the ImageMagick types listed in `imagemagick-types', -excluding those listed in `imagemagick-types-inhibit'. +It registers the ImageMagick types returned by `imagemagick-types', +including only those from `imagemagick-types-enable', and excluding +those from `imagemagick-types-inhibit'. Registered image types are added to `auto-mode-alist', so that Emacs visits them in Image mode. They are also added to `image-type-file-name-regexps', so that the `image-type' function recognizes these files as having image type `imagemagick'. -If Emacs is compiled without ImageMagick support, do nothing." +If Emacs is compiled without ImageMagick support, this does nothing." (when (fboundp 'imagemagick-types) - (let ((re (if (eq imagemagick-types-inhibit t) - ;; Use a bogus regexp to inhibit matches. - "\\'a" - (let ((types)) - (dolist (type (imagemagick-types)) - (unless (memq type imagemagick-types-inhibit) - (push (downcase (symbol-name type)) types))) - (concat "\\." (regexp-opt types) "\\'")))) - (ama-elt (car (member (cons imagemagick--file-regexp 'image-mode) - auto-mode-alist))) - (itfnr-elt (car (member (cons imagemagick--file-regexp 'imagemagick) - image-type-file-name-regexps)))) - (if ama-elt - (setcar ama-elt re) - (push (cons re 'image-mode) auto-mode-alist)) - (if itfnr-elt - (setcar itfnr-elt re) - (push (cons re 'imagemagick) image-type-file-name-regexps)) + (let* ((include + (cond ((null imagemagick-types-enable) nil) + ((eq imagemagick-types-inhibit t) nil) + ((eq imagemagick-types-enable t) (imagemagick-types)) + (t + (delq nil + (mapcar + (lambda (type) + (catch 'found + (dolist (enable imagemagick-types-enable nil) + (if (cond ((symbolp enable) (eq enable type)) + ((stringp enable) + (string-match enable + (symbol-name type)))) + (throw 'found type))))) + (imagemagick-types)))))) + (re (let (types) + (dolist (type include) + (unless (memq type imagemagick-types-inhibit) + (push (downcase (symbol-name type)) types))) + (if types (concat "\\." (regexp-opt types) "\\'")))) + (ama-elt (car (member (cons imagemagick--file-regexp 'image-mode) + auto-mode-alist))) + (itfnr-elt (car (member (cons imagemagick--file-regexp 'imagemagick) + image-type-file-name-regexps)))) + (if (not re) + (setq auto-mode-alist (delete ama-elt auto-mode-alist) + image-type-file-name-regexps + (delete itfnr-elt image-type-file-name-regexps)) + (if ama-elt + (setcar ama-elt re) + (push (cons re 'image-mode) auto-mode-alist)) + (if itfnr-elt + (setcar itfnr-elt re) + (push (cons re 'imagemagick) image-type-file-name-regexps))) (setq imagemagick--file-regexp re)))) (defcustom imagemagick-types-inhibit @@ -743,12 +764,45 @@ :type '(choice (const :tag "Support all ImageMagick types" nil) (const :tag "Disable all ImageMagick types" t) (repeat symbol)) + :initialize 'custom-initialize-default :set (lambda (symbol value) (set-default symbol value) (imagemagick-register-types)) :version "24.1" :group 'image) +(defcustom imagemagick-types-enable + '("\\`BMP" DJVU "\\`GIF" "\\`ICO" "P?JPE?G" "P[BNP]M" + "\\`[MP]NG" "\\`TIFF") + "List of ImageMagick types to treat as images. +The list elements are either strings or symbols, and represent +types returned by `imagemagick-types'. A string is a regexp that +selects all types matching the regexp. + +The value may also be t, meaning all the types that ImageMagick +supports; or nil, meaning no types. + +The variable `imagemagick-types-inhibit' overrides this variable. + +If you change this without using customize, you must call +`imagemagick-register-types' afterwards. + +If Emacs is compiled without ImageMagick support, this variable +has no effect." + :type '(choice (const :tag "Support all ImageMagick types" t) + (const :tag "Disable all ImageMagick types" nil) + (repeat :tag "List of types" + (choice (symbol :tag "type") + (regexp :tag "regexp")))) + :initialize 'custom-initialize-default + :set (lambda (symbol value) + (set-default symbol value) + (imagemagick-register-types)) + :version "24.2" + :group 'image) + +(imagemagick-register-types) + (provide 'image) ;;; image.el ends here === modified file 'src/ChangeLog' --- src/ChangeLog 2012-05-31 06:51:43 +0000 +++ src/ChangeLog 2012-05-31 07:22:33 +0000 @@ -63,6 +63,10 @@ and not pointers. * lisp.h (__executable_start): New decl. +2012-05-31 Glenn Morris + + * image.c (Fimagemagick_types): Doc fix. + 2012-05-30 Jim Meyering * callproc.c (Fcall_process_region): Include directory component === modified file 'src/image.c' --- src/image.c 2012-02-25 06:41:40 +0000 +++ src/image.c 2012-05-31 07:22:33 +0000 @@ -1,5 +1,6 @@ /* Functions for image support on window system. - Copyright (C) 1989, 1992-2012 Free Software Foundation, Inc. + +Copyright (C) 1989, 1992-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -7987,7 +7988,8 @@ You can also try the shell command: `identify -list format'. Note that ImageMagick recognizes many file-types that Emacs does not -recognize as images, such as C. See `imagemagick-types-inhibit'. */) +recognize as images, such as C. See `imagemagick-types-enable' +and `imagemagick-types-inhibit'. */) (void) { Lisp_Object typelist = Qnil; ------------------------------------------------------------ revno: 108436 committer: Paul Eggert branch nick: trunk timestamp: Wed 2012-05-30 23:51:43 -0700 message: Pacify gcc -Wdouble-precision when using Xaw. * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb) [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]: Use 'float' consistently, rather than 'float' in most places and 'double' in a couple of places. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-05-31 06:06:42 +0000 +++ src/ChangeLog 2012-05-31 06:51:43 +0000 @@ -1,3 +1,11 @@ +2012-05-31 Paul Eggert + + Pacify gcc -Wdouble-precision when using Xaw. + * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb) + [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]: + Use 'float' consistently, rather than 'float' in most places + and 'double' in a couple of places. + 2012-05-31 Eli Zaretskii * xdisp.c (handle_stop): Detect whether we have overlay strings === modified file 'src/xterm.c' --- src/xterm.c 2012-05-31 05:08:37 +0000 +++ src/xterm.c 2012-05-31 06:51:43 +0000 @@ -4529,7 +4529,7 @@ whole = 10000000; portion = shown < 1 ? top * whole : 0; - if (shown < 1 && (eabs (top + shown - 1) < 1.0/height)) + if (shown < 1 && (eabs (top + shown - 1) < 1.0f / height)) /* Some derivatives of Xaw refuse to shrink the thumb when you reach the bottom, so we force the scrolling whenever we see that we're too close to the bottom (in x_set_toolkit_scroll_bar_thumb @@ -4894,7 +4894,7 @@ else top = old_top; /* Keep two pixels available for moving the thumb down. */ - shown = max (0, min (1 - top - (2.0 / height), shown)); + shown = max (0, min (1 - top - (2.0f / height), shown)); /* If the call to XawScrollbarSetThumb below doesn't seem to work, check that your system's configuration file contains a define