]> code.delx.au - gnu-emacs/commitdiff
Fix pos-visible-in-window-p under bidi redisplay.
authorEli Zaretskii <eliz@gnu.org>
Sat, 23 Jul 2011 10:46:21 +0000 (13:46 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 23 Jul 2011 10:46:21 +0000 (13:46 +0300)
 src/xdisp.c (move_it_in_display_line_to): Record the best matching
 position for TO_CHARPOS while scanning the line, and restore it on
 exit if none of the characters scanned was an exact match.  Fixes
 vertical-motion and pos-visible-in-window-p under bidi redisplay
 when exact match is impossible due to invisible text, and the
 lines are truncated.

1  2 
src/ChangeLog
src/xdisp.c

diff --combined src/ChangeLog
index 9b66b8f34ff56570af8c1b85cc4fc6bf68799d4e,dd5a1fba871d27cbf1d94e6bf15a8cc44ba4dc9e..ad207884753600a840adadedfe17439d83a6cd61
 -      vertical-motion and pos-visible-in-window-p when exact match is
 -      impossible due to invisible text, and the lines are truncated.
+ 2011-07-23  Eli Zaretskii  <eliz@gnu.org>
+       * xdisp.c (move_it_in_display_line_to): Record the best matching
+       position for TO_CHARPOS while scanning the line, and restore it on
+       exit if none of the characters scanned was an exact match.  Fixes
++      vertical-motion and pos-visible-in-window-p under bidi redisplay
++      when exact match is impossible due to invisible text, and the
++      lines are truncated.
++
 +2011-07-23  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
 +      for OSX >= 10.7.
  
  2011-07-22  Eli Zaretskii  <eliz@gnu.org>
  
 +      Fix a significant slow-down of cursor motion with C-n, C-p,
 +      C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
 +      auto-repeat under bidi redisplay in fontified buffers.
        * xdisp.c (compute_stop_pos_backwards): New function.
 -      (handle_stop_backwards): Revert last change.
        (next_element_from_buffer): Call compute_stop_pos_backwards to
        find a suitable prev_stop when we find ourselves before
 -      base_level_stop.  Remove the funky search for 1000 character
 -      positions back.
 -
 -2011-07-19  Eli Zaretskii  <eliz@gnu.org>
 -
 -      Fix a significant slow-down of vertical-motion when leaning on C-n
 -      or C-p in a fontified buffer.
 -      * xdisp.c (reseat): Don't look for prev_stop, as that could mean a
 -      very long run.
 -      (next_element_from_buffer): When iterator oversteps prev_pos
 -      backwards, don't search for a new prev_stop more than 1000
 -      characters back.
 -      (handle_stop_backwards): Don't assume that CHARPOS is necessarily
 -      a stop_pos.
 -      (compute_display_string_pos): Check also BUF_OVERLAY_MODIFF for a
 -      match, when testing the cached display string position for
 -      applicability.
 -
 -2011-07-16  Eli Zaretskii  <eliz@gnu.org>
 -
 -      * xdisp.c <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>:
 -      Cache for last found display string position.
 +      base_level_stop.
 +      (reseat): Don't look for prev_stop, as that could mean a very long
 +      run.
 +      <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
 +      <cached_disp_overlay_modiff>: Cache for last found display string
 +      position.
        (compute_display_string_pos): Return the cached position if asked
 -      about the same buffer.
 +      about the same buffer in the same area of character positions, and
 +      the buffer wasn't changed since the time the display string
 +      position was cached.
  
 -2011-07-14  Eli Zaretskii  <eliz@gnu.org>
 +2011-07-22  Eli Zaretskii  <eliz@gnu.org>
  
 -      * bidi.c (bidi_cache_fetch_state, bidi_cache_search)
 -      (bidi_cache_find_level_change, bidi_cache_ensure_space)
 -      (bidi_cache_iterator_state, bidi_cache_find)
 -      (bidi_find_other_level_edge, bidi_cache_start_stack): All
 -      variables related to cache indices are now EMACS_INT.
 +      * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
 +      is an integer, which is important for empty lines.  (Bug#9149)
  
 -2011-07-09  Eli Zaretskii  <eliz@gnu.org>
 +2011-07-22  Chong Yidong  <cyd@stupidchicken.com>
  
 -      * bidi.c (bidi_fetch_char): Fix the type of `len' according to
 -      what STRING_CHAR_AND_LENGTH expects.
 +      * frame.c (Fmodify_frame_parameters): In tty case, update the
 +      default face if necessary (Bug#4238).
  
 -      * xdisp.c (move_it_in_display_line_to): Record prev_method and
 -      prev_pos immediately before the call to set_iterator_to_next.
 -      Fixes cursor motion in bidi-reordered lines with stretch glyphs
 -      and strings displayed in margins.  (Bug#8133)  (Bug#8867)
 -      Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
 -      TO_CHARPOS.
 -      (pos_visible_p): Support positions in bidi-reordered lines.  Save
 -      and restore bidi cache.
 +2011-07-21  Chong Yidong  <cyd@stupidchicken.com>
  
 -2011-07-08  Eli Zaretskii  <eliz@gnu.org>
 +      * editfns.c (Fstring_to_char): No need to explain what a character
 +      is in the docstring (Bug#6576).
  
 -      * xdisp.c (move_it_in_display_line_to): If iterator ended up at
 -      EOL, but we never saw any buffer positions smaller than
 -      to_charpos, return MOVE_POS_MATCH_OR_ZV.  Fixes vertical cursor
 -      motion in bidi-reordered lines.
 +2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
  
 -2011-07-07  Eli Zaretskii  <eliz@gnu.org>
 +      * xml.c (parse_region): Make sure we always return a tree.
  
 -      * xdisp.c (find_row_edges): If ROW->start.pos gives position
 -      smaller than min_pos, use it as ROW->minpos.  (Bug#7616)
 +2011-07-20  HAMANO Kiyoto  <khiker.mail@gmail.com>
  
 -2011-07-05  Eli Zaretskii  <eliz@gnu.org>
 +      * xml.c (parse_region): If a document contains only comments,
 +      return that, too.
  
 -      * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
 -      cache around display iteration.
 +2011-07-20  Lars Magne Ingebrigtsen  <larsi@gnus.org>
  
 -      * window.c (Fwindow_end, window_scroll_pixel_based)
 -      (displayed_window_lines, Frecenter): Save and restore the bidi
 -      cache around display iteration.
 +      * xml.c (make_dom): Return comments, too.
  
 -      * bidi.c (bidi_unshelve_cache): Ensure we have enough space before
 -      restoring the shelved cache.
 -      (bidi_cache_ensure_space): Don't assume the required size is just
 -      one BIDI_CACHE_CHUNK away.
 +2011-07-19  Paul Eggert  <eggert@cs.ucla.edu>
  
 -      * xdisp.c (back_to_previous_visible_line_start, reseat_1)
 -      (init_iterator): Empty the bidi cache "stack".
 +      Port to OpenBSD.
 +      See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
 +      and the surrounding thread.
 +      * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
 +      rather than fgets, and retry after EINTR.  Otherwise, 'emacs
 +      --batch -f byte-compile-file' fails on OpenBSD if an inactivity
 +      timer goes off.
 +      * s/openbsd.h (BROKEN_SIGIO): Define.
 +      * unexelf.c (unexec) [__OpenBSD__]:
 +      Don't update the .mdebug section of the Alpha COFF symbol table.
  
 -2011-07-03  Eli Zaretskii  <eliz@gnu.org>
 +2011-07-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
  
 -      * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): New functions.
 +      * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
 +      (bug#8460).
  
 -      * dispextern.h (bidi_shelve_cache, bidi_unshelve_cache): Declare
 -      prototypes.
 +2011-07-18  Paul Eggert  <eggert@cs.ucla.edu>
  
 -      * xdisp.c (SAVE_IT, RESTORE_IT): New macros.
 -      (pos_visible_p, face_before_or_after_it_pos)
 -      (back_to_previous_visible_line_start)
 -      (move_it_in_display_line_to, move_it_in_display_line)
 -      (move_it_to, move_it_vertically_backward, move_it_by_lines)
 -      (try_scrolling, redisplay_window, display_line): Use them when
 -      saving a temporary copy of the iterator and restoring it back.
 +      * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
 +      This fixes some race conditions on the permissions of any newly
 +      created file.
  
 -2011-07-02  Eli Zaretskii  <eliz@gnu.org>
 +      * alloc.c (valid_pointer_p): Use pipe, not open.
 +      This fixes some permissions issues when debugging.
  
 -      * xdisp.c (reseat_1): Call bidi_init_it to resync the bidi
 -      iterator with IT's position.  (Bug#7616)
 -      (handle_stop, back_to_previous_visible_line_start, reseat_1):
 -      Reset the from_disp_prop_p flag.
 +      * fileio.c (Fcopy_file): Adjust mode if fchown fails.  (Bug#9002)
 +      If fchown fails to set both uid and gid, try to set just gid,
 +      as that is sometimes allowed.  Adjust the file's mode to eliminate
 +      setuid or setgid bits that are inappropriate if fchown fails.
  
 -      * bidi.c (bidi_cache_search): Don't assume bidi_cache_last_idx is
 -      always valid if bidi_cache_idx is valid.
 -      (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
 -      is valid if it's going to be used.
 +2011-07-18  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
 +      to compare Lisp_Objects.
 +      * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
 +      global_gnutls_log_level, don't mistake it for a Lisp_Object.
 +      (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
  
 -      * dispextern.h (struct iterator_stack_entry, struct it): New
 -      member from_disp_prop_p.
 +2011-07-17  Andreas Schwab  <schwab@linux-m68k.org>
  
 -      * xdisp.c (push_it, pop_it): Save and restore from_disp_prop_p.
 +      * lread.c (read_integer): Unread even EOF character.
 +      (read1): Likewise.  Properly record start position of symbol.
 +
 +      * lread.c (read1): Read `#:' as empty uninterned symbol if no
 +      symbol character follows.
 +
 +2011-07-17  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * fileio.c (Fcopy_file): Pacify gcc re fchown.  (Bug#9002)
 +      This works around a problem with the previous change to Fcopy_file.
 +      Recent glibc declares fchown with __attribute__((warn_unused_result)),
 +      and without this change, GCC might complain about discarding
 +      fchown's return value.
 +
 +2011-07-16  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
 +
 +2011-07-16  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * fileio.c (Fcopy_file): Don't diagnose fchown failures.  (Bug#9002)
 +
 +2011-07-16  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
 +      it's used from the C level.
 +
 +      * process.c: Use the same condition for POLL_FOR_INPUT in both
 +      keyboard.c and process.c (bug#1858).
 +
 +2011-07-09  Lawrence Mitchell  <wence@gmx.li>
 +
 +      * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
 +      (Fgnutls_boot): Use it.
 +
 +2011-07-15  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * doc.c (Fsubstitute_command_keys): Revert last change.
 +
 +2011-07-15  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * doc.c (Fsubstitute_command_keys): Clarify that \= really only
 +      quotes the next character, and doesn't affect other longer
 +      sequences (bug#8935).
 +
 +      * lread.c (syms_of_lread): Clarify that is isn't only
 +      `eval-buffer' and `eval-defun' that's affected by
 +      `lexical-binding' (bug#8460).
 +
 +2011-07-15  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
 +      bidi redisplay when a line includes both an image and is
 +      truncated.
 +
 +2011-07-14  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Fix minor problems found by static checking.
 +      * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
 +      (elsz): Now a signed constant, not a size_t var.  We prefer signed
 +      types to unsigned, to avoid integer comparison confusion.  Without
 +      this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
 +      "cannot optimize loop, the loop counter may overflow", a symptom
 +      of the confusion.
 +      * indent.c (Fvertical_motion): Mark locals as initialized.
 +      * xdisp.c (reseat_to_string): Fix pointer signedness issue.
 +
 +2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * search.c (Fre_search_backward): Mention `case-fold-search' in
 +      all the re_search_* functions (bug#8138).
 +
 +      * keyboard.c (Fopen_dribble_file): Document when the file is
 +      closed (bug#8056).
 +
 +2011-07-14  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * bidi.c (bidi_dump_cached_states): Fix format of displaying
 +      bidi_cache_idx.
 +
 +      Support bidi reordering of display and overlay strings.
 +      * xdisp.c (compute_display_string_pos)
 +      (compute_display_string_end): Accept additional argument STRING.
 +      (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
 +      (reseat_to_string): Initialize bidi_it->string.s and
 +      bidi_it->string.schars.
 +      (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
 +      NULL (avoids a crash in bidi_paragraph_init).  Initialize
 +      itb.string.lstring.
 +      (init_iterator): Call bidi_init_it only of a valid
 +      buffer position was specified.  Initialize paragraph_embedding to
 +      L2R.
 +      (reseat_to_string): Initialize the bidi iterator.
 +      (display_string): If we need to ignore text properties of
 +      LISP_STRING, set IT->stop_charpos to IT->end_charpos.  (The
 +      original value of -1 will not work with bidi.)
 +      (compute_display_string_pos): First arg is now struct
 +      `text_pos *'; all callers changed.  Support display properties on
 +      Lisp strings.
 +      (compute_display_string_end): Support display properties on Lisp
 +      strings.
 +      (init_iterator, reseat_1, reseat_to_string): Initialize the
 +      string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
 +      when iterating on a string not from display properties).
 +      (compute_display_string_pos, compute_display_string_end): Fix
 +      calculation of the object to scan.  Fixes an error when using
 +      arrow keys.
 +      (next_element_from_buffer): Don't abort when IT_CHARPOS is before
 +      base_level_stop; instead, set base_level_stop to BEGV.  Fixes
 +      crashes in vertical-motion.
 +      (next_element_from_buffer): Improve commentary for when
 +      the iterator is before prev_stop.
 +      (init_iterator): Initialize bidi_p from the default value of
 +      bidi-display-reordering, not from buffer-local value.  Use the
 +      buffer-local value only if initializing for buffer iteration.
 +      (handle_invisible_prop): Support invisible properties on strings
 +      that are being bidi-reordered.
 +      (set_iterator_to_next): Support bidi reordering of C strings and
 +      Lisp strings.
 +      (next_element_from_string): Support bidi reordering of Lisp
 +      strings.
 +      (handle_stop_backwards): Support Lisp strings as well.
 +      (display_string): Support display of R2L glyph rows.  Use
 +      IT_STRING_CHARPOS when displaying from a Lisp string.
 +      (init_iterator): Don't initialize it->bidi_p for strings
 +      here.
 +      (reseat_to_string): Initialize it->bidi_p for strings here.
 +      (next_element_from_string, next_element_from_c_string)
 +      (next_element_from_buffer): Add xassert's for correspondence
 +      between IT's object being iterated and it->bidi_it.string
 +      structure.
 +      (face_before_or_after_it_pos): Support bidi iteration.
 +      (next_element_from_c_string): Handle the case of the first string
 +      character that is not the first one in the visual order.
 +      (get_visually_first_element): New function, refactored from common
 +      parts of next_element_from_buffer, next_element_from_string, and
 +      next_element_from_c_string.
 +      (tool_bar_lines_needed, redisplay_tool_bar)
 +      (display_menu_bar): Force left-to-right direction.  Add a FIXME
 +      comment for making that be controlled by a user option.
 +      (push_it, pop_it): Save and restore the state of the
 +      bidi iterator.  Save and restore the bidi_p flag.
 +      (pop_it): Iterate out of display property for string iteration as
 +      well.
 +      (iterate_out_of_display_property): Support iteration over strings.
 +      (handle_single_display_spec): Set up it->bidi_it for iteration
 +      over a display string, and call bidi_init_it.
 +      (handle_single_display_spec, next_overlay_string)
 +      (get_overlay_strings_1, push_display_prop): Set up the bidi
 +      iterator for displaying display or overlay strings.
 +      (forward_to_next_line_start): Don't use the shortcut if
 +      bidi-iterating.
 +      (back_to_previous_visible_line_start): If handle_display_prop
 +      pushed the iterator stack, restore the internal state of the bidi
 +      iterator by calling bidi_pop_it same number of times.
 +      (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
 +      and we are bidi-iterating, don't decrement the iterator position;
 +      instead, set the first_elt flag in the bidi iterator, to produce
 +      the same effect.
 +      (reseat_1): Remove redundant setting of string_from_display_prop_p.
 +      (push_display_prop): xassert that we are iterating a buffer.
 +      (push_it, pop_it): Save and restore paragraph_embedding member.
 +      (handle_single_display_spec, next_overlay_string)
 +      (get_overlay_strings_1, reseat_1, reseat_to_string)
 +      (push_display_prop): Set up the `unibyte' member of bidi_it.string
 +      correctly.  Don't assume unibyte strings are not bidi-reordered.
 +      (compute_display_string_pos)
 +      (compute_display_string_end): Fix handling the case of C string.
 +      (push_it, pop_it): Save and restore from_disp_prop_p.
        (handle_single_display_spec, push_display_prop): Set the
        from_disp_prop_p flag.
        (get_overlay_strings_1): Reset the from_disp_prop_p flag.
        (handle_single_display_spec, get_overlay_strings_1)
        (push_display_prop): Fix initialization of paragraph direction for
        string when that of the parent object is not yet determined.
 +      (reseat_1): Call bidi_init_it to resync the bidi
 +      iterator with IT's position.  (Bug#7616)
 +      (find_row_edges): If ROW->start.pos gives position
 +      smaller than min_pos, use it as ROW->minpos.  (Bug#7616)
 +      (handle_stop, back_to_previous_visible_line_start, reseat_1):
 +      Reset the from_disp_prop_p flag.
 +      (SAVE_IT, RESTORE_IT): New macros.
 +      (pos_visible_p, face_before_or_after_it_pos)
 +      (back_to_previous_visible_line_start)
 +      (move_it_in_display_line_to, move_it_in_display_line)
 +      (move_it_to, move_it_vertically_backward, move_it_by_lines)
 +      (try_scrolling, redisplay_window, display_line): Use them when
 +      saving a temporary copy of the iterator and restoring it back.
 +      (back_to_previous_visible_line_start, reseat_1)
 +      (init_iterator): Empty the bidi cache "stack".
 +      (move_it_in_display_line_to): If iterator ended up at
 +      EOL, but we never saw any buffer positions smaller than
 +      to_charpos, return MOVE_POS_MATCH_OR_ZV.  Fixes vertical cursor
 +      motion in bidi-reordered lines.
 +      (move_it_in_display_line_to): Record prev_method and prev_pos
 +      immediately before the call to set_iterator_to_next.  Fixes cursor
 +      motion in bidi-reordered lines with stretch glyphs and strings
 +      displayed in margins.  (Bug#8133) (Bug#8867)
 +      Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
 +      TO_CHARPOS.
 +      (pos_visible_p): Support positions in bidi-reordered lines.  Save
 +      and restore bidi cache.
 +
 +      * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
 +      (bidi_paragraph_info): Delete unused struct.
 +      (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
 +      (bidi_cache_start): New variable.
 +      (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
 +      to zero.
 +      (bidi_cache_fetch_state, bidi_cache_search)
 +      (bidi_cache_find_level_change, bidi_cache_iterator_state)
 +      (bidi_cache_find, bidi_peek_at_next_level)
 +      (bidi_level_of_next_char, bidi_find_other_level_edge)
 +      (bidi_move_to_visually_next): Compare cache index with
 +      bidi_cache_start rather than with zero.
 +      (bidi_fetch_char): Accept new argument STRING; all callers
 +      changed.  Support iteration over a string.  Support strings with
 +      display properties.  Support unibyte strings.  Fix the type of
 +      `len' according to what STRING_CHAR_AND_LENGTH expects.
 +      (bidi_paragraph_init, bidi_resolve_explicit_1)
 +      (bidi_resolve_explicit, bidi_resolve_weak)
 +      (bidi_level_of_next_char, bidi_move_to_visually_next): Support
 +      iteration over a string.
 +      (bidi_set_sor_type, bidi_resolve_explicit_1)
 +      (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
 +      can now be zero (for strings); special values 0 and -1 were
 +      changed to -1 and -2, respectively.
 +      (bidi_char_at_pos): New function.
 +      (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
 +      Call it instead of FETCH_MULTIBYTE_CHAR.
 +      (bidi_move_to_visually_next): Abort if charpos or bytepos were not
 +      initialized to valid values.
 +      (bidi_init_it): Don't initialize charpos and bytepos with invalid
 +      values.
 +      (bidi_level_of_next_char): Allow the sentinel "position" to pass
 +      the test for valid cached positions.  Fix the logic for looking up
 +      the sentinel state in the cache.  GCPRO the Lisp string we are
 +      iterating.
 +      (bidi_push_it, bidi_pop_it): New functions.
 +      (bidi_initialize): Initialize the bidi cache start stack pointer.
 +      (bidi_cache_ensure_space): New function, refactored from part of
 +      bidi_cache_iterator_state.  Don't assume the required size is just
 +      one BIDI_CACHE_CHUNK away.
 +      (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
 +      (bidi_count_bytes, bidi_char_at_pos): New functions.
 +      (bidi_cache_search): Don't assume bidi_cache_last_idx is
 +      always valid if bidi_cache_idx is valid.
 +      (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
 +      is valid if it's going to be used.
 +      (bidi_shelve_cache, bidi_unshelve_cache): New functions.
 +      (bidi_cache_fetch_state, bidi_cache_search)
 +      (bidi_cache_find_level_change, bidi_cache_ensure_space)
 +      (bidi_cache_iterator_state, bidi_cache_find)
 +      (bidi_find_other_level_edge, bidi_cache_start_stack): All
 +      variables related to cache indices are now EMACS_INT.
 +
 +      * dispextern.h (struct bidi_string_data): New structure.
 +      (struct bidi_it): New member `string'.  Make flag members be 1-bit
 +      fields, and put them last in the struct.
 +      (compute_display_string_pos, compute_display_string_end): Update
 +      prototypes.
 +      (bidi_push_it, bidi_pop_it): Add prototypes.
 +      (struct iterator_stack_entry): New members bidi_p,
 +      paragraph_embedding, and from_disp_prop_p.
 +      (struct it): Member bidi_p is now a bit field 1 bit wide.
 +      (bidi_shelve_cache, bidi_unshelve_cache): Declare
 +      prototypes.
 +
 +      * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
 +      (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
 +      and vector-like objects.
 +
 +      * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
 +      cache around display iteration.
 +
 +      * window.c (Fwindow_end, window_scroll_pixel_based)
 +      (displayed_window_lines, Frecenter): Save and restore the bidi
 +      cache around display iteration.
 +
 +2011-07-14  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * editfns.c (Fdelete_region): Clarify the use of the named
 +      parameters (bug#6788).
 +
 +2011-07-14  Martin Rudalics  <rudalics@gmx.at>
 +
 +      * indent.c (Fvertical_motion): Set and restore w->pointm when
 +      saving and restoring the window's buffer (Bug#9006).
 +
 +2011-07-13  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * editfns.c (Fstring_to_char): Clarify just what is returned
 +      (bug#6576).  Text by Eli Zaretskii.
 +
 +2011-07-13  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
 +
 +2011-07-13  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * buffer.c (mmap_find): Fix a typo.
 +
 +2011-07-13  Johan Bockgård  <bojohan@gnu.org>
 +
 +      Fix execution of x selection hooks.
 +      * xselect.c (Qx_lost_selection_functions)
 +      (Qx_sent_selection_functions): New vars.
 +      (syms_of_xselect): DEFSYM them.
 +      (x_handle_selection_request): Pass Qx_sent_selection_functions
 +      rather than Vx_sent_selection_functions to Frun_hook_with_args.
 +      (x_handle_selection_clear,x_clear_frame_selections):
 +      Pass Qx_lost_selection_functions rather than
 +      Vx_lost_selection_functions to Frun_hook_with_args.
 +
 +2011-07-13  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
 +      The old code sometimes used this field without initializing it.
 +
 +      * alloc.c (gc_sweep): Don't read past end of array.
 +      In theory, the old code could also have corrupted Emacs internals,
 +      though it'd be very unlikely.
 +
 +2011-07-12  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * character.c (Fcharacterp): Don't advertise optional ignored
 +      argument.  (Bug#4026)
 +
 +2011-07-12  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
 +      key" (bug#4257).
 +
 +      * window.c (Fset_window_start): Doc fix (bug#4199).
 +      (Fset_window_hscroll): Ditto.
 +
 +2011-07-12  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Fix minor new problems caught by GCC 4.6.1.
 +      * term.c (init_tty): Remove unused local.
 +      * xsettings.c (store_monospaced_changed): Define this function only
 +      if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
 +      not used otherwise.
 +
 +2011-07-12  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
 +
 +2011-07-11  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
 +      are the mini-buffer and the echo area (bug#3320).
 +
 +      * term.c (init_tty): Remove support for supdup, c10 and perq
 +      terminals, which are no longer supported (bug#1482).
 +
 +2011-07-10  Johan Bockgård  <bojohan@gnu.org>
 +
 +      * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
 +
 +2011-07-10  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
 +      for non-popups (Bug#3642).
 +
 +2011-07-10  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * alloc.c (reset_malloc_hooks): Protoize.
 +      * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
 +      (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
 +      * cm.c (losecursor): Likewise.
 +      * data.c (fmod): Likewise.
 +      * dispnew.c (swap_glyphs_in_rows): Likewise.
 +      * emacs.c (memory_warning_signal): Likewise.
 +      * floatfns.c (float_error): Likewise.
 +      * font.c (check_gstring, check_otf_features, otf_tag_symbol)
 +      (otf_open, font_otf_capability, generate_otf_features)
 +      (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
 +      Likewise.
 +      * image.c (pbm_read_file): Likewise.
 +      * indent.c (string_display_width): Likewise.
 +      * intervals.c (check_for_interval, search_for_interval)
 +      (inc_interval_count, count_intervals, root_interval)
 +      (adjust_intervals_for_insertion, make_new_interval): Likewise.
 +      * lread.c (defalias): Likewise.
 +      * ralloc.c (r_alloc_check): Likewise.
 +      * regex.c (set_image_of_range_1, set_image_of_range)
 +      (regex_grow_registers): Likewise.
 +      * sysdep.c (strerror): Likewise.
 +      * termcap.c (valid_filename_p, tprint, main): Likewise.
 +      * tparam.c (main): Likewise.
 +      * unexhp9k800.c (run_time_remap, save_data_space)
 +      (update_file_ptrs, read_header, write_header, calculate_checksum)
 +      (copy_file, copy_rest, display_header): Likewise.
 +      * widget.c (mark_shell_size_user_specified, create_frame_gcs):
 +      Likewise.
 +      * xdisp.c (check_it): Likewise.
 +      * xfaces.c (register_color, unregister_color, unregister_colors):
 +      Likewise.
 +      * xfns.c (print_fontset_result): Likewise.
 +      * xrdb.c (member, fatal, main): Likewise.
 +
 +2011-07-10  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Fix minor problems found by static checking (Bug#9031).
 +      * chartab.c (char_table_set_range, map_sub_char_table):
 +      Remove unused locals.
 +      (uniprop_table): Now static.
 +      * composite.c (_work_char): Remove unused static var.
 +
 +2011-07-09  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * chartab.c (uniprop_table_uncompress): Remove unused local variable.
 +
 +2011-07-09  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * gtkutil.c (qttip_cb): Remove code without function.
 +
 +2011-07-09  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * w32.c (pthread_sigmask): New stub.
 +
 +2011-07-08  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Use pthread_sigmask, not sigprocmask (Bug#9010).
 +      sigprocmask is portable only for single-threaded applications, and
 +      Emacs can be multi-threaded when it uses GTK.
 +      * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
 +      (LIBES): Use it.
 +      * callproc.c (Fcall_process):
 +      * process.c (create_process):
 +      * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
 +      Use pthread_sigmask, not sigprocmask.
 +
 +2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
 +      (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
 +      wrong (Bug#8591).
 +
 +2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
 +      Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
 +      (xg_hide_tooltip): Fix comment.
 +
 +      * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
 +      in registerServicesMenuSendTypes.
 +      (validRequestorForSendType): Don't check ns_return_types.
 +
 +      * nsfns.m (Fx_open_connection): Put NSStringPboardType into
 +      ns_return_type.
 +
 +2011-07-08  Jason Rumney  <jasonr@gnu.org>
 +
 +      * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
 +      frame struct members of non-existent frames (Bug#6284).
 +
 +2011-07-08  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
 +      variable firstTime not needed on OSX >= 10.6.
 +      (setPosition): setFloatValue:knobProportion: is deprecated on OSX
 +      >= 10.5.  Use setKnobProportion, setDoubleValue.
 +
 +      * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
 +      (MAC_OS_X_VERSION_10_5): Define if not defined.
 +      (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
 +      (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
 +      (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
 +
 +      * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
 +      cString and lossyCString on OSX >= 10.4
 +
 +      * nsmenu.m (fillWithWidgetValue): Don't use depercated method
 +      sizeToFit on OSX >= 10.2.
 +
 +      * nsimage.m (allocInitFromFile): Don't use deprecated method
 +      bestRepresentationForDevice on OSX >= 10.6.
 +
 +      * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
 +      to avoid warning.
 +
 +      * emacs.c: Declare unexec_init_emacs_zone.
 +
 +      * nsgui.h: Fix compiler warning about gnulib redefining verify.
 +
 +      * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
 +
 +      * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
 +      on svcsMenu (Bug#8842).
 +
 +      * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
 +      ns_return_types.
 +      (Fns_list_services): Just return Qnil on 10.6, code not working there.
 +
 +      * nsterm.m (QUTF8_STRING): Declare.
 +      (initFrameFromEmacs): Call registerServicesMenuSendTypes.
 +      (validRequestorForSendType): Return type is (id).
 +      Change indexOfObjectIdenticalTo to indexOfObject.
 +      Check if we have local selection before returning self (Bug#8842).
 +      (writeSelectionToPasteboard): Put local selection into paste board
 +      if we have a local selection (Bug#8842).
 +      (syms_of_nsterm): DEFSYM QUTF8_STRING.
 +
 +      * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
 +      (ns_get_local_selection): Declare.
 +
 +2011-07-07  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * keymap.c (describe_map_tree): Don't insert a double newline at
 +      the end of the buffer (bug#1169) and return whether we inserted
 +      something.
 +
 +      * callint.c (Fcall_interactively): Change "reading args" to
 +      "providing args" to try to clarify what it does (bug#1010).
 +
 +2011-07-07  Kenichi Handa  <handa@m17n.org>
 +
 +      * composite.c (composition_compute_stop_pos): Ignore a static
 +      composition starting before CHARPOS (Bug#8915).
 +
 +      * xdisp.c (handle_composition_prop): Likewise.
 +
 +2011-07-07  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
 +      (Bug#9015)
 +
 +2011-07-07  Kenichi Handa  <handa@m17n.org>
 +
 +      * character.h (unicode_category_t): New enum type.
 +
 +      * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
 +      (Qchar_code_property_table): New variable.
 +      (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
 +      (UNIPROP_COMPRESSED_FORM_P): New macros.
 +      (char_table_ascii): Uncompress the compressed values.
 +      (sub_char_table_ref): New arg is_uniprop.  Callers changed.
 +      Uncompress the compressed values.
 +      (sub_char_table_ref_and_range): Likewise.
 +      (char_table_ref_and_range): Uncompress the compressed values.
 +      (sub_char_table_set): New arg is_uniprop.  Callers changed.
 +      Uncompress the compressed values.
 +      (sub_char_table_set_range): Args changed.  Callers changed.
 +      (char_table_set_range): Adjuted for the above change.
 +      (map_sub_char_table): Delete args default_val and parent.  Add arg
 +      top.  Give decoded values to a Lisp function.
 +      (map_char_table): Adjusted for the above change.  Give decoded
 +      values to a Lisp function.  Gcpro more variables.
 +      (uniprop_table_uncompress)
 +      (uniprop_decode_value_run_length): New functions.
 +      (uniprop_decoder, uniprop_decoder_count): New variables.
 +      (uniprop_get_decoder, uniprop_encode_value_character)
 +      (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
 +      New functions.
 +      (uniprop_encoder, uniprop_encoder_count): New variables.
 +      (uniprop_get_encoder, uniprop_table)
 +      (Funicode_property_table_internal, Fget_unicode_property_internal)
 +      (Fput_unicode_property_internal): New functions.
 +      (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
 +      Sunicode_property_table_internal, Sget_unicode_property_internal,
 +      and Sput_unicode_property_internal. Defvar_lisp
 +      char-code-property-alist.
 +
 +      * composite.c (CHAR_COMPOSABLE_P): Adjusted for the change of
 +      Vunicode_category_table.
 +
 +      * font.c (font_range): Adjusted for the change of
 +      Vunicode_category_table.
 +
 +2011-07-07  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      * m/iris4d.h: Remove file, move contents ...
 +      * s/irix6-5.h: ... here.
 +
 +2011-07-06  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Remove unportable assumption about struct layout (Bug#8884).
 +      * alloc.c (mark_buffer):
 +      * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
 +      (clone_per_buffer_values): Don't assume that
 +      sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
 +      This isn't true in general, and it's particularly not true
 +      if Emacs is configured with --with-wide-int.
 +      * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
 +      New macros, used in the buffer.c change.
 +
 +2011-07-05  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xsettings.c: Use both GConf and GSettings if both are available.
 +      (store_config_changed_event): Add comment.
 +      (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
 +      (store_tool_bar_style_changed): New functions.
 +      (store_monospaced_changed): Add comment. Call dpyinfo_valid.
 +      (struct xsettings): Move font inside HAVE_XFT.
 +      (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
 +      (GSETTINGS_MONO_FONT): Renamed from SYSTEM_MONO_FONT.
 +      Move inside HAVE_XFT.
 +      (something_changed_gsettingsCB): Renamed from something_changedCB.
 +      Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
 +      also.
 +      (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
 +      (GCONF_MONO_FONT): Renamed from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
 +      (something_changed_gconfCB): Renamed from something_changedCB.
 +      Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
 +      (parse_settings): Move check for font inside HAVE_XFT.
 +      (read_settings, apply_xft_settings): Add comment.
 +      (read_and_apply_settings): Add comment.  Call map_tool_bar_style and
 +      store_tool_bar_style_changed.  Move check for font inside HAVE_XFT and
 +      call store_font_name_changed.
 +      (xft_settings_event): Add comment.
 +      (init_gsettings): Add comment.  Get values for GSETTINGS_TOOL_BAR_STYLE
 +      and GSETTINGS_FONT_NAME.  Move check for fonts within HAVE_XFT.
 +      (init_gconf): Add comment.  Get values for GCONF_TOOL_BAR_STYLE
 +      and GCONF_FONT_NAME.  Move check for fonts within HAVE_XFT.
 +      (xsettings_initialize): Call init_gsettings last.
 +      (xsettings_get_system_font, xsettings_get_system_normal_font): Add
 +      comment.
 +
 +2011-07-05  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Random fixes.  E.g., (random) never returned negative values.
 +      * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
 +      subseconds part to the entropy, as that's a bit more random.
 +      Prefer signed to unsigned, since the signedness doesn't matter and
 +      in general we prefer signed.  When given a limit, use a
 +      denominator equal to INTMASK + 1, not to VALMASK + 1, because the
 +      latter isn't right if USE_2_TAGS_FOR_INTS.
 +      * sysdep.c (get_random): Return a value in the range 0..INTMASK,
 +      not 0..VALMASK.  Don't discard "excess" bits that random () returns.
 +
 +2011-07-04  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * textprop.c (text_property_stickiness):
 +      Obey Vtext_property_default_nonsticky.
 +      (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
 +      * w32fns.c (syms_of_w32fns):
 +      * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
 +
 +2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
 +      This is more efficient than Ffile_directory_p and avoids a minor race.
 +
 +2011-07-04  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * buffer.c (Foverlay_put): Say what the return value is
 +      (bug#7835).
 +
 +      * fileio.c (barf_or_query_if_file_exists): Check first if the file
 +      is a directory before asking whether to use the file name
 +      (bug#7564).
 +      (barf_or_query_if_file_exists): Make the "File is a directory"
 +      error be more correct.
 +
 +      * fns.c (Frequire): Remove the mention of the .gz files, since
 +      that's installation-specific, but keep the mention of
 +      `get-load-suffixes'.
 +
 +2011-07-04  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
 +      Report string overflow if the output is too long.
 +
 +2011-07-04  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
 +      (syms_of_gnutls): Remove duplicate DEFSYM for
 +      Qgnutls_bootprop_verify_hostname_error, an error for
 +      Qgnutls_bootprop_verify_error (which is no longer used).
 +
 +      * eval.c (find_handler_clause): Remove parameters `sig' and `data',
 +      unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca.  All callers changed.
 +      Also (re)move comments that are misplaced or no longer relevant.
 +
 +2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
 +
 +2011-07-03  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
 +      and background color parameters if they have been changed.
 +
 +2011-07-03  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
 +
 +2011-07-03  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * xsettings.c (SYSTEM_FONT): Define only when used.
 +      No need to define when HAVE_GSETTINGS || !HAVE_XFT.
 +
 +      * keymap.c (access_keymap_1): Now static.
 +
 +2011-07-02  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * keyboard.c (command_loop_1): If a down-mouse event is unbound,
 +      leave any prefix arg for the up event (Bug#1586).
 +
 +2011-07-02  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 +
 +      * lread.c (syms_of_lread): Mention single symbols defined by
 +      `defvar' or `defconst' (bug#7154).
 +
 +      * fns.c (Frequire): Mention .el.gz files (bug#7314).
 +      (Frequire): Mention get-load-suffixes.
 +
 +2011-07-02  Martin Rudalics  <rudalics@gmx.at>
 +
 +      * window.h (window): Remove clone_number slot.
 +      * window.c (Fwindow_clone_number, Fset_window_clone_number):
 +      Remove.
 +      (make_parent_window, make_window, saved_window)
 +      (Fset_window_configuration, save_window_save): Don't deal with
 +      clone numbers.
 +      * buffer.c (Qclone_number): Remove declaration.
 +      (sort_overlays, overlay_strings): Don't deal with clone numbers.
 +
 +2011-07-02  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      Add multiple inheritance to keymaps.
 +      * keymap.c (Fmake_composed_keymap): New function.
 +      (Fset_keymap_parent): Simplify.
 +      (fix_submap_inheritance): Remove.
 +      (access_keymap_1): New function extracted from access_keymap to handle
 +      embedded parents and handle lists of maps.
 +      (access_keymap): Use it.
 +      (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
 +      (Fcopy_keymap): Handle embedded parents.
 +      (Fcommand_remapping, define_as_prefix): Simplify.
 +      (Fkey_binding): Simplify.
 +      (syms_of_keymap): Move minibuffer-local-completion-map,
 +      minibuffer-local-filename-completion-map,
 +      minibuffer-local-must-match-map, and
 +      minibuffer-local-filename-must-match-map to Elisp.
 +      (syms_of_keymap): Defsubr make-composed-keymap.
 +      * keyboard.c (menu_bar_items): Use map_keymap_canonical.
 +      (parse_menu_item): Trivial simplification.
 +
 +2011-07-01  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (SETTINGS_LIBS): Fix typo.
 +
 +2011-07-01  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny patch)
 +
 +      * coding.c (Fencode_coding_string): Record the last coding system
 +      used, as the function doc string says (bug#8738).
 +
 +2011-07-01  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xsettings.c (store_monospaced_changed): Take new font as arg and
 +      check for change against current_mono_font.
 +      (EMACS_TYPE_SETTINGS): Remove this and related defines.
 +      (emacs_settings_constructor, emacs_settings_get_property)
 +      (emacs_settings_set_property, emacs_settings_class_init)
 +      (emacs_settings_init, gsettings_obj): Remove.
 +      (something_changedCB): New function for HAVE_GSETTINGS.
 +      (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
 +      with value as argument.
 +      (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
 +      g_settings_new (Bug#8967).  Do not create gsettings_obj.
 +      Remove calls to g_settings_bind.  Connect something_changedCB to
 +      "changed".
 +
 +      * xgselect.c: Add defined (HAVE_GSETTINGS).
 +      (xgselect_initialize): Ditto.
 +
 +      * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
 +      (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
 +      xg_select.
 +
 +2011-07-01  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * eval.c (struct backtrace): Simplify and port the data structure.
 +      Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
 +      signed bit field, as this assumption is not portable and it makes
 +      Emacs crash when compiled with Sun C 5.8 on sparc.  Do not use
 +      "char debug_on_exit : 1" as this is not portable either; instead,
 +      use the portable "unsigned int debug_on_exit : 1".  Remove unused
 +      member evalargs.  Remove obsolete comments about cc bombing out.
 +
 +2011-06-30  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
 +      Let HAVE_GSETTINGS override HAVE_GCONF.
 +      (store_monospaced_changed): New function.
 +      (EMACS_SETTINGS): A new type derived from GObject to handle
 +      GSettings notifications.
 +      (emacs_settings_constructor, emacs_settings_get_property)
 +      (emacs_settings_set_property, emacs_settings_class_init):
 +      New functions.
 +      (gsettings_client, gsettings_obj): New variables.
 +      (GSETTINGS_SCHEMA): New define.
 +      (something_changedCB): Call store_monospaced_changed.
 +      (init_gsettings): New function.
 +      (xsettings_initialize): Call init_gsettings.
 +      (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
 +      to NULL.
 +
 +      * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Renamed from
 +      GCONF_CFLAGS/LIBS.
 +
 +2011-06-29  Martin Rudalics  <rudalics@gmx.at>
 +
 +      * window.c (resize_root_window, grow_mini_window)
 +      (shrink_mini_window): Rename Qresize_root_window to
 +      Qwindow_resize_root_window and Qresize_root_window_vertically to
 +      Qwindow_resize_root_window_vertically.
 +
 +2011-06-28  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
 +
 +2011-06-27  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * makefile.w32-in: Redesign dependencies so they reflect more
 +      clearly which files are directly included by each source file,
 +      and not through other includes.
 +
 +2011-06-27  Martin Rudalics  <rudalics@gmx.at>
 +
 +      * buffer.c (Qclone_number): Declare static and DEFSYM it.
 +      (sort_overlays, overlay_strings): When an overlay's clone number
 +      matches the window's clone number process the overlay even if
 +      the overlay's window property doesn't match the current window.
 +
 +      * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
 +      (Fwindow_hchild): Rename to Fwindow_left_child.
 +      (Fwindow_next): Rename to Fwindow_next_sibling.
 +      (Fwindow_prev): Rename to Fwindow_prev_sibling.
 +      (resize_window_check): Rename to window_resize_check.
 +      (resize_window_apply): Rename to window_resize_apply.
 +      (Fresize_window_apply): Rename to Fwindow_resize_apply.
 +      (Fdelete_other_windows_internal, resize_frame_windows)
 +      (Fsplit_window_internal, Fdelete_window_internal)
 +      (grow_mini_window, shrink_mini_window)
 +      (Fresize_mini_window_internal): Fix callers accordingly.
 +
 +2011-06-26  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * emacsgtkfixed.h: State that this is only used with Gtk+3.
 +      (emacs_fixed_set_min_size): Remove.
 +      (emacs_fixed_new): Take frame as argument.
 +
 +      * emacsgtkfixed.c: State that this is only used with Gtk+3.
 +      (_EmacsFixedPrivate): Remove minwidth/height.
 +      Add struct frame *f.
 +      (emacs_fixed_init): Initialize priv->f.
 +      (get_parent_class, emacs_fixed_set_min_size): Remove.
 +      (emacs_fixed_new): Set priv->f to argument.
 +      (emacs_fixed_get_preferred_width)
 +      (emacs_fixed_get_preferred_height): Use min_width/height from
 +      frames size_hint to set minimum and natural (Bug#8919).
 +      (XSetWMSizeHints, XSetWMNormalHints): Override these functions
 +      and use min_width/height from frames size_hint to set
 +      min_width/height (Bug#8919).
 +
 +      * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
 +      (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
 +      Fix indentation.
 +
 +2011-06-26  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
 +      bidi_at_paragraph_end, since fast_looking_at doesn't like to be
 +      called at ZV.
 +
 +2011-06-26  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * process.c (wait_reading_process_output): Bypass select if
 +      waiting for a cell while ignoring keyboard input, and input is
 +      pending.  Suggested by Jan Djärv (Bug#8869).
 +
 +2011-06-25  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Use gnulib's dup2 module instead of rolling our own.
 +      * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
 +
 +2011-06-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 +
 +      * dispnew.c (scrolling_window): Before scrolling, turn off a
 +      mouse-highlight in the window being scrolled.
 +
 +2011-06-24  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      Move DEFSYM to lisp.h and use everywhere.
 +
 +      * character.h (DEFSYM): Move declaration...
 +      * lisp.h (DEFSYM): ...here.
 +
 +      * gnutls.c:
 +      * minibuf.c:
 +      * w32menu.c:
 +      * w32proc.c:
 +      * w32select.c: Don't include character.h.
 +
 +      * alloc.c (syms_of_alloc):
 +      * buffer.c (syms_of_buffer):
 +      * bytecode.c (syms_of_bytecode):
 +      * callint.c (syms_of_callint):
 +      * casefiddle.c (syms_of_casefiddle):
 +      * casetab.c (init_casetab_once):
 +      * category.c (init_category_once, syms_of_category):
 +      * ccl.c (syms_of_ccl):
 +      * cmds.c (syms_of_cmds):
 +      * composite.c (syms_of_composite):
 +      * dbusbind.c (syms_of_dbusbind):
 +      * dired.c (syms_of_dired):
 +      * dispnew.c (syms_of_display):
 +      * doc.c (syms_of_doc):
 +      * editfns.c (syms_of_editfns):
 +      * emacs.c (syms_of_emacs):
 +      * eval.c (syms_of_eval):
 +      * fileio.c (syms_of_fileio):
 +      * fns.c (syms_of_fns):
 +      * frame.c (syms_of_frame):
 +      * fringe.c (syms_of_fringe):
 +      * insdel.c (syms_of_insdel):
 +      * keymap.c (syms_of_keymap):
 +      * lread.c (init_obarray, syms_of_lread):
 +      * macros.c (syms_of_macros):
 +      * msdos.c (syms_of_msdos):
 +      * print.c (syms_of_print):
 +      * process.c (syms_of_process):
 +      * search.c (syms_of_search):
 +      * sound.c (syms_of_sound):
 +      * syntax.c (init_syntax_once, syms_of_syntax):
 +      * terminal.c (syms_of_terminal):
 +      * textprop.c (syms_of_textprop):
 +      * undo.c (syms_of_undo):
 +      * w32.c (globals_of_w32):
 +      * window.c (syms_of_window):
 +      * xdisp.c (syms_of_xdisp):
 +      * xfaces.c (syms_of_xfaces):
 +      * xfns.c (syms_of_xfns):
 +      * xmenu.c (syms_of_xmenu):
 +      * xsettings.c (syms_of_xsettings):
 +      * xterm.c (syms_of_xterm): Use DEFSYM.
 +
 +2011-06-24  Teodor Zlatanov  <tzz@lifelogs.com>
 +
 +      * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
 +
 +2011-06-23  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Integer and buffer overflow fixes (Bug#8873).
 +
 +      * print.c (printchar, strout): Check for string overflow.
 +      (PRINTPREPARE, printchar, strout):
 +      Don't set size unless allocation succeeds.
 +
 +      * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
 +      for sizes.  Check for string overflow more accurately.
 +      Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
 +
 +      * macros.c: Integer and buffer overflow fixes.
 +      * keyboard.h (struct keyboard.kbd_macro_bufsize):
 +      * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
 +      Use ptrdiff_t, not int, for sizes.
 +      Don't increment bufsize until after realloc succeeds.
 +      Check for size-calculation overflow.
 +      (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
 +
 +      * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
 +
 +      * lread.c: Integer overflow fixes.
 +      (read_integer): Radix is now EMACS_INT, not int,
 +      to improve quality of diagnostics for out-of-range radices.
 +      Calculate buffer size correctly for out-of-range radices.
 +      (read1): Check for integer overflow in radices, and in
 +      read-circle numbers.
 +      (read_escape): Avoid int overflow.
 +      (Fload, openp, read_buffer_size, read1)
 +      (substitute_object_recurse, read_vector, read_list, map_obarray):
 +      Use ptrdiff_t, not int, for sizes.
 +      (read1): Use EMACS_INT, not int, for sizes.
 +      Check for size overflow.
 +
 +      * image.c (cache_image): Check for size arithmetic overflow.
 +
 +      * lread.c: Integer overflow issues.
 +      (saved_doc_string_size, saved_doc_string_length)
 +      (prev_saved_doc_string_size, prev_saved_doc_string_length):
 +      Now ptrdiff_t, not int.
 +      (read1): Don't assume doc string length fits in int.  Check for
 +      out-of-range doc string lengths.
 +      (read_list): Don't assume file position fits in int.
 +      (read_escape): Check for hex character overflow.
 +
 +2011-06-22  Leo Liu  <sdl.web@gmail.com>
 +
 +      * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
 +      Move to minibuffer.el.
 +
 +2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
 +      The following patches are for when GLYPH_DEBUG && !XASSERT.
 +      * dispextern.h (trace_redisplay_p, dump_glyph_string):
 +      * dispnew.c (flush_stdout):
 +      * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
 +      Mark as externally visible.
 +      * dispnew.c (check_window_matrix_pointers): Now static.
 +      * dispnew.c (window_to_frame_vpos):
 +      * xfns.c (unwind_create_frame):
 +      * xterm.c (x_check_font): Remove unused local.
 +      * scroll.c (CHECK_BOUNDS):
 +      * xfaces.c (cache_fache): Rename local to avoid shadowing.
 +      * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
 +      * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
 +      (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
 +      (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
 +      Now static.
 +      (debug_method_add): Use va_list and vsprintf rather than relying
 +      on undefined behavior with wrong number of arguments.
 +      (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
 +      Don't assume ptrdiff_t and EMACS_INT are the same width as int.
 +      In this code, it's OK to assume C99 behavior for ptrdiff_t formats
 +      since we're not interested in debugging glyphs with old libraries.
 +      * xfaces.c (cache_face): Move debugging code earlier; this pacifies
 +      GCC 4.6.0's static checking.
 +
 +2011-06-22  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Integer overflow and signedness fixes (Bug#8873).
 +      A few related buffer overrun fixes, too.
 +
 +      * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
 +
 +      * dispextern.h (struct face.stipple):
 +      * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
 +      (x_bitmap_mask, x_allocate_bitmap_record)
 +      (x_create_bitmap_from_data, x_create_bitmap_from_file)
 +      (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
 +      (x_create_bitmap_from_xpm_data):
 +      * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
 +      * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
 +      (.bitmaps_last):
 +      * xfaces.c (load_pixmap):
 +      * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
 +      * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
 +      (.bitmaps_last, struct x_output.icon_bitmap):
 +      Use ptrdiff_t, not int, for bitmap indexes.
 +      (x_allocate_bitmap_record): Check for size overflow.
 +      * dispextern.h, lisp.h: Adjust to API changes elsewhere.
 +
 +      Use ptrdiff_t, not int, for overlay counts.
 +      * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
 +      * editfns.c (overlays_around, get_pos_property):
 +      * textprop.c (get_char_property_and_overlay):
 +      * xdisp.c (next_overlay_change, note_mouse_highlight):
 +      * xfaces.c (face_at_buffer_position):
 +      * buffer.c (OVERLAY_COUNT_MAX): New macro.
 +      (overlays_at, overlays_in, sort_overlays, Foverlays_at)
 +      (Fnext_overlay_change, Fprevious_overlay_change)
 +      (mouse_face_overlay_overlaps, Foverlays_in):
 +      Use ptrdiff_t, not int, for sizes.
 +      (overlays_at, overlays_in): Check for size-calculation overflow.
 +
 +      * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
 +
 +      * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
 +      (x_session_initialize): Do not assume string length fits in int.
 +
 +      * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
 +      This is unlikely, but can occur if DPI is outlandish.
 +
 +      * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
 +      * xselect.c (Fx_get_atom_name): Avoid need for strlen.
 +
 +      * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
 +      * xrdb.c (magic_file_p, search_magic_path):
 +      Omit last arg SUFFIX; it was always 0.  All callers changed.
 +      (magic_file_p): Use ptrdiff_t, not int.  Check for size overflow.
 +
 +      * xfont.c (xfont_match): Avoid need for strlen.
 +
 +      * xfns.c: Don't assume strlen fits in int.
 +      (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
 +
 +      * xdisp.c (message_log_check_duplicate): Return intmax_t,
 +      not unsigned long, as we prefer signed integers.  All callers changed.
 +      Detect integer overflow in repeat count.
 +      (message_dolog): Don't assume print length fits in 39 bytes.
 +      (display_mode_element): Don't assume strlen fits in int.
 +
 +      * termcap.c: Don't assume sizes fit in int and never overflow.
 +      (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
 +      (gobble_line): Check for size-calculation overflow.
 +
 +      * minibuf.c (Fread_buffer):
 +      * lread.c (intern, intern_c_string):
 +      * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
 +      Don't assume string length fits in int.
 +
 +      * keyboard.c (parse_tool_bar_item):
 +      * gtkutil.c (style_changed_cb): Avoid need for strlen.
 +
 +      * font.c: Don't assume string length fits in int.
 +      (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
 +      Use ptrdiff_t, not int.
 +      (font_intern_prop): Don't assume string length fits in int.
 +      Don't assume integer property fits in fixnum.
 +      * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
 +
 +      * filelock.c: Fix some buffer overrun and integer overflow issues.
 +      (get_boot_time): Don't assume gzip command string fits in 100 bytes.
 +      Reformulate so as not to need the command string.
 +      Invoke gzip -cd rather than gunzip, as it's more portable.
 +      (lock_info_type, lock_file_1, lock_file):
 +      Don't assume pid_t and time_t fit in unsigned long.
 +      (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
 +      (current_lock_owner): Prefer signed type for sizes.
 +      Use memcpy, not strncpy, where memcpy is what is really wanted.
 +      Don't assume (via atoi) that time_t and pid_t fit in int.
 +      Check for time_t and/or pid_t out of range, e.g., via a network share.
 +      Don't alloca where an auto var works fine.
 +
 +      * fileio.c: Fix some integer overflow issues.
 +      (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
 +      Don't assume string length fits in int.
 +      (directory_file_name): Don't assume string length fits in long.
 +      (make_temp_name): Don't assume pid fits in int, or that its print
 +      length is less than 20.
 +
 +      * data.c (Fsubr_name): Rewrite to avoid a strlen call.
 +
 +      * coding.c (make_subsidiaries): Don't assume string length fits in int.
 +
 +      * callproc.c (child_setup): Rewrite to avoid two strlen calls.
 +
 +      * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
 +      We prefer signed integers, even for size calculations.
 +
 +      * emacs.c: Don't assume string length fits in 'int'.
 +      (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
 +      (main): Don't invoke strlen when not needed.
 +
 +      * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
 +      (XD_DEBUG_MESSAGE): Don't waste a byte.
 +
 +      * callproc.c (getenv_internal_1, getenv_internal)
 +      (Fgetenv_internal):
 +      * buffer.c (init_buffer): Don't assume string length fits in 'int'.
 +
 +      * lread.c (invalid_syntax): Omit length argument.
 +      All uses changed.  This doesn't fix a bug, but it simplifies the
 +      code away from its former Hollerith-constant appearance, and it's
 +      one less 'int' to worry about when looking at integer-overflow issues.
 +      (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
 +
 +      * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
 +      This didn't break anything, but it didn't help either.
 +      It's confusing to put a bogus integer in a place where the actual
 +      value does not matter.
 +      (LIST_END_P): Remove unused macro and its bogus comment.
 +      (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
 +
 +      * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
 +      This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
 +      implementation.
 +      (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
 +      We prefer signed types, and the value cannot exceed the EMACS_INT
 +      range anyway (because otherwise the length would not be representable).
 +      (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
 +      not EMACS_UINT and EMACS_INT, when converting pointer to integer.
 +      This avoids a GCC warning when WIDE_EMACS_INT.
 +
 +      * indent.c (sane_tab_width): New function.
 +      (current_column, scan_for_column, Findent_to, position_indentation)
 +      (compute_motion): Use it.  This is just for clarity.
 +      (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
 +
 +      * image.c (xbm_image_p): Don't assume stated width, height fit in int.
 +
 +      * lisp.h (lint_assume): New macro.
 +      * composite.c (composition_gstring_put_cache):
 +      * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
 +
 +      * editfns.c, insdel.c:
 +      Omit unnecessary forward decls, to simplify future changes.
 +
 +      * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
 +
 +      * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
 +
 +      * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
 +      Use much-faster test for byte-length change.
 +      Don't assume string byte-length fits in 'int'.
 +      Check that character arg fits in 'int'.
 +      (mapcar1): Declare byte as byte, for clarity.
 +
 +      * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
 +
 +      * fns.c (concat): Catch string overflow earlier.
 +      Do not rely on integer wraparound.
 +
 +      * dispextern.h (struct it.overlay_strings_charpos)
 +      (struct it.selective): Now EMACS_INT, not int.
 +      * xdisp.c (forward_to_next_line_start)
 +      (back_to_previous_visible_line_start)
 +      (reseat_at_next_visible_line_start, next_element_from_buffer):
 +      Don't arbitrarily truncate the value of 'selective' to int.
 +
 +      * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
 +
 +      * composite.c: Don't truncate sizes to 'int'.
 +      (composition_gstring_p, composition_reseat_it)
 +      (composition_adjust_point): Use EMACS_INT, not int.
 +      (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
 +      not EMACS_UINT, for indexes.
 +
 +      * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
 +
 +      * buffer.c: Include <verify.h>.
 +      (struct sortvec.priority, struct sortstr.priority):
 +      Now EMACS_INT, not int.
 +      (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
 +      (struct sortstr.size, record_overlay_string)
 +      (struct sortstrlist.size, struct sortlist.used):
 +      Don't truncate size to int.
 +      (record_overlay_string): Check for size-calculation overflow.
 +      (init_buffer_once): Check at compile-time, not run-time.
 +
 +2011-06-22  Jim Meyering  <meyering@redhat.com>
 +
 +      Don't leak an XBM-image-sized buffer
 +      * image.c (xbm_load): Free the image buffer after using it.
 +
 +2011-06-21  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Port to Sun C.
 +      * composite.c (find_automatic_composition): Omit needless 'return 0;'
 +      that Sun C diagnosed.
 +      * fns.c (secure_hash): Fix pointer signedness issue.
 +      * intervals.c (static_offset_intervals): New function.
 +      (offset_intervals): Use it.
  
 -2011-07-01  Eli Zaretskii  <eliz@gnu.org>
 +2011-06-21  Leo Liu  <sdl.web@gmail.com>
  
 -      * dispextern.h (struct bidi_string_data): New member `unibyte'.
 +      * deps.mk (fns.o):
 +      * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
 +      sha512.h.
  
 -      * xdisp.c (handle_single_display_spec, next_overlay_string)
 -      (get_overlay_strings_1, reseat_1, reseat_to_string)
 -      (push_display_prop): Set up the `unibyte' member of bidi_it.string
 -      correctly.  Don't assume unibyte strings are not bidi-reordered.
 -      (compute_display_string_pos)
 -      (compute_display_string_end): Fix handling the case of C string.
 +      * fns.c (secure_hash): Rename from crypto_hash_function and change
 +      the first arg to accept symbols.
 +      (Fsecure_hash): New primitive.
 +      (syms_of_fns): New symbols.
  
 -      * bidi.c (bidi_count_bytes, bidi_char_at_pos): Accept an
 -      additional argument UNIBYTE, and support unibyte strings.  All
 -      callers changed.
 -      (bidi_fetch_char): Support unibyte strings.
 +2011-06-20  Deniz Dogan  <deniz@dogan.se>
  
 -2011-06-25  Eli Zaretskii  <eliz@gnu.org>
 +      * process.c (Fset_process_buffer): Clarify return value in
 +      docstring.
  
 -      * xdisp.c (set_iterator_to_next, get_visually_first_element): Use
 -      it->bidi_it.string.schars rather than it->string_nchars when
 -      testing whether we're beyond string end, because string_nchars is
 -      zero for strings that come from overlays and display properties.
 +2011-06-18  Chong Yidong  <cyd@stupidchicken.com>
  
 -      * bidi.c (bidi_cache_iterator_state): Fix a bug with testing
 -      character positions against the cached range, when we use a
 -      stacked cache.
 +      * dispnew.c (add_window_display_history): Use BVAR.
  
 -      * xdisp.c (push_it, pop_it): Save and restore it.
 +      * xdisp.c (debug_method_add): Use BVAR.
 +      (check_window_end, dump_glyph_matrix, dump_glyph)
 +      (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
  
 -      * dispextern.h (struct iterator_stack_entry): New member
 -      paragraph_embedding.
 +      * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
 +      Likewise.
  
 -      * xdisp.c (handle_single_display_spec, next_overlay_string)
 -      (get_overlay_strings_1, push_display_prop): Set up the bidi
 -      iterator for displaying display or overlay strings.
 -      (forward_to_next_line_start): Don't use the shortcut if
 -      bidi-iterating.
 -      (back_to_previous_visible_line_start): If handle_display_prop
 -      pushed the iterator stack, restore the internal state of the bidi
 -      iterator by calling bidi_pop_it same number of times.
 -      (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
 -      and we are bidi-iterating, don't decrement the iterator position;
 -      instead, set the first_elt flag in the bidi iterator, to produce
 -      the same effect.
 -      (reseat_1): Remove redundant setting of string_from_display_prop_p.
 -      (push_display_prop): xassert that we are iterating a buffer.
 +      * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
 +      check till after the cache is created in init_frame_faces.
 +
 +2011-06-17  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
 +
 +2011-06-16  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
 +      Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
 +      hosts with pre-C99 libraries, because pD is wrongly defined to "t".
 +
 +      Improve buffer-overflow checking (Bug#8873).
 +      * fileio.c (Finsert_file_contents):
 +      * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
 +      Remove the old (too-loose) buffer overflow checks.
 +      They weren't needed, since make_gap checks for buffer overflow.
 +      * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
 +      The old code merely checked for Emacs fixnum overflow, and relied
 +      on undefined (wraparound) behavior.  The new code avoids undefined
 +      behavior, and also checks for ptrdiff_t and/or size_t overflow.
 +
 +      * editfns.c (Finsert_char): Don't dump core with very negative counts.
 +      Tune.  Don't use wider integers than needed.  Don't use alloca.
 +      Use a bigger 'string' buffer.  Rewrite to avoid 'n > 0' test.
 +
 +      * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
 +
 +      * insdel.c, lisp.h (buffer_overflow): New function.
 +      (insert_from_buffer_1, replace_range, replace_range_2):
 +      * insdel.c (make_gap_larger):
 +      * editfns.c (Finsert_char):
 +      * fileio.c (Finsert_file_contents): Use it, to normalize wording.
 +
 +      * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
 +
 +2011-06-15  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Integer overflow and signedness fixes (Bug#8873).
  
 -      * bidi.c (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
 +      * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
 +      (GET_CCL_RANGE, IN_INT_RANGE): Use it.
  
 -2011-06-24  Eli Zaretskii  <eliz@gnu.org>
 +      * fileio.c: Don't assume EMACS_INT fits in off_t.
 +      (emacs_lseek): New static function.
 +      (Finsert_file_contents, Fwrite_region): Use it.
 +      Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
  
 -      * xdisp.c (push_it, pop_it): Save and restore the state of the
 -      bidi iterator.  Save and restore the bidi_p flag.
 -      (pop_it): Iterate out of display property for string iteration as
 -      well.
 -      (iterate_out_of_display_property): Support iteration over strings.
 -      (handle_single_display_spec): Set up it->bidi_it for iteration
 -      over a display string, and call bidi_init_it.
 +      * fns.c (Fload_average): Don't assume 100 * load average fits in int.
 +
 +      * fns.c: Don't overflow int when computing a list length.
 +      * fns.c (QUIT_COUNT_HEURISTIC): New constant.
 +      (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
 +      truncation on 64-bit hosts.  Check for QUIT every
 +      QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
 +      faster and is responsive enough.
 +      (Flength): Report an error instead of overflowing an integer.
 +      (Fsafe_length): Return a float if the value is not representable
 +      as a fixnum.  This shouldn't happen except in contrived situations.
 +      (Fnthcdr, Fsort): Don't assume list length fits in int.
 +      (Fcopy_sequence): Don't assume vector length fits in int.
  
 -      * dispextern.h (struct iterator_stack_entry): New member bidi_p.
 -      (struct it): Member bidi_p is now a bit field 1 bit wide.
 +      * alloc.c: Check that resized vectors' lengths fit in fixnums.
 +      (header_size, word_size): New constants.
 +      (allocate_vectorlike): Don't check size overflow here.
 +      (allocate_vector): Check it here instead, since this is the only
 +      caller of allocate_vectorlike that could cause overflow.
 +      Check that the new vector's length is representable as a fixnum.
  
 -2011-06-23  Eli Zaretskii  <eliz@gnu.org>
 +      * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
 +      The previous code was bogus.  For example, next_almost_prime (32)
 +      returned 39, which is undesirable as it is a multiple of 3; and
 +      next_almost_prime (24) returned 25, which is a multiple of 5 so
 +      why was the code bothering to check for multiples of 7?
 +
 +      * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
 +
 +      * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
 +
 +      Variadic C functions now count arguments with ptrdiff_t.
 +      This partly undoes my 2011-03-30 change, which replaced int with size_t.
 +      Back then I didn't know that the Emacs coding style prefers signed int.
 +      Also, in the meantime I found a few more instances where arguments
 +      were being counted with int, which may truncate counts on 64-bit
 +      machines, or EMACS_INT, which may be unnecessarily wide.
 +      * lisp.h (struct Lisp_Subr.function.aMANY)
 +      (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
 +      Arg counts are now ptrdiff_t, not size_t.
 +      All variadic functions and their callers changed accordingly.
 +      (struct gcpro.nvars): Now size_t, not size_t.  All uses changed.
 +      * bytecode.c (exec_byte_code): Check maxdepth for overflow,
 +      to avoid potential buffer overrun.  Don't assume arg counts fit in 'int'.
 +      * callint.c (Fcall_interactively): Check arg count for overflow,
 +      to avoid potential buffer overrun.  Use signed char, not 'int',
 +      for 'varies' array, so that we needn't bother to check its size
 +      calculation for overflow.
 +      * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
 +      * eval.c (apply_lambda):
 +      * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
 +      (struct textprop_rec.argnum): Now ptrdiff_t, not int.  All uses changed.
 +      (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
 +
 +      * callint.c (Fcall_interactively): Don't use index var as event count.
 +
 +      * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
 +      * mem-limits.h (SIZE): Remove; no longer used.
 +
 +      * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
 +
 +      Remove unnecessary casts.
 +      * xterm.c (x_term_init):
 +      * xfns.c (x_set_border_pixel):
 +      * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
 +      These aren't needed now that we assume ANSI C.
 +
 +      * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
 +      It's more likely to cause problems (due to unsigned overflow)
 +      than to cure them.
 +
 +      * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
 +
 +      * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
 +
 +      * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
 +
 +      * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
 +
 +      * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
 +
 +      * lread.c (Fload): Don't compare a possibly-garbage time_t value.
 +
 +      GLYPH_CODE_FACE returns EMACS_INT, not int.
 +      * dispextern.h (merge_faces):
 +      * xfaces.c (merge_faces):
 +      * xdisp.c (get_next_display_element, next_element_from_display_vector):
 +      Don't assume EMACS_INT fits in int.
 +
 +      * character.h (CHAR_VALID_P): Remove unused parameter.
 +      * fontset.c, lisp.h, xdisp.c: All uses changed.
 +
 +      * editfns.c (Ftranslate_region_internal): Omit redundant test.
 +
 +      * fns.c (concat): Minor tuning based on overflow analysis.
 +      This doesn't fix any bugs.  Use int to hold character, instead
 +      of constantly refetching from Emacs object.  Use XFASTINT, not
 +      XINT, for value known to be a character.  Don't bother comparing
 +      a single byte to 0400, as it's always less.
 +
 +      * floatfns.c (Fexpt):
 +      * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
 +
 +      * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
 +      for characters.
 +
 +      * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
 +
 +      * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
 +      Without this fix, on a 64-bit host (aset S 0 4294967386) would
 +      incorrectly succeed when S was a string, because 4294967386 was
 +      truncated before it was used.
 +
 +      * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
 +      Otherwise, an out-of-range integer could cause undefined behavior
 +      on a 64-bit host.
 +
 +      * composite.c: Use int, not EMACS_INT, for characters.
 +      (fill_gstring_body, composition_compute_stop_pos): Use int, not
 +      EMACS_INT, for values that are known to be in character range.
 +      This doesn't fix any bugs but is the usual style inside Emacs and
 +      may generate better code on 32-bit machines.
 +
 +      Make sure a 64-bit char is never passed to ENCODE_CHAR.
 +      This is for reasons similar to the recent CHAR_STRING fix.
 +      * charset.c (Fencode_char): Check that character arg is actually
 +      a character.  Pass an int to ENCODE_CHAR.
 +      * charset.h (ENCODE_CHAR): Verify that the character argument is no
 +      wider than 'int', as a compile-time check to prevent future regressions
 +      in this area.
 +
 +      * character.c (char_string): Remove unnecessary casts.
 +
 +      Make sure a 64-bit char is never passed to CHAR_STRING.
 +      Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
 +      by silently ignoring the top 32 bits, allowing some values
 +      that were far too large to be valid characters.
 +      * character.h: Include <verify.h>.
 +      (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
 +      arguments are no wider than unsigned, as a compile-time check
 +      to prevent future regressions in this area.
 +      * data.c (Faset):
 +      * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
 +      (Fsubst_char_in_region):
 +      * fns.c (concat):
 +      * xdisp.c (decode_mode_spec_coding):
 +      Adjust to CHAR_STRING's new requirement.
 +      * editfns.c (Finsert_char, Fsubst_char_in_region):
 +      * fns.c (concat): Check that character args are actually
 +      characters.  Without this test, these functions did the wrong
 +      thing with wildly out-of-range values on 64-bit hosts.
 +
 +      Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
 +      These casts should not be needed on 32-bit hosts, either.
 +      * keyboard.c (read_char):
 +      * lread.c (Fload): Remove casts to unsigned.
 +
 +      * lisp.h (UNSIGNED_CMP): New macro.
 +      This fixes comparison bugs on 64-bit hosts.
 +      (ASCII_CHAR_P): Use it.
 +      * casefiddle.c (casify_object):
 +      * character.h (ASCII_BYTE_P, CHAR_VALID_P)
 +      (SINGLE_BYTE_CHAR_P, CHAR_STRING):
 +      * composite.h (COMPOSITION_ENCODE_RULE_VALID):
 +      * dispextern.h (FACE_FROM_ID):
 +      * keyboard.c (read_char): Use UNSIGNED_CMP.
 +
 +      * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
 +      not to EMACS_INT, to avoid GCC warning.
 +
 +      * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
 +
 +      * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
 +      The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
 +      isn't needed on 32-bit machines.
 +
 +      * buffer.c (Fgenerate_new_buffer_name):
 +      Use EMACS_INT for count, not int.
 +      (advance_to_char_boundary): Return EMACS_INT, not int.
 +
 +      * data.c (Qcompiled_function): Now static.
 +
 +      * window.c (window_body_lines): Now static.
 +
 +      * image.c (gif_load): Rename local to avoid shadowing.
 +
 +      * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
 +      (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
 +      * alloc.c (make_save_value): Integer argument is now of type
 +      ptrdiff_t, not int.
 +      (mark_object): Use ptrdiff_t, not int.
 +      * lisp.h (pD): New macro.
 +      * print.c (print_object): Use it.
 +
 +      * alloc.c: Use EMACS_INT, not int, to count objects.
 +      (total_conses, total_markers, total_symbols, total_vector_size)
 +      (total_free_conses, total_free_markers, total_free_symbols)
 +      (total_free_floats, total_floats, total_free_intervals)
 +      (total_intervals, total_strings, total_free_strings):
 +      Now EMACS_INT, not int.  All uses changed.
 +      (Fgarbage_collect): Compute overall total using a double, so that
 +      integer overflow is less likely to be a problem.  Check for overflow
 +      when converting back to an integer.
 +      (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
 +      (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
 +      These were 'int' variables that could overflow on 64-bit hosts;
 +      they were never used, so remove them instead of repairing them.
 +      (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
 +      (inhibit_garbage_collection): Set gc_cons_threshold to max value.
 +      Previously, this ceilinged at INT_MAX, but that doesn't work on
 +      64-bit machines.
 +      (allocate_pseudovector): Don't use EMACS_INT when int would do.
 +
 +      * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
 +      (allocate_vectorlike): Check for ptrdiff_t overflow.
 +      (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
 +      when a (possibly-narrower) signed value would do just as well.
 +      We prefer using signed arithmetic, to avoid comparison confusion.
 +
 +      * alloc.c: Catch some string size overflows that we were missing.
 +      (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
 +      for convenience in STRING_BYTES_MAX.
 +      (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
 +      The definition here is exact; the one in lisp.h was approximate.
 +      (allocate_string_data): Check for string overflow.  This catches
 +      some instances we weren't catching before.  Also, it catches
 +      size_t overflow on (unusual) hosts where SIZE_MAX <= min
 +      (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
 +      and ptrdiff_t and EMACS_INT are both 64 bits.
 +
 +      * character.c, coding.c, doprnt.c, editfns.c, eval.c:
 +      All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
 +      * lisp.h (STRING_BYTES_BOUND): Renamed from STRING_BYTES_MAX.
 +
 +      * character.c (string_escape_byte8): Fix nbytes/nchars typo.
 +
 +      * alloc.c (Fmake_string): Check for out-of-range init.
 +
 +2011-06-15  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
 +
 +2011-06-14  Jan Djärv  <jan.h.d@swipnet.se>
 +
 +      * xfns.c (x_set_scroll_bar_default_width): Remove argument to
 +      xg_get_default_scrollbar_width.
 +
 +      * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
 +      (int_gtk_range_get_value): Move to the scroll bar part of the file.
 +      (style_changed_cb): Call update_theme_scrollbar_width and call
 +      x_set_scroll_bar_default_width and xg_frame_set_char_size for
 +      all frames (Bug#8505).
 +      (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
 +      Call gtk_window_set_resizable if HAVE_GTK3.
 +      (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
 +      and height if HAVE_GTK3 (Bug#8505).
 +      (scroll_bar_width_for_theme): New variable.
 +      (update_theme_scrollbar_width): New function.
 +      (xg_get_default_scrollbar_width): Move code to
 +      update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
 +      (xg_initialize): Call update_theme_scrollbar_width.
 +
 +      * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
 +
 +      * emacsgtkfixed.c, emacsgtkfixed.h: New files.
 +
 +2011-06-12  Martin Rudalics  <rudalics@gmx.at>
 +
 +      * frame.c (make_frame): Call other_buffer_safely instead of
 +      other_buffer.
 +
 +      * window.c (temp_output_buffer_show): Call display_buffer with
 +      second argument Vtemp_buffer_show_specifiers and reset latter
 +      immediately after the call.
 +      (Vtemp_buffer_show_specifiers): New variable.
 +      (auto_window_vscroll_p, next_screen_context_lines)
 +      (Vscroll_preserve_screen_position): Remove leading asterisks from
 +      doc-strings.
 +
 +2011-06-12  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Fix minor problems found by GCC 4.6.0 static checking.
 +      * buffer.c (Qclone_number): Remove for now, as it's unused.
 +      (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
 +      (record_buffer): Remove unused local.
 +      * frame.c (other_visible_frames, frame_buffer_list): Now static.
 +      (set_frame_buffer_list): Remove; unused.
 +      * frame.h (other_visible_frames): Remove decl.
 +      * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
 +      * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
 +      (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
 +      if HAVE_GPM.
 +      * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
 +      * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
 +      Define only if HAVE_GPM.
 +      * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
 +      (update_hints_inhibit): Remove; never set.  All uses removed.
 +      * widgetprv.h (emacsFrameClassRec): Remove decl.
 +      * window.c (delete_deletable_window): Now returns void, since it
 +      wasn't returning anything.
 +      (compare_window_configurations): Remove unused locals.
 +      * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
 +      * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
 +      (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
 +      the same widths as pointers.  This follows up on the 2011-05-06 patch.
 +      * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
 +      * xterm.h: Likewise.
 +      (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
 +
 +2011-06-12  Juanma Barranquero  <lekktu@gmail.com>
  
 -      * dispextern.h (bidi_push_it, bidi_pop_it): Add prototypes.
 +      * makefile.w32-in: Update dependencies.
 +      (LISP_H): Add lib/intprops.h.
 +
 +2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * image.c (gif_load): Add animation frame delay to the metadata.
 +      (syms_of_image): Use DEFSYM.  New symbol `delay'.
 +
 +2011-06-11  Martin Rudalics  <rudalics@gmx.at>
 +
 +      * window.c (delete_deletable_window): Re-add.
 +      (Fset_window_configuration): Rewrite to handle dead buffers and
 +      consequently deletable windows.
 +      (window_tree, Fwindow_tree): Remove.  Supply functionality in
 +      window.el.
 +      (compare_window_configurations): Simplify code.
 +
 +2011-06-11  Andreas Schwab  <schwab@linux-m68k.org>
 +
 +      * image.c (imagemagick_load_image): Fix type mismatch.
 +      (Fimagemagick_types): Likewise.
 +
 +      * window.h (replace_buffer_in_windows): Declare.
 +
 +2011-06-11  Martin Rudalics  <rudalics@gmx.at>
 +
 +      * buffer.c: New Lisp objects Qbuffer_list_update_hook and
 +      Qclone_number.  Remove external declaration of Qdelete_window.
 +      (Fbuffer_list): Rewrite doc-string.  Minor restructuring of
 +      code.
 +      (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer): Run
 +      Qbuffer_list_update_hook if allowed.
 +      (Fother_buffer): Rewrite doc-string.  Major rewrite for new
 +      buffer list implementation.
 +      (other_buffer_safely): New function.
 +      (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
 +      calls to replace_buffer_in_windows and
 +      replace_buffer_in_windows_safely.  Run Qbuffer_list_update_hook
 +      if allowed.
 +      (record_buffer): Inhibit quitting and rewrite using quittable
 +      functions.  Run Qbuffer_list_update_hook if allowed.
 +      (Frecord_buffer, Funrecord_buffer): New functions.
 +      (switch_to_buffer_1, Fswitch_to_buffer): Remove.  Move
 +      switch-to-buffer to window.el.
 +      (bury-buffer): Move to window.el.
 +      (Vbuffer_list_update_hook): New variable.
 +
 +      * lisp.h (other_buffer_safely): Add prototype in buffer.c
 +      section.
 +
 +      * window.h (resize_frame_windows): Move up in code.
 +      (Fwindow_frame): Remove EXFUN.
 +      (replace_buffer_in_all_windows): Remove prototype.
 +      (replace_buffer_in_windows_safely): Add prototype.
 +
 +      * window.c: Declare Qdelete_window static again.  Move down
 +      declaration of select_count.
 +      (Fnext_window, Fprevious_window): Rewrite doc-strings.
 +      (Fother_window): Move to window.el.
 +      (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
 +      cases.  Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
 +      (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
 +      window.el.
 +      (replace_buffer_in_windows): Implement by calling
 +      Qreplace_buffer_in_windows.
 +      (replace_buffer_in_all_windows): Remove with some functionality
 +      moved into replace_buffer_in_windows_safely.
 +      (replace_buffer_in_windows_safely): New function.
 +      (select_window_norecord, select_frame_norecord): Move in front
 +      of run_window_configuration_change_hook.  Remove now obsolete
 +      declarations.
 +      (Fset_window_buffer): Rewrite doc-string.  Call
 +      Qrecord_window_buffer.
 +      (keys_of_window): Move binding for other-window to window.el.
 +
 +2011-06-11  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * dispextern.h (struct image): Replace data member, whose int_val
 +      and ptr_val fields were not used by anything, with a single
 +      lisp_val object.
 +
 +      * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
 +      (gif_clear_image, gif_load, imagemagick_load_image)
 +      (gs_clear_image, gs_load): Callers changed.
 +
 +2011-06-10  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * buffer.h: Include <time.h>, for time_t.
 +      Needed to build on FreeBSD 8.2.  Problem reported by Herbert J. Skuhra.
 +
 +      Fix minor problems found by static checking.
 +
 +      * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
 +
 +      Make identifiers static if they are not used in other modules.
 +      * data.c (Qcompiled_function, Qframe, Qvector):
 +      * image.c (QimageMagick, Qsvg):
 +      * minibuf.c (Qmetadata):
 +      * window.c (resize_window_check, resize_root_window): Now static.
 +      * window.h (resize_window_check, resize_root_window): Remove decls.
 +
 +      * window.c (window_deletion_count, delete_deletable_window):
 +      Remove; unused.
 +      (window_body_lines): Now static.
 +      (Fdelete_other_windows_internal): Mark vars as initialized.
 +      Make sure 'resize_failed' is initialized.
 +      (run_window_configuration_change_hook): Rename local to avoid shadowing.
 +      (resize_window_apply): Remove unused local.
 +      * window.h (delete_deletable_window): Remove decl.
 +
 +      * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
 +      (imagemagick_load_image): Fix pointer signedness problem by changing
 +      last arg from unsigned char * to char *.  All uses changed.
 +      Also, fix a local for similar reasons.
 +      Remove unused locals.  Remove locals to avoid shadowing.
 +      (fn_rsvg_handle_free): Remove; unused.
 +      (svg_load, svg_load_image): Fix pointer signedness problem.
 +      (imagemagick_load_image): Don't use garbage pointer image_wand.
 +
 +      * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
 +
 +2011-06-10  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * image.c (gif_load): Fix omitted cast error introduced by
 +      2011-06-06 change.
 +
 +2011-06-10  Martin Rudalics  <rudalics@gmx.at>
 +
 +      * window.h (resize_proportionally, orig_total_lines)
 +      (orig_top_line): Remove from window structure.
 +      (set_window_height, set_window_width, change_window_heights)
 +      (Fdelete_window): Remove prototypes.
 +      (resize_frame_windows): Remove duplicate declaration.
  
 -      * bidi.c (bidi_push_it, bidi_pop_it): New functions.
 -      (bidi_initialize): Initialize the bidi cache start stack pointer.
 -      (bidi_cache_ensure_space): New function, refactored from part of
 -      bidi_cache_iterator_state.
 +2011-06-10  Eli Zaretskii  <eliz@gnu.org>
  
 -2011-06-18  Eli Zaretskii  <eliz@gnu.org>
 +      * window.h (resize_frame_windows, resize_window_check)
 +      (delete_deletable_window, resize_root_window)
 +      (resize_frame_windows): Declare prototypes.
 +
 +      * window.c (resize_window_apply): Make definition be "static" to
 +      match the prototype.
 +
 +2011-06-10  Martin Rudalics  <rudalics@gmx.at>
 +
 +      * window.c: Remove declarations of Qwindow_size_fixed,
 +      window_min_size_1, window_min_size_2, window_min_size,
 +      size_window, window_fixed_size_p, enlarge_window, delete_window.
 +      Remove static from declaration of Qdelete_window, it's
 +      temporarily needed by Fbury_buffer.
 +      (replace_window): Don't assign orig_top_line and
 +      orig_total_lines.
 +      (Fdelete_window, delete_window): Remove.  Window deletion is
 +      handled by window.el.
 +      (window_loop): Remove DELETE_OTHER_WINDOWS case.  Replace
 +      Fdelete_window calls with calls to Qdelete_window.
 +      (Fdelete_other_windows): Remove.  Deleting other windows is
 +      handled by window.el.
 +      (window_fixed_size_p): Remove.  Fixed-sizeness of windows is
 +      handled in window.el.
 +      (window_min_size_2, window_min_size_1, window_min_size): Remove.
 +      Window minimum sizes are handled in window.el.
 +      (shrink_windows, size_window, set_window_height)
 +      (set_window_width, change_window_heights, window_height)
 +      (window_width, CURBEG, CURSIZE, enlarge_window)
 +      (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
 +      (Fenlarge_window, Fshrink_window): Remove.  Window resizing is
 +      handled in window.el.
 +      (make_dummy_parent): Rename to make_parent_window and give it a
 +      second argument horflag.
 +      (make_window): Don't set resize_proportionally any more.
 +      (Fsplit_window): Remove.  Windows are split in window.el.
 +      (save_restore_action, save_restore_orig_size)
 +      (shrink_window_lowest_first, save_restore_orig_size): Remove.
 +      Resize mini windows in window.el.
 +      (grow_mini_window, shrink_mini_window): Implement by calling
 +      Qresize_root_window_vertically, resize_window_check and
 +      resize_window_apply.
 +      (saved_window, Fset_window_configuration, save_window_save): Do
 +      not handle orig_top_line, orig_total_lines, and
 +      resize_proportionally.
 +      (window_min_height, window_min_width): Move to window.el.
 +      (keys_of_window): Move bindings for delete-other-windows,
 +      split-window, delete-window and enlarge-window to window.el.
 +
 +      * buffer.c: Temporarily extern Qdelete_window.
 +      (Fbury_buffer): Temporarily call Qdelete_window instead of
 +      Fdelete_window (Fbury_buffer will move to window.el soon).
 +
 +      * frame.c (set_menu_bar_lines_1): Remove code handling
 +      orig_top_line and orig_total_lines.
 +
 +      * dispnew.c (adjust_frame_glyphs_initially): Don't use
 +      set_window_height but set heights directly.
 +      (change_frame_size_1): Use resize_frame_windows.
 +
 +      * xdisp.c (init_xdisp): Don't use set_window_height but set
 +      heights directly.
 +
 +      * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines): Use
 +      resize_frame_windows instead of change_window_heights and run
 +      run_window_configuration_change_hook.
 +
 +      * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
 +      instead of change_window_heights and run
 +      run_window_configuration_change_hook.
 +
 +2011-06-09  Martin Rudalics  <rudalics@gmx.at>
 +
 +      * window.c (replace_window): Rename second argument REPLACEMENT to
 +      NEW.  New third argument SETFLAG.  Rewrite.
 +      (delete_window, make_dummy_parent): Call replace_window with
 +      third argument 1.
 +      (window_list_1): Move down in code.
 +      (run_window_configuration_change_hook): Move set_buffer part
 +      before select_frame_norecord part in order to unwind correctly.
 +      Rename count1 to count.
 +      (recombine_windows, delete_deletable_window, resize_root_window)
 +      (Fdelete_other_windows_internal)
 +      (Frun_window_configuration_change_hook, make_parent_window)
 +      (resize_window_check, resize_window_apply, Fresize_window_apply)
 +      (resize_frame_windows, Fsplit_window_internal)
 +      (Fdelete_window_internal, Fresize_mini_window_internal): New
 +      functions.
 +      (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
 +
 +2011-06-08  Martin Rudalics  <rudalics@gmx.at>
 +
 +      * window.h (window): Add some new members to window structure -
 +      normal_lines, normal_cols, new_total, new_normal, clone_number,
 +      splits, nest, prev_buffers, next_buffers.
 +      (WINDOW_TOTAL_SIZE): Move here from window.c.
 +      (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
 +
 +      * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
 +      Remove.
 +      (make_dummy_parent): Set new members of windows structure.
 +      (make_window): Move down in code.  Handle new members of window
 +      structure.
 +      (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
 +      (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
 +      (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
 +      (Fset_window_prev_buffers, Fwindow_next_buffers)
 +      (Fset_window_next_buffers, Fset_window_clone_number): New
 +      functions.
 +      (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
 +      (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
 +      Doc-string fixes.
 +      (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
 +      Argument WINDOW can be now internal window too.
 +      (Fwindow_use_time): Move up in code.
 +      (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
 +      Rewrite doc-string.
 +      (Fset_window_configuration, saved_window)
 +      (Fcurrent_window_configuration, save_window_save): Handle new
 +      members of window structure.
 +      (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
 +      (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
 +      (syms_of_window): New Lisp objects Qrecord_window_buffer,
 +      Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
 +      Qget_mru_window, Qresize_root_window,
 +      Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
 +      Qauto_buffer_name; staticpro them.
 +
 +2011-06-07  Martin Rudalics  <rudalics@gmx.at>
 +
 +      * window.c (Fwindow_total_size, Fwindow_left_column)
 +      (Fwindow_top_line, window_body_lines, Fwindow_body_size)
 +      (Fwindow_list_1): New functions.
 +      (window_box_text_cols): Replace with window_body_cols.
 +      (Fwindow_width, Fscroll_left, Fscroll_right): Use
 +      window_body_cols instead of window_box_text_cols.
 +      (delete_window, Fset_window_configuration): Call
 +      delete_all_subwindows with window as argument.
 +      (delete_all_subwindows): Take a window as argument and not a
 +      structure.  Rewrite.
 +      (window_loop): Remove handling of GET_LRU_WINDOW and
 +      GET_LARGEST_WINDOW.
 +      (Fget_lru_window, Fget_largest_window): Move to window.el.
 +
 +      * window.h: Extern window_body_cols instead of
 +      window_box_text_cols.  delete_all_subwindows now takes a
 +      Lisp_Object as argument.
 +
 +      * indent.c (compute_motion, Fcompute_motion): Use
 +      window_body_cols instead of window_box_text_cols.
 +
 +      * frame.c (delete_frame): Call delete_all_subwindows with root
 +      window as argument.
 +
 +2011-06-07  Daniel Colascione  <dan.colascione@gmail.com>
 +
 +      * fns.c (Fputhash): Document return value.
 +
 +2011-06-06  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * image.c (gif_load): Implement gif89a spec "no disposal" method.
 +
 +2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Cons<->int and similar integer overflow fixes (Bug#8794).
 +
 +      Check for overflow when converting integer to cons and back.
 +      * charset.c (Fdefine_charset_internal, Fdecode_char):
 +      Use cons_to_unsigned to catch overflow.
 +      (Fencode_char): Use INTEGER_TO_CONS.
 +      * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
 +      (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
 +      * data.c (long_to_cons, cons_to_long): Remove.
 +      (cons_to_unsigned, cons_to_signed): New functions.
 +      These signal an error for invalid or out-of-range values.
 +      * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
 +      * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
 +      * font.c (Ffont_variation_glyphs):
 +      * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
 +      * lisp.h: Include <intprops.h>.
 +      (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
 +      (cons_to_signed, cons_to_unsigned): New decls.
 +      (long_to_cons, cons_to_long): Remove decls.
 +      * undo.c (record_first_change): Use INTEGER_TO_CONS.
 +      (Fprimitive_undo): Use CONS_TO_INTEGER.
 +      * xfns.c (Fx_window_property): Likewise.
 +      * xselect.c: Include <limits.h>.
 +      (x_own_selection, selection_data_to_lisp_data):
 +      Use INTEGER_TO_CONS.
 +      (x_handle_selection_request, x_handle_selection_clear)
 +      (x_get_foreign_selection, Fx_disown_selection_internal)
 +      (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
 +      (lisp_data_to_selection_data): Use cons_to_unsigned.
 +      (x_fill_property_data): Use cons_to_signed.
 +      Report values out of range.
 +
 +      Check for buffer and string overflow more precisely.
 +      * buffer.h (BUF_BYTES_MAX): New macro.
 +      * lisp.h (STRING_BYTES_MAX): New macro.
 +      * alloc.c (Fmake_string):
 +      * character.c (string_escape_byte8):
 +      * coding.c (coding_alloc_by_realloc):
 +      * doprnt.c (doprnt):
 +      * editfns.c (Fformat):
 +      * eval.c (verror):
 +      Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
 +      since they may not be the same number.
 +      * editfns.c (Finsert_char):
 +      * fileio.c (Finsert_file_contents):
 +      Likewise for BUF_BYTES_MAX.
 +
 +      * image.c: Use ptrdiff_t, not int, for sizes.
 +      (slurp_file): Switch from int to ptrdiff_t.
 +      All uses changed.
 +      (slurp_file): Check that file size fits in both size_t (for
 +      malloc) and ptrdiff_t (for sanity and safety).
  
 -      * xdisp.c (tool_bar_lines_needed, redisplay_tool_bar)
 -      (display_menu_bar): Force left-to-right direction.  Add a FIXME
 -      comment for making that be controlled by a user option.
 +      * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
 +      if b->modtime has its maximal value.
  
 -      * bidi.c (bidi_move_to_visually_next): GCPRO the Lisp string we
 -      are iterating.
 +      * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
  
 -      * term.c (produce_glyphs): Add IT_GLYPHLESS to the values of
 -      it->what accepted by the xassert.  Fixes a gratuitous crash in an
 -      Emacs built with -DXASSERTS.
 +      Don't assume time_t can fit into int.
 +      * buffer.h (struct buffer.modtime): Now time_t, not int.
 +      * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
 +      * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
  
 -      * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
 -      (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
 -      and vector-like objects.
 +      Minor fixes for signed vs unsigned integers.
 +      * character.h (MAYBE_UNIFY_CHAR):
 +      * charset.c (maybe_unify_char):
 +      * keyboard.c (read_char, reorder_modifiers):
 +      XINT -> XFASTINT, since the integer must be nonnegative.
 +      * ftfont.c (ftfont_spec_pattern):
 +      * keymap.c (access_keymap, silly_event_symbol_error):
 +      XUINT -> XFASTINT, since the integer must be nonnegative.
 +      (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
 +      since it makes no difference and we prefer signed.
 +      * keyboard.c (record_char): Use XUINT when all the neighbors do.
 +      (access_keymap): NATNUMP -> INTEGERP, since the integer must be
 +      nonnegative.
  
 -      * xdisp.c (face_before_or_after_it_pos): Support bidi iteration.
 -      (next_element_from_c_string): Handle the case of the first string
 -      character that is not the first one in the visual order.
 -      (get_visually_first_element): New function, refactored from common
 -      parts of next_element_from_buffer, next_element_from_string, and
 -      next_element_from_c_string.
 +2011-06-06  Stefan Monnier  <monnier@iro.umontreal.ca>
  
 -2011-06-16  Eli Zaretskii  <eliz@gnu.org>
 +      * window.h (Fwindow_frame): Declare.
  
 -      * xdisp.c (init_iterator): Don't initialize it->bidi_p for strings
 -      here.
 -      (reseat_to_string): Initialize it->bidi_p for strings here.
 -      (next_element_from_string, next_element_from_c_string)
 -      (next_element_from_buffer): Add xassert's for correspondence
 -      between IT's object being iterated and it->bidi_it.string
 -      structure.
 +2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
  
 -      * bidi.c (bidi_level_of_next_char): Fix the logic for looking up
 -      the sentinel state in the cache.
 +      * alloc.c: Simplify handling of large-request failures (Bug#8800).
 +      (SPARE_MEMORY): Always define.
 +      (LARGE_REQUEST): Remove.
 +      (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
  
 -2011-06-13  Eli Zaretskii  <eliz@gnu.org>
 +2011-06-06  Martin Rudalics  <rudalics@gmx.at>
  
 -      * xdisp.c (compute_display_string_pos)
 -      (compute_display_string_end, reseat_to_string): Don't assume
 -      it->bidi_it.string.s always points to string.lstring's data.
 +      * lisp.h: Move EXFUNS for Fframe_root_window,
 +      Fframe_first_window and Fset_frame_selected_window to window.h.
  
 -      * bidi.c (bidi_fetch_char, bidi_paragraph_init)
 -      (bidi_resolve_explicit_1, bidi_resolve_explicit)
 -      (bidi_resolve_weak, bidi_level_of_next_char): Don't assume
 -      string.s always points to string.lstring's data.
 +      * window.h: Move EXFUNS for Fframe_root_window,
 +      Fframe_first_window and Fset_frame_selected_window here from
 +      lisp.h.
  
 -2011-06-11  Eli Zaretskii  <eliz@gnu.org>
 +      * frame.c (Fwindow_frame, Fframe_first_window)
 +      (Fframe_root_window, Fframe_selected_window)
 +      (Fset_frame_selected_window): Move to window.c.
 +      (Factive_minibuffer_window): Move to minibuf.c.
 +      (Fother_visible_frames_p): New function.
  
 -      * xdisp.c (set_iterator_to_next): Advance string position
 -      correctly when padding it with blanks.
 +      * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
  
 -2011-06-11  Eli Zaretskii  <eliz@gnu.org>
 +      * window.c (decode_window, decode_any_window): Move up in code.
 +      (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
 +      (inhibit_frame_unsplittable): Remove unused variable.
 +      (Fwindow_buffer): Move up and rewrite doc-string.
 +      (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
 +      (Fwindow_prev): New functions.
 +      (Fwindow_frame): Move here from frame.c.  Accept any window as
 +      argument.
 +      (Fframe_root_window, Fframe_first_window)
 +      (Fframe_selected_window): Move here from frame.c.  Accept frame
 +      or arbitrary window as argument.  Update doc-strings.
 +      (Fminibuffer_window): Move up in code.
 +      (Fwindow_minibuffer_p): Move up in code and simplify.
 +      (Fset_frame_selected_window): Move here from frame.c.
 +      Marginal rewrite.
 +      (Fselected_window, select_window, Fselect_window): Move up in
 +      code.  Minor doc-string fixes.
  
 -      * xdisp.c (next_element_from_buffer): Improve commentary for when
 -      the iterator is before prev_stop.
 -      (init_iterator): Initialize bidi_p from the default value of
 -      bidi-display-reordering, not from buffer-local value.  Use the
 -      buffer-local value only if initializing for buffer iteration.
 -      (handle_invisible_prop): Support invisible properties on strings
 -      that are being bidi-reordered.
 -      (reseat_to_string): Enable bidi-related code.
 -      (set_iterator_to_next): Support bidi reordering of C strings and
 -      Lisp strings.
 -      (next_element_from_string): Support bidi reordering of Lisp
 -      strings.
 -      (handle_stop_backwards): Support Lisp strings as well.
 -      (display_mode_line, display_mode_element): Temporarily force L2R
 -      paragraph direction.
 -      (display_string): Support display of R2L glyph rows.  Use
 -      IT_STRING_CHARPOS when displaying from a Lisp string.
 +2011-06-06  Paul Eggert  <eggert@cs.ucla.edu>
  
 -2011-06-10  Eli Zaretskii  <eliz@gnu.org>
 +      * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
 +      Do not assume that spare memory exists; that assumption is valid
 +      only if SYSTEM_MALLOC.
 +      (LARGE_REQUEST): New macro, so that the issue of large requests
 +      is separated from the issue of spare memory.
  
 -      * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
 -      itb.string.lstring.
 -      (compute_display_string_pos, compute_display_string_end):
 -      Fix calculation of the object to scan.  Fixes an error when using
 -      arrow keys.
 -      (next_element_from_buffer): Don't abort when IT_CHARPOS is before
 -      base_level_stop; instead, set base_level_stop to BEGV.  Fixes
 -      crashes in vertical-motion.
 +2011-06-05  Andreas Schwab  <schwab@linux-m68k.org>
  
 -2011-06-09  Eli Zaretskii  <eliz@gnu.org>
 +      * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
 +      format.  (Bug#8806)
  
 -      * xdisp.c (compute_display_string_pos): First arg is now struct
 -      `text_pos *'; all callers changed.  Support display properties on
 -      Lisp strings.
 -      (compute_display_string_end): Support display properties on Lisp
 -      strings.
 -      (init_iterator, reseat_1, reseat_to_string): Initialize the
 -      string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
 -      when iterating on a string not from display properties).
 +      * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
  
 -      * bidi.c (bidi_fetch_char): Support strings with display
 -      properties.
 +      * xfns.c (x_set_scroll_bar_default_width): Move declarations
 +      before statements.
  
 -      * dispextern.h (struct bidi_string_data): New member bufpos.
 -      (compute_display_string_pos): Update prototype.
 +2011-06-05  Jan Djärv  <jan.h.d@swipnet.se>
  
 -2011-06-09  Eli Zaretskii  <eliz@gnu.org>
 +      * gtkutil.c (xg_get_default_scrollbar_width): New function.
  
 -      * bidi.c (bidi_level_of_next_char): Allow the sentinel "position"
 -      to pass the test for valid cached positions.
 +      * gtkutil.h: Declare xg_get_default_scrollbar_width.
  
 -      * xdisp.c (init_iterator): Call bidi_init_it only of a valid
 -      buffer position was specified.  Initialize paragraph_embedding to
 -      L2R.
 -      (reseat_to_string): Initialize the bidi iterator (for now ifdef'ed
 -      out).
 -      (display_string): If we need to ignore text properties of
 -      LISP_STRING, set IT->stop_charpos to IT->end_charpos.  (The
 -      original value of -1 will not work with bidi.)
 +      * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
 +      min width by calling x_set_scroll_bar_default_width (Bug#8505).
  
 -      * dispextern.h (struct bidi_string_data): New member lstring.
 +2011-06-05  Juanma Barranquero  <lekktu@gmail.com>
  
 -2011-06-09  Eli Zaretskii  <eliz@gnu.org>
 +      * xdisp.c (single_display_spec_intangible_p): Remove declaration.
  
 -      * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
 -      itb.string.s to NULL (avoids a crash in bidi_paragraph_init).
 +2011-06-04  Chong Yidong  <cyd@stupidchicken.com>
  
 -2011-06-08  Eli Zaretskii  <eliz@gnu.org>
 +      * xselect.c (x_clipboard_manager_save): Remove redundant arg.
 +      (x_clipboard_manager_save): Add return value.
 +      (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
 +      New error handlers.
 +      (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
 +      Obey Vx_select_enable_clipboard_manager.  Catch errors in
 +      x_clipboard_manager_save (Bug#8779).
 +      (Vx_select_enable_clipboard_manager): New variable.
 +      (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
  
 -      * bidi.c (bidi_paragraph_info): Delete unused struct.
 -      (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
 -      (bidi_cache_start): New variable.
 -      (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
 -      to zero.
 -      (bidi_cache_fetch_state, bidi_cache_search)
 -      (bidi_cache_find_level_change, bidi_cache_iterator_state)
 -      (bidi_cache_find, bidi_peek_at_next_level)
 -      (bidi_level_of_next_char, bidi_find_other_level_edge)
 -      (bidi_move_to_visually_next): Compare cache index with
 -      bidi_cache_start rather than with zero.
 -      (bidi_fetch_char): Accept new argument STRING; all callers
 -      changed.  Support iteration over a string.
 -      (bidi_paragraph_init, bidi_resolve_explicit_1)
 -      (bidi_resolve_explicit, bidi_resolve_weak)
 -      (bidi_level_of_next_char, bidi_move_to_visually_next): Support
 -      iteration over a string.
 -      (bidi_set_sor_type, bidi_resolve_explicit_1)
 -      (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
 -      can now be zero (for strings); special values 0 and -1 were
 -      changed to -1 and -2, respectively.
 -      (bidi_char_at_pos): New function.
 -      (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
 -      Call it instead of FETCH_MULTIBYTE_CHAR.
 -      (bidi_move_to_visually_next): Abort if charpos or bytepos were not
 -      initialized to valid values.
 -      (bidi_init_it): Don't initialize charpos and bytepos with invalid
 -      values.
 +2011-06-04  Dan Nicolaescu  <dann@ics.uci.edu>
  
 -      * xdisp.c (compute_display_string_pos)
 -      (compute_display_string_end): Accept additional argument STRING.
 -      (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
 -      (reseat_to_string): Initialize bidi_it->string.s and
 -      bidi_it->string.schars.
 +      * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
  
 -      * dispextern.h (struct bidi_string_data): New structure.
 -      (struct bidi_it): New member `string'.  Make flag members be 1-bit
 -      fields, and put them last in the struct.
 -      (compute_display_string_pos, compute_display_string_end): Update
 -      prototypes.
 +2011-06-04  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 +
 +      * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
 +      in the current matrix if keep_current_p is non-zero.
  
  2011-06-04  Eli Zaretskii  <eliz@gnu.org>
  
 -      * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
 +      * bidi.c (bidi_level_of_next_char): Fix last change.
  
  2011-06-03  Eli Zaretskii  <eliz@gnu.org>
  
 -      * bidi.c (bidi_fetch_char_advance): Remove unused and
 -      unimplemented function.
 +      Support bidi reordering of text covered by display properties.
  
 -2011-05-28  Eli Zaretskii  <eliz@gnu.org>
 +      * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
 +      (bidi_fetch_char, bidi_fetch_char_advance): New functions.
 +      (bidi_cache_search, bidi_cache_iterator_state)
 +      (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
 +      (bidi_level_of_next_char, bidi_move_to_visually_next):
 +      Support character positions inside a run of characters covered by a
 +      display string.
 +      (bidi_paragraph_init, bidi_resolve_explicit_1)
 +      (bidi_level_of_next_char): Call bidi_fetch_char and
 +      bidi_fetch_char_advance instead of FETCH_CHAR and
 +      FETCH_CHAR_ADVANCE.
 +      (bidi_init_it): Initialize new members.
 +      (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
 +      definitions.
 +      (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
 +      instead of using explicit *_CHAR codes.
 +      (bidi_resolve_explicit, bidi_resolve_weak):
 +      Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
 +      bidirectional text is supported only in multibyte buffers.
 +      (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
 +      it to initialize the frame_window_p member of struct bidi_it.
 +      (bidi_cache_iterator_state, bidi_resolve_explicit_1)
 +      (bidi_resolve_explicit, bidi_resolve_weak)
 +      (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
 +      bidi_it->nchars is non-positive.
 +      (bidi_level_of_next_char): Don't try to lookup the cache for the
 +      next/previous character if nothing is cached there yet, or if we
 +      were just reseat()'ed to a new position.
  
        * xdisp.c (set_cursor_from_row): Set start and stop points
        according to the row's direction when priming the loop that looks
        (single_display_spec_intangible_p): Function deleted.
        (display_prop_intangible_p): Reimplement to call
        handle_display_spec instead of single_display_spec_intangible_p.
 -      Accept 3 additional arguments needed by handle_display_spec.  This
 -      fixes incorrect cursor motion across display property with complex
 +      Accept 3 additional arguments needed by handle_display_spec.
 +      This fixes incorrect cursor motion across display property with complex
        values: lists, `(when COND...)' forms, etc.
        (single_display_spec_string_p): Support property values that are
        lists with the argument STRING its top-level element.
        (display_prop_string_p): Fix the condition for processing a
        property that is a list to be consistent with handle_display_spec.
 -
 -      * keyboard.c (adjust_point_for_property): Adjust the call to
 -      display_prop_intangible_p to its new signature.
 -
 -      * dispextern.h (display_prop_intangible_p): Adjust prototype.
 -
 -2011-05-21  Eli Zaretskii  <eliz@gnu.org>
 -
 -      * xdisp.c (handle_display_spec): New function, refactored from the
 +      (handle_display_spec): New function, refactored from the
        last portion of handle_display_prop.
        (compute_display_string_pos): Accept additional argument
        FRAME_WINDOW_P.  Call handle_display_spec to determine whether the
        the display property will replace the characters it covers.
        (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
        frame_window_p members of struct bidi_it.
 +      (compute_display_string_pos, compute_display_string_end):
 +      New functions.
 +      (push_it): Accept second argument POSITION, where pop_it should
 +      jump to continue iteration.
 +      (reseat_1): Initialize bidi_it.disp_pos.
  
 -      * bidi.c (bidi_fetch_char): Accept additional argument
 -      FRAME_WINDOW_P and pass it to compute_display_string_pos.  All
 -      callers changed.
 -      (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
 -      it to initialize the frame_window_p member of struct bidi_it.
 +      * keyboard.c (adjust_point_for_property): Adjust the call to
 +      display_prop_intangible_p to its new signature.
  
        * dispextern.h (struct bidi_it): New member frame_window_p.
 -      (bidi_init_it, compute_display_string_pos): Update prototypes.
 +      (bidi_init_it): Update prototypes.
 +      (display_prop_intangible_p): Update prototype.
 +      (compute_display_string_pos, compute_display_string_end):
 +      Declare prototypes.
 +      (struct bidi_it): New members nchars and disp_pos.  ch_len is now
 +      EMACS_INT.
  
 -2011-05-14  Eli Zaretskii  <eliz@gnu.org>
 +2011-06-02  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Malloc failure behavior now depends on size of allocation.
 +      * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
 +      * lisp.h: Change signatures accordingly.
 +      * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
 +      All callers changed.  (Bug#8762)
 +
 +      * gnutls.c: Use Emacs's memory allocators.
 +      Without this change, the gnutls library would invoke malloc etc.
 +      directly, which causes problems on non-SYNC_INPUT hosts, and which
 +      runs afoul of improving memory_full behavior.  (Bug#8761)
 +      (fn_gnutls_global_set_mem_functions): New macro or function pointer.
 +      (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
 +      xfree instead of the default malloc, realloc, free.
 +      (Fgnutls_boot): No need to check for memory allocation failure,
 +      since xmalloc does that for us.
 +
 +      Remove arbitrary limit of 2**31 entries in hash tables.  (Bug#8771)
 +      * category.c (hash_get_category_set):
 +      * ccl.c (ccl_driver):
 +      * charset.c (Fdefine_charset_internal):
 +      * charset.h (struct charset.hash_index):
 +      * composite.c (get_composition_id, gstring_lookup_cache)
 +      (composition_gstring_put_cache):
 +      * composite.h (struct composition.hash_index):
 +      * dispextern.h (struct image.hash):
 +      * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
 +      (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
 +      (hashfn_equal, hashfn_user_defined, make_hash_table)
 +      (maybe_resize_hash_table, hash_lookup, hash_put)
 +      (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
 +      (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
 +      (Fsxhash, Fgethash, Fputhash, Fmaphash):
 +      * image.c (make_image, search_image_cache, lookup_image)
 +      (xpm_put_color_table_h):
 +      * lisp.h (struct Lisp_Hash_Table):
 +      * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
 +      * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
 +      for hashes and hash indexes, instead of 'unsigned' and 'int'.
 +      * alloc.c (allocate_vectorlike):
 +      Check for overflow in vector size calculations.
 +      * ccl.c (ccl_driver):
 +      Check for overflow when converting EMACS_INT to int.
 +      * fns.c, image.c: Remove unnecessary static decls that would otherwise
 +      need to be updated by these changes.
 +      * fns.c (make_hash_table, maybe_resize_hash_table):
 +      Check for integer overflow with large hash tables.
 +      (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
 +      Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
 +      (SXHASH_REDUCE): New macro.
 +      (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
 +      Use it instead of discarding useful hash info with large hash values.
 +      (sxhash_float): New function.
 +      (sxhash): Use it.  No more need for "& INTMASK" due to above changes.
 +      * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
 +      (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
 +      Rewrite to use FIXNUM_BITS, as this simplifies things.
 +      (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
 +      Adjust signatures to match updated version of code.
 +      (consing_since_gc): Now EMACS_INT, since a single hash table can
 +      use more than INT_MAX bytes.
 +
 +2011-06-01  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Make it possible to build with GCC-4.6+ -O2 -flto.
 +
 +      * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
 +
 +2011-06-01  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * minibuf.c (get_minibuffer, read_minibuf_unwind):
 +      Call minibuffer-inactive-mode.
 +
 +2011-05-31  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
 +      Update dependencies.
  
 -      * xdisp.c (compute_display_string_pos): Non-trivial implementation.
 -      (compute_display_string_end): New function.
 -      (push_it): Accept second argument POSITION, where pop_it should
 -      jump to continue iteration.
 +2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
  
 -      * dispextern.h (compute_display_string_end): Declare prototype.
 +      * data.c (init_data): Remove code for UTS, this system is not
 +      supported anymore.
  
 -      * bidi.c (bidi_resolve_explicit_1): Use ZV for disp_pos.
 -      (bidi_fetch_char): Implement support for runs of characters
 -      covered by display strings.
 +2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
  
 -      * bidi.c (bidi_fetch_char): Accept also character position
 -      corresponding to BYTEPOS.  DISP_POS is now a character position,
 -      not a byte position.  All callers changed.
 -      (bidi_cache_iterator_state, bidi_resolve_explicit_1)
 -      (bidi_resolve_explicit, bidi_resolve_weak)
 -      (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
 -      bidi_it->nchars is non-positive.
 -      (bidi_level_of_next_char): Don't try to lookup the cache for the
 -      next/previous character if nothing is cached there yet, or if we
 -      were just reseat()'ed to a new position.
 -      (bidi_paragraph_init, bidi_resolve_explicit_1)
 -      (bidi_level_of_next_char): Fix arguments in the calls to
 -      bidi_fetch_char.
 +      Don't force ./temacs to start in terminal mode.
  
 -2011-05-10  Eli Zaretskii  <eliz@gnu.org>
 +      * frame.c (make_initial_frame): Initialize faces in all cases, not
 +      only when CANNOT_DUMP is defined.
 +      * dispnew.c (init_display): Remove CANNOT_DUMP condition.
  
 -      * xdisp.c (compute_display_string_pos): New function.
 -      (reseat_1): Initialize bidi_it.disp_pos.
 +2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
  
 -      * bidi.c (bidi_copy_it): Use offsetof.
 -      (bidi_fetch_char, bidi_fetch_char_advance): New functions.
 -      (bidi_cache_search, bidi_cache_iterator_state)
 -      (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
 -      (bidi_level_of_next_char, bidi_move_to_visually_next): Support
 -      character positions inside a run of characters covered by a
 -      display string.
 -      (bidi_paragraph_init, bidi_resolve_explicit_1)
 -      (bidi_level_of_next_char): Call bidi_fetch_char and
 -      bidi_fetch_char_advance instead of FETCH_CHAR and
 -      FETCH_CHAR_ADVANCE.
 -      (bidi_init_it): Initialize new members.
 -      (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
 -      definitions.
 -      (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
 -      instead of using explicit *_CHAR codes.
 -      (bidi_resolve_explicit, bidi_resolve_weak): Use
 -      FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
 -      bidirectional text is supported only in multibyte buffers.
 +      * dispnew.c (add_window_display_history): Use const for the string
 +      pointer.  Remove declaration, not needed.
 +
 +2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Use 'inline', not 'INLINE'.
 +      <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
 +      * alloc.c, fontset.c (INLINE): Remove.
 +      * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
 +      * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
 +      * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
 +      * gmalloc.c (register_heapinfo): Use inline unconditionally.
 +      * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
 +
 +2011-05-31  Dan Nicolaescu  <dann@ics.uci.edu>
 +
 +      Make it possible to run ./temacs.
 +
 +      * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
 +      syms_of_callproc does the same thing.  Remove test for
 +      "initialized", do it in the caller.
 +      * emacs.c (main): Avoid calling set_initial_environment when dumping.
 +
 +2011-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
 +      (read_minibuf): Use get_minibuffer.
 +      (syms_of_minibuf): Use DEFSYM.
 +      (Qmetadata): New var.
 +      * data.c (Qbuffer): Don't make it static.
 +      (syms_of_data): Use DEFSYM.
  
 -      * dispextern.h (struct bidi_it): New members nchars and disp_pos.
 -      ch_len is now EMACS_INT.
 -      (compute_display_string_pos): Declare prototype.
 +2011-05-31  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * ccl.c (CCL_CODE_RANGE): Allow negative numbers.  (Bug#8751)
 +      (CCL_CODE_MIN): New macro.
 +
 +2011-05-30  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
 +
 +      * eval.c (Qdebug): Now static.
 +      * lisp.h (Qdebug): Remove decl.  This reverts a part of the
 +      2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
 +      2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
 +
 +2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * image.c: Various fixes to ImageMagick code comments.
 +      (Fimagemagick_types): Doc fix.
 +
 +2011-05-29  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Minor fixes prompted by GCC 4.6.0 warnings.
 +
 +      * xselect.c (converted_selections, conversion_fail_tag): Now static.
 +
 +      * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
 +      (x_clipboard_manager_save_all): Move extern decl to ...
 +      * xterm.h: ... here, so that it can be checked for consistency.
 +
 +2011-05-29  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xselect.c (x_clipboard_manager_save_frame)
 +      (x_clipboard_manager_save_all): New functions.
 +      (Fx_clipboard_manager_save): Lisp function deleted.
 +
 +      * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
 +      * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
 +
 +      * xterm.h: Update prototype.
 +
 +2011-05-28  William Xu  <william.xwl@gmail.com>
 +
 +      * nsterm.m (ns_term_shutdown): Synchronize user defaults before
 +      exiting (Bug#8239).
 +
 +2011-05-28  Jim Meyering  <meyering@redhat.com>
 +
 +      Avoid a sign-extension bug in crypto_hash_function.
 +      * fns.c (to_uchar): Define.
 +      (crypto_hash_function): Use it to convert some newly-signed
 +      variables to unsigned, to avoid sign-extension bugs.  For example,
 +      without this change, (md5 "truc") would evaluate to
 +      45723a2aff78ff4fff7fff1114760e62 rather than the expected
 +      45723a2af3788c4ff17f8d1114760e62.  Reported by Antoine Levitt in
 +      https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
 +
 +2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Integer overflow fixes.
 +
 +      * dbusbind.c: Serial number integer overflow fixes.
 +      (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
 +      (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
 +      to hold a serial number that is too large for a fixnum.
 +      (Fdbus_method_return_internal, Fdbus_method_error_internal):
 +      Check for serial numbers out of range.  Decode any serial number
 +      that was so large that it became a float.  (Bug#8722)
 +
 +      * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
 +      (Fdbus_call_method, Fdbus_call_method_asynchronously):
 +      Use XFASTINT rather than XUINT when numbers are nonnegative.
 +      (xd_append_arg, Fdbus_method_return_internal):
 +      (Fdbus_method_error_internal): Likewise.  Also, for unsigned
 +      arguments, check that Lisp number is nonnegative, rather than
 +      silently wrapping negative numbers around.  (Bug#8722)
 +      (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
 +      (Bug#8722)
 +
 +      * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
 +
 +      * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
 +
 +      ccl: add integer overflow checks
 +      * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
 +      (IN_INT_RANGE): New macros.
 +      (ccl_driver): Use them to check for integer overflow when
 +      decoding a CCL program.  Many of the new checks are whether XINT (x)
 +      fits in int; it doesn't always, on 64-bit hosts.  The new version
 +      doesn't catch all possible integer overflows, but it's an
 +      improvement.  (Bug#8719)
 +
 +      * alloc.c (make_event_array): Use XINT, not XUINT.
 +      There's no need for unsigned here.
 +
 +      * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
 +      This follows up to the 2011-05-06 change that substituted uintptr_t
 +      for EMACS_INT.  This case wasn't caught back then.
 +
 +      Rework Fformat to avoid integer overflow issues.
 +      * editfns.c: Include <float.h> unconditionally, as it's everywhere
 +      now (part of C89).  Include <verify.h>.
 +      (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
 +      (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
 +      (Fformat): Avoid the prepass trying to compute sizes; it was only
 +      approximate and thus did not catch overflow reliably.  Instead, walk
 +      through the format just once, formatting and computing sizes as we go,
 +      checking for integer overflow at every step, and allocating a larger
 +      buffer as needed.  Keep track separately whether the format is
 +      multibyte.  Keep only the most-recently calculated precision, rather
 +      than them all.  Record whether each argument has been converted to
 +      string.  Use EMACS_INT, not int, for byte and char and arg counts.
 +      Support field widths and precisions larger than INT_MAX.  Avoid
 +      sprintf's undefined behavior with conversion specifications such as %#d
 +      and %.0c.  Fix bug with strchr succeeding on '\0' when looking for
 +      flags.  Fix bug with (format "%c" 256.0).  Avoid integer overflow when
 +      formatting out-of-range floating point numbers with int
 +      formats.  (Bug#8668)
 +
 +      * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
 +
 +      * data.c: Avoid integer truncation in expressions involving floats.
 +      * data.c: Include <intprops.h>.
 +      (arith_driver): When there's an integer overflow in an expression
 +      involving floating point, convert the integers to floating point
 +      so that the resulting value does not suffer from catastrophic
 +      integer truncation.  For example, on a 64-bit host (* 4
 +      most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
 +      Do not rely on undefined behavior after integer overflow.
 +
 +      merge count_size_as_multibyte, parse_str_to_multibyte
 +      * character.c, character.h (count_size_as_multibyte):
 +      Rename from parse_str_to_multibyte; all uses changed.
 +      Check for integer overflow.
 +      * insdel.c, lisp.h (count_size_as_multibyte): Remove,
 +      since it's now a duplicate of the other.  This is more of
 +      a character than a buffer op, so better that it's in character.c.
 +      * fns.c, print.c: Adjust to above changes.
 +
 +2011-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
 +
 +      * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
 +
 +2011-05-27  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
 +      (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
 +      (x_clipboard_manager_save): Now static.
 +      (Fx_clipboard_manager_save): Rename local to avoid shadowing.
 +
 +      * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
 +      (crypto_hash_function): Now static.
 +      Fix pointer signedness problems.  Avoid unnecessary initializations.
 +
 +2011-05-27  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * termhooks.h (Vselection_alist): Make it terminal-local.
 +
 +      * terminal.c (create_terminal): Initialize it.
 +
 +      * xselect.c: Support for clipboard managers.
 +      (Vselection_alist): Move to termhooks.h as terminal-local var.
 +      (LOCAL_SELECTION): New macro.
 +      (x_atom_to_symbol): Handle x_display_info_for_display fail case.
 +      (symbol_to_x_atom): Remove gratuitous arg.
 +      (x_handle_selection_request, lisp_data_to_selection_data)
 +      (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
 +      (x_own_selection, x_get_local_selection, x_convert_selection):
 +      New arg, specifying work frame.  Use terminal-local Vselection_alist.
 +      (some_frame_on_display): Delete unused function.
 +      (Fx_own_selection_internal, Fx_get_selection_internal)
 +      (Fx_disown_selection_internal, Fx_selection_owner_p)
 +      (Fx_selection_exists_p): New optional frame arg.
 +      (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
 +      (x_handle_selection_clear): Don't treat other terminals with the
 +      same keyboard specially.  Use the terminal-local Vselection_alist.
 +      (x_clear_frame_selections): Use Frun_hook_with_args.
 +
 +      * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
 +
 +      * xterm.h: Add support for those atoms.
 +
 +2011-05-26  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
 +      (converted_selections, conversion_fail_tag): New global variables.
 +      (x_selection_request_lisp_error): Free the above.
 +      (x_get_local_selection): Remove unnecessary code.
 +      (x_reply_selection_request): Args changed; handle arbitrary array
 +      of converted selections stored in converted_selections.
 +      Separate the XChangeProperty and SelectionNotify steps.
 +      (x_handle_selection_request): Rewrite to handle MULTIPLE target.
 +      (x_convert_selection): New function.
 +      (x_handle_selection_event): Simplify.
 +      (x_get_foreign_selection): Don't ignore incoming requests while
 +      waiting for an answer; this will fail when we implement
 +      SAVE_TARGETS, and seems unnecessary anyway.
 +      (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
 +      (Vx_sent_selection_functions): Doc fix.
 +
 +2011-05-26  Leo Liu  <sdl.web@gmail.com>
 +
 +      * editfns.c (Ftranspose_regions): Allow empty regions.  (Bug#8699)
 +
 +2011-05-25  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 +
 +      * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
 +
 +      * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
 +      for fringe update if it has periodic bitmap.
 +      (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
 +      and fringe_bitmap_periodic_p.
 +
 +      * fringe.c (get_fringe_bitmap_data): New function.
 +      (draw_fringe_bitmap_1, update_window_fringes): Use it.
 +      (update_window_fringes): Record periodicity of fringe bitmap in glyph
 +      row.  Mark glyph row for fringe update if periodicity changed.
 +
 +      * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
 +      for fringe update unless it has periodic bitmap.
 +
 +2011-05-25  Kenichi Handa  <handa@m17n.org>
 +
 +      * xdisp.c (get_next_display_element): Set correct it->face_id for
 +      a static composition.
 +
 +2011-05-24  Leo Liu  <sdl.web@gmail.com>
 +
 +      * deps.mk (fns.o):
 +      * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
 +
 +      * fns.c (crypto_hash_function, Fsha1): New function.
 +      (Fmd5): Use crypto_hash_function.
 +      (syms_of_fns): Add Ssha1.
 +
 +2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * gnutls.c: Remove unused macros.
 +      (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
 +      (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
 +      Remove macros that are defined and never used.
 +      Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
 +
 +2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
 +      (Fx_get_selection_internal): Minor cleanup.
 +      (Fx_own_selection_internal): Rename arguments for consistency with
 +      select.el.
 +
 +2011-05-22  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
 +
 +2011-05-22  Chong Yidong  <cyd@stupidchicken.com>
 +
 +      * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
 +
 +2011-05-21  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 +
 +      * dispnew.c (scrolling_window): Don't exclude the case that the
 +      last enabled row in the desired matrix touches the bottom boundary.
 +
 +2011-05-21  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in ($(etc)/DOC): Make second command line even shorter.
 +      (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
 +      and add some more files.
 +
 +2011-05-20  Eli Zaretskii  <eliz@gnu.org>
 +
 +      * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
 +      report_file_error introduced by the change from 2011-05-07.
 +
 +2011-05-20  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      * systime.h (Time): Define only if emacs is defined.
 +      This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
 +      where the include path doesn't have X11/X.h by default.  See
 +      <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
 +
 +2011-05-20 Kenichi Handa  <handa@m17n.org>
 +
 +      * composite.c (find_automatic_composition): Fix previous change.
 +
 +2011-05-20  Glenn Morris  <rgm@gnu.org>
 +
 +      * lisp.mk: New file, split from Makefile.in.
 +      * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
 +      (shortlisp): Remove.
 +      ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
 +
 +2011-05-19  Glenn Morris  <rgm@gnu.org>
 +
 +      * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
 +      (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
 +      (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
 +      (lisp): Set the order to that of loadup.el.
 +      (shortlisp): Make it a copy of $lisp.
 +      (SOME_MACHINE_LISP): Remove.
 +      ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
 +      Use just $shortlisp, not $SOME_MACHINE_LISP too.
 +
 +2011-05-18  Kenichi Handa  <handa@m17n.org>
 +
 +      * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
 +      (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
 +      (find_automatic_composition): Mostly rewrite for efficiency.
 +
 +2011-05-18  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * makefile.w32-in: Update dependencies.
 +
 +2011-05-18  Christoph Scholtes  <cschol2112@googlemail.com>
 +
 +      * menu.c: Include limits.h (fixes the MS-Windows build broken by
 +      2011-06-18T18:49:19Z!cyd@stupidchicken.com).
 +
 +2011-05-18  Paul Eggert  <eggert@cs.ucla.edu>
 +
 +      Fix some integer overflow issues, such as string length overflow.
 +
 +      * insdel.c (count_size_as_multibyte): Check for string overflow.
 +
 +      * character.c (lisp_string_width): Check for string overflow.
 +      Use EMACS_INT, not int, for string indexes and lengths; in
 +      particular, 2nd arg is now EMACS_INT, not int.  Do not crash if
 +      the resulting string length overflows an EMACS_INT; instead,
 +      report a string overflow if no precision given.  When checking for
 +      precision exhaustion, use a check that cannot possibly have
 +      integer overflow.  (Bug#8675)
 +      * character.h (lisp_string_width): Adjust to new signature.
 +
 +      * alloc.c (string_overflow): New function.
 +      (Fmake_string): Use it.  This doesn't change behavior, but saves
 +      a few bytes and will simplify future changes.
 +      * character.c (string_escape_byte8): Likewise.
 +      * lisp.h (string_overflow): New decl.
 +
 +      Fixups, following up to the user-interface timestamp change.
 +      * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
 +      for UI timestamps, instead of unsigned long.
 +      * msdos.c (mouse_get_pos): Likewise.
 +      * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
 +      * w32gui.h (Time): Define by including "systime.h" rather than by
 +      declaring it ourselves.  (Bug#8664)
 +
 +      * dispextern.h (struct image): Don't assume time_t <= unsigned long.
 +      * image.c (clear_image_cache): Likewise.
 +
 +      * term.c (term_mouse_position): Don't assume time_t wraparound.
 +
 +      Be more systematic about user-interface timestamps.
 +      Before, the code sometimes used 'Time', sometimes 'unsigned long',
 +      and sometimes 'EMACS_UINT', to represent these timestamps.
 +      This change causes it to use 'Time' uniformly, as that's what X uses.
 +      This makes the code easier to follow, and makes it easier to catch
 +      integer overflow bugs such as Bug#8664.
 +      * frame.c (Fmouse_position, Fmouse_pixel_position):
 +      Use Time, not unsigned long, for user-interface timestamps.
 +      * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
 +      (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
 +      * keyboard.h (last_event_timestamp): Likewise.
 +      * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
 +      * menu.h (xmenu_show): Likewise.
 +      * term.c (term_mouse_position): Likewise.
 +      * termhooks.h (struct input_event.timestamp): Likewise.
 +      (struct terminal.mouse_position_hook): Likewise.
 +      * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
 +      * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
 +      * systime.h (Time): New decl.  Pull it in from <X11/X.h> if
 +      HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
 +      what it was before.
 +      * menu.h, termhooks.h: Include "systime.h", for Time.
 +
 +      * keyboard.c (make_lispy_event): Fix problem in integer overflow.
 +      Don't assume that the difference between two unsigned long values
 +      can fit into an integer.  At this point, we know button_down_time
 +      <= event->timestamp, so the difference must be nonnegative, so
 +      there's no need to cast the result if double-click-time is
 +      nonnegative, as it should be; check that it's nonnegative, just in
 +      case.  This bug is triggered when events are more than 2**31 ms
 +      apart (about 25 days).  (Bug#8664)
 +
 +      * xselect.c (last_event_timestamp): Remove duplicate decl.
 +      (x_own_selection): Remove needless cast to unsigned long.
 +
 +      * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
 +      that always fit in int.  Use a sentinel instead of a counter, to
 +      avoid a temp and to allay GCC's concerns about possible int overflow.
 +      * frame.h (struct frame): Use int for menu_bar_items_used
 +      instead of EMACS_INT, since it always fits in int.
 +
 +      * menu.c (grow_menu_items): Check for int overflow.
 +
 +      * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
 +
 +      * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
 +      Before, the code was not consistent.  These values cannot exceed
 +      2**31 - 1 so there's no need to make them unsigned.
 +      (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
 +      (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
 +      (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
 +      as modifiers.
 +      * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
 +
 +      * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
 +      (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
 +      Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
 +      presumably because the widths might not match.
 +
 +      * window.c (size_window): Avoid needless test at loop start.
 +
 +2011-05-18  Courtney Bane  <emacs-bugs-7626@cbane.org>  (tiny change)
 +
 +      * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
 +
 +2011-05-12  Drew Adams  <drew.adams@oracle.com>
 +
 +      * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
 +
 +2011-05-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 +
 +      * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
 +      `width' to `bar_area_x' and `bar_area_width', respectively.
 +      (x_scroll_run): Take account of fringe background extension.
 +
 +      * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
 +      Rename local vars `left' and `width' to `bar_area_x' and
 +      `bar_area_width', respectively.
 +      (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
 +      background extension.
 +
 +2011-05-10  Jim Meyering  <meyering@redhat.com>
 +
 +      * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
 +
 +2011-05-10  Juanma Barranquero  <lekktu@gmail.com>
 +
 +      * image.c (Finit_image_library): Return t for built-in image types,
 +      like pbm and xbm.  (Bug#8640)
  
  2011-05-09  Andreas Schwab  <schwab@linux-m68k.org>
  
        (Fget_screen_color): New function.
        (syms_of_ntterm): Defsubr it.
  
 -      * callproc.c (call_process_cleanup): Don't close and unlink the
 -      temporary file if Fcall_process didn't create it in the first
 -      place.
 -      (Fcall_process): Don't create tempfile if stdout of the child
 -      process will be redirected to a file specified with `:file'.
 +      * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
 +      unlink the temporary file if Fcall_process didn't create it in the
 +      first place.
 +      (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
 +      child process will be redirected to a file specified with `:file'.
        Don't try to re-open tempfile in that case, and set fd[0] to -1 as
        cue to call_process_cleanup not to close that handle.
  
        * dbusbind.c: Do not use XPNTR on a value that may be an integer.
        Reported by Stefan Monnier in
        <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
 -      (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages): Use
 -      SYMBOLP-guarded XSYMBOL, not XPNTR.
 +      (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
 +      Use SYMBOLP-guarded XSYMBOL, not XPNTR.
  
        * lisp.h (EMACS_INTPTR): Remove.  All uses changed to intptr_t.
        (EMACS_UINTPTR): Likewise, with uintptr_t.
        * callproc.c: Indentation fixup.
  
        * sysdep.c (wait_for_termination_1): Make static.
 -      (wait_for_termination, interruptible_wait_for_termination): Move
 -      after wait_for_termination_1.
 +      (wait_for_termination, interruptible_wait_for_termination):
 +      Move after wait_for_termination_1.
  
  2011-05-01  Lars Magne Ingebrigtsen  <larsi@gnus.org>
  
        (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
  
        * lisp.h: Fix a problem with aliasing and vector headers.  (Bug#8546)
 -      GCC 4.6.0 optimizes based on type-based alias analysis.  For
 -      example, if b is of type struct buffer * and v of type struct
 +      GCC 4.6.0 optimizes based on type-based alias analysis.
 +      For example, if b is of type struct buffer * and v of type struct
        Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
        != &v->size, and therefore "v->size = 1; b->size = 2; return
        v->size;" must therefore return 1.  This assumption is incorrect
        (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
        (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
        since Lisp_Subr is a special case (no "next" field).
 -      (ASIZE): Now uses header.size rather than size.  All
 -      previous uses of XVECTOR (foo)->size replaced to use this macro,
 +      (ASIZE): Now uses header.size rather than size.
 +      All previous uses of XVECTOR (foo)->size replaced to use this macro,
        to avoid the hassle of writing XVECTOR (foo)->header.size.
        (struct vectorlike_header): New type.
        (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
        Break out the floating-point parsing into a new
        function string_to_number, so that Fstring_to_number parses
        floating point numbers consistently with the Lisp reader.
 -      (digit_to_number): Moved here from data.c.  Make it static inline.
 +      (digit_to_number): Move here from data.c.  Make it static inline.
        (E_CHAR, EXP_INT): Remove, replacing with ...
        (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
        (string_to_number): New function, replacing isfloat_string.
        :verify-hostname-error, :verify-error, and :verify-flags
        parameters of `gnutls-boot' and documented those parameters in the
        docstring.  Start callback support.
 -      (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
 -      unless a fatal error occured. Call gnutls_alert_send_appropriate
 -      on error. Return error code.
 +      (emacs_gnutls_handshake): Add Woe32 support.  Retry handshake
 +      unless a fatal error occurred.  Call gnutls_alert_send_appropriate
 +      on error.  Return error code.
        (emacs_gnutls_write): Call emacs_gnutls_handle_error.
        (emacs_gnutls_read): Likewise.
        (Fgnutls_boot): Return handshake error code.
        Fix doprnt so it could be used again safely in `verror'.  (Bug#8435)
        * doprnt.c: Include limits.h.
        (SIZE_MAX): New macro.
 -      (doprnt): Return a size_t value.  2nd arg is now size_t.  Many
 -      local variables are now size_t instead of int or unsigned.
 +      (doprnt): Return a size_t value.  2nd arg is now size_t.
 +      Many local variables are now size_t instead of int or unsigned.
        Improve overflow protection.  Support `l' modifier for integer
        conversions.  Support %l conversion.  Don't assume an EMACS_INT
        argument for integer conversions and for %c.
  
        * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
  
 -      * textprop.c (verify_interval_modification, interval_of): Declare
 -      arguments EMACS_INT.
 +      * textprop.c (verify_interval_modification, interval_of):
 +      Declare arguments EMACS_INT.
  
        * intervals.c (adjust_intervals_for_insertion): Declare arguments
        EMACS_INT.
        (free_realized_fontset) #if-0 the body, which does nothing.
        (face_suitable_for_char_p): #if-0, as it's never called.
        * fontset.h (face_suitable_for_char_p): Remove decl.
 -      * xfaces.c (face_at_string_position): Use
 -      FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
 +      * xfaces.c (face_at_string_position):
 +      Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
        since 0 is always ASCII.
  
        * fns.c (weak_hash_tables): Now static.
        (last_point_position_window): Remove decls.
        * keyboard.c: Make these variables static.
  
 -      * coding.h (coding, code_convert_region, encode_coding_gap): Remove
 -      decls.
 +      * coding.h (coding, code_convert_region, encode_coding_gap):
 +      Remove decls.
        * coding.c (Vsjis_coding_system, Vbig5_coding_system):
        (iso_code_class, detect_coding, code_convert_region): Now static.
        (encode_coding_gap): Remove; unused.
        exported only to the debugger.
  
        * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
 -      * atimer.h (run_all_atimers): Removed; not exported.
 +      * atimer.h (run_all_atimers): Remove; not exported.
  
        font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
        * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
  
  2011-04-09  Chong Yidong  <cyd@stupidchicken.com>
  
 -      * ftfont.c (get_adstyle_property, ftfont_pattern_entity): Use
 -      unsigned char, to match FcChar8 type definition.
 +      * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
 +      Use unsigned char, to match FcChar8 type definition.
  
        * xterm.c (handle_one_xevent):
        * xmenu.c (create_and_show_popup_menu):
  
  2011-04-06  Chong Yidong  <cyd@stupidchicken.com>
  
 -      * process.c (Flist_processes): Removed to Lisp.
 -      (list_processes_1): Deleted.
 +      * process.c (Flist_processes): Remove to Lisp.
 +      (list_processes_1): Delete.
  
  2011-04-06  Eli Zaretskii  <eliz@gnu.org>
  
        * callint.c (Fcall_interactively): Preserve lexical-binding mode for
        interactive spec.
  
 -      * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN): New
 -      byte-codes.
 +      * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
 +      New byte-codes.
        (exec_byte_code): New function extracted from Fbyte_code to handle new
        calling convention for byte-code-functions.  Add new byte-codes.
  
  2011-03-31  Eli Zaretskii  <eliz@gnu.org>
  
        * xdisp.c (SCROLL_LIMIT): New macro.
 -      (try_scrolling): Use it when setting scroll_limit.  Limit
 -      scrolling to 100 screen lines.
 +      (try_scrolling): Use it when setting scroll_limit.
 +      Limit scrolling to 100 screen lines.
        (redisplay_window): Even when falling back on "recentering",
        position point in the window according to scroll-conservatively,
        scroll-margin, and scroll-*-aggressively variables.  (Bug#6671)
diff --combined src/xdisp.c
index 4075688ea0a74e071a7456d2e9c2c1e3646bfea9,a5eb2aa923ab3efa2b1a6a851d990de3686efa09..0cb1863da9bc513f1af71f3e94dc45d1ed166cce
@@@ -258,7 -258,7 +258,7 @@@ along with GNU Emacs.  If not, see <htt
     still left to right, i.e. the iterator "thinks" the first character
     is at the leftmost pixel position.  The iterator does not know that
     PRODUCE_GLYPHS reverses the order of the glyphs that the iterator
 -   delivers.  This is important when functions from the the move_it_*
 +   delivers.  This is important when functions from the move_it_*
     family are used to get to certain screen position or to match
     screen coordinates with buffer coordinates: these functions use the
     iterator geometry, which is left to right even in R2L paragraphs.
@@@ -837,7 -837,7 +837,7 @@@ static int cursor_row_fully_visible_p (
  static int try_scrolling (Lisp_Object, int, EMACS_INT, EMACS_INT, int, int);
  static int try_cursor_movement (Lisp_Object, struct text_pos, int *);
  static int trailing_whitespace_p (EMACS_INT);
 -static unsigned long int message_log_check_duplicate (EMACS_INT, EMACS_INT);
 +static intmax_t message_log_check_duplicate (EMACS_INT, EMACS_INT);
  static void push_it (struct it *, struct text_pos *);
  static void pop_it (struct it *);
  static void sync_frame_with_window_matrix_rows (struct window *);
@@@ -954,7 -954,7 +954,7 @@@ static int coords_in_mouse_face_p (stru
  
     This is the height of W minus the height of a mode line, if any.  */
  
 -INLINE int
 +inline int
  window_text_bottom_y (struct window *w)
  {
    int height = WINDOW_TOTAL_HEIGHT (w);
     means return the total width of W, not including fringes to
     the left and right of the window.  */
  
 -INLINE int
 +inline int
  window_box_width (struct window *w, int area)
  {
    int cols = XFASTINT (w->total_cols);
  /* Return the pixel height of the display area of window W, not
     including mode lines of W, if any.  */
  
 -INLINE int
 +inline int
  window_box_height (struct window *w)
  {
    struct frame *f = XFRAME (w->frame);
     area AREA of window W.  AREA < 0 means return the left edge of the
     whole window, to the right of the left fringe of W.  */
  
 -INLINE int
 +inline int
  window_box_left_offset (struct window *w, int area)
  {
    int x;
     area AREA of window W.  AREA < 0 means return the right edge of the
     whole window, to the left of the right fringe of W.  */
  
 -INLINE int
 +inline int
  window_box_right_offset (struct window *w, int area)
  {
    return window_box_left_offset (w, area) + window_box_width (w, area);
     area AREA of window W.  AREA < 0 means return the left edge of the
     whole window, to the right of the left fringe of W.  */
  
 -INLINE int
 +inline int
  window_box_left (struct window *w, int area)
  {
    struct frame *f = XFRAME (w->frame);
     area AREA of window W.  AREA < 0 means return the right edge of the
     whole window, to the left of the right fringe of W.  */
  
 -INLINE int
 +inline int
  window_box_right (struct window *w, int area)
  {
    return window_box_left (w, area) + window_box_width (w, area);
     coordinates of the upper-left corner of the box.  Return in
     *BOX_WIDTH, and *BOX_HEIGHT the pixel width and height of the box.  */
  
 -INLINE void
 +inline void
  window_box (struct window *w, int area, int *box_x, int *box_y,
            int *box_width, int *box_height)
  {
     *BOTTOM_RIGHT_Y the coordinates of the bottom-right corner of the
     box.  */
  
 -static INLINE void
 +static inline void
  window_box_edges (struct window *w, int area, int *top_left_x, int *top_left_y,
                   int *bottom_right_x, int *bottom_right_y)
  {
@@@ -1371,13 -1371,13 +1371,13 @@@ pos_visible_p (struct window *w, EMACS_
     returns an invalid character.  If we find one, we return a `?', but
     with the length of the invalid character.  */
  
 -static INLINE int
 +static inline int
  string_char_and_length (const unsigned char *str, int *len)
  {
    int c;
  
    c = STRING_CHAR_AND_LENGTH (str, *len);
 -  if (!CHAR_VALID_P (c, 1))
 +  if (!CHAR_VALID_P (c))
      /* We may not change the length here because other places in Emacs
         don't use this function, i.e. they silently accept invalid
         characters.  */
@@@ -1419,7 -1419,7 +1419,7 @@@ string_pos_nchars_ahead (struct text_po
  /* Value is the text position, i.e. character and byte position,
     for character position CHARPOS in STRING.  */
  
 -static INLINE struct text_pos
 +static inline struct text_pos
  string_pos (EMACS_INT charpos, Lisp_Object string)
  {
    struct text_pos pos;
@@@ -2180,7 -2180,7 +2180,7 @@@ safe_eval_handler (Lisp_Object arg
     redisplay during the evaluation.  */
  
  Lisp_Object
 -safe_call (size_t nargs, Lisp_Object *args)
 +safe_call (ptrdiff_t nargs, Lisp_Object *args)
  {
    Lisp_Object val;
  
@@@ -2251,7 -2251,8 +2251,7 @@@ safe_call2 (Lisp_Object fn, Lisp_Objec
     This is for debugging.  It is too slow to do unconditionally.  */
  
  static void
 -check_it (it)
 -     struct it *it;
 +check_it (struct it *it)
  {
    if (it->method == GET_FROM_STRING)
      {
  #endif /* not 0 */
  
  
 -#if GLYPH_DEBUG
 +#if GLYPH_DEBUG && XASSERTS
  
  /* Check that the window end of window W is what we expect it
     to be---the last row in the current matrix displaying text.  */
  
  static void
 -check_window_end (w)
 -     struct window *w;
 +check_window_end (struct window *w)
  {
    if (!MINI_WINDOW_P (w)
        && !NILP (w->window_end_valid))
  
  #define CHECK_WINDOW_END(W)   check_window_end ((W))
  
 -#else /* not GLYPH_DEBUG */
 +#else
  
  #define CHECK_WINDOW_END(W)   (void) 0
  
 -#endif /* not GLYPH_DEBUG */
 +#endif
  
  
  \f
@@@ -2429,7 -2431,7 +2429,7 @@@ init_iterator (struct it *it, struct wi
       is invisible.  >0 means lines indented more than this value are
       invisible.  */
    it->selective = (INTEGERP (BVAR (current_buffer, selective_display))
 -                 ? XFASTINT (BVAR (current_buffer, selective_display))
 +                 ? XINT (BVAR (current_buffer, selective_display))
                   : (!NILP (BVAR (current_buffer, selective_display))
                      ? -1 : 0));
    it->selective_display_ellipsis_p
@@@ -3112,9 -3114,10 +3112,9 @@@ compute_stop_pos (struct it *it
  static EMACS_INT
  next_overlay_change (EMACS_INT pos)
  {
 -  int noverlays;
 +  ptrdiff_t i, noverlays;
    EMACS_INT endpos;
    Lisp_Object *overlays;
 -  int i;
  
    /* Get all overlays at the given position.  */
    GET_OVERLAYS_AT (pos, overlays, noverlays, &endpos, 1);
@@@ -3142,6 -3145,8 +3142,6 @@@ static struct buffer *cached_disp_buffe
  static int cached_disp_modiff;
  static int cached_disp_overlay_modiff;
  
 -static int ignore_display_strings;
 -
  /* Return the character position of a display string at or after
     position specified by POSITION.  If no display string exists at or
     after POSITION, return ZV.  A display string is either an overlay
@@@ -3170,7 -3175,8 +3170,7 @@@ compute_display_string_pos (struct text
         that have display string properties.  */
        || string->from_disp_str
        /* C strings cannot have display properties.  */
 -      || (string->s && !STRINGP (object))
 -      || ignore_display_strings)
 +      || (string->s && !STRINGP (object)))
      return eob;
  
    /* Check the cached values.  */
@@@ -4839,11 -4845,6 +4839,11 @@@ handle_composition_prop (struct it *it
        && COMPOSITION_VALID_P (start, end, prop)
        && (STRINGP (it->string) || (PT <= start || PT >= end)))
      {
 +      if (start < pos)
 +      /* As we can't handle this situation (perhaps font-lock added
 +         a new composition), we just return here hoping that next
 +         redisplay will detect this composition much earlier.  */
 +      return HANDLED_NORMALLY;
        if (start != pos)
        {
          if (STRINGP (it->string))
@@@ -5503,8 -5504,7 +5503,8 @@@ back_to_previous_line_start (struct it 
  static int
  forward_to_next_line_start (struct it *it, int *skipped_p)
  {
 -  int old_selective, newline_found_p, n;
 +  EMACS_INT old_selective;
 +  int newline_found_p, n;
    const int MAX_NEWLINE_DISTANCE = 500;
  
    /* If already on a newline, just consume it to avoid unintended
@@@ -5597,7 -5597,7 +5597,7 @@@ back_to_previous_visible_line_start (st
         invisible.  */
        if (it->selective > 0
          && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it),
 -                              (double) it->selective)) /* iftc */
 +                              it->selective))
        continue;
  
        /* Check the newline before point for invisibility.  */
@@@ -5699,7 -5699,7 +5699,7 @@@ reseat_at_next_visible_line_start (stru
    if (it->selective > 0)
      while (IT_CHARPOS (*it) < ZV
           && indented_beyond_p (IT_CHARPOS (*it), IT_BYTEPOS (*it),
 -                               (double) it->selective)) /* iftc */
 +                               it->selective))
        {
        xassert (IT_BYTEPOS (*it) == BEGV
                 || FETCH_BYTE (IT_BYTEPOS (*it) - 1) == '\n');
@@@ -5773,18 -5773,10 +5773,18 @@@ reseat (struct it *it, struct text_pos 
        {
          /* For bidi iteration, we need to prime prev_stop and
             base_level_stop with our best estimations.  */
 +        /* Implementation note: Of course, POS is not necessarily a
 +           stop position, so assigning prev_pos to it is a lie; we
 +           should have called compute_stop_backwards.  However, if
 +           the current buffer does not include any R2L characters,
 +           that call would be a waste of cycles, because the
 +           iterator will never move back, and thus never cross this
 +           "fake" stop position.  So we delay that backward search
 +           until the time we really need it, in next_element_from_buffer.  */
          if (CHARPOS (pos) != it->prev_stop)
            it->prev_stop = CHARPOS (pos);
          if (CHARPOS (pos) < it->base_level_stop)
 -          it->base_level_stop = 0;
 +          it->base_level_stop = 0; /* meaning it's unknown */
          handle_stop (it);
        }
        else
@@@ -5934,7 -5926,7 +5934,7 @@@ reseat_to_string (struct it *it, const 
        if (it->bidi_p)
        {
          it->bidi_it.string.lstring = Qnil;
 -        it->bidi_it.string.s = s;
 +        it->bidi_it.string.s = (const unsigned char *) s;
          it->bidi_it.string.schars = it->end_charpos;
          it->bidi_it.string.bufpos = 0;
          it->bidi_it.string.from_disp_str = 0;
@@@ -6217,8 -6209,7 +6217,8 @@@ get_next_display_element (struct it *it
                 display.  Then, set IT->dpvec to these glyphs.  */
              Lisp_Object gc;
              int ctl_len;
 -            int face_id, lface_id = 0 ;
 +            int face_id;
 +            EMACS_INT lface_id = 0;
              int escape_glyph;
  
              /* Handle control characters with ^.  */
        else
        {
          EMACS_INT pos = (it->s ? -1
 -                         : STRINGP (it->string) ? IT_STRING_CHARPOS (*it)
 -                         : IT_CHARPOS (*it));
 +                   : STRINGP (it->string) ? IT_STRING_CHARPOS (*it)
 +                   : IT_CHARPOS (*it));
 +        int c;
 +
 +        if (it->what == IT_CHARACTER)
 +          c = it->char_to_display;
 +        else
 +          {
 +            struct composition *cmp = composition_table[it->cmp_it.id];
 +            int i;
  
 -        it->face_id = FACE_FOR_CHAR (it->f, face, it->char_to_display, pos,
 -                                     it->string);
 +            c = ' ';
 +            for (i = 0; i < cmp->glyph_len; i++)
 +              if ((c = COMPOSITION_GLYPH (cmp, i)) != '\t')
 +                break;
 +          }
 +        it->face_id = FACE_FOR_CHAR (it->f, face, c, pos, it->string);
        }
      }
  
@@@ -6859,7 -6838,7 +6859,7 @@@ next_element_from_display_vector (struc
        it->face_id = it->dpvec_face_id;
        else
        {
 -        int lface_id = GLYPH_CODE_FACE (gc);
 +        EMACS_INT lface_id = GLYPH_CODE_FACE (gc);
          if (lface_id > 0)
            it->face_id = merge_faces (it->f, Qt, lface_id,
                                       it->saved_face_id);
@@@ -6989,7 -6968,7 +6989,7 @@@ next_element_from_string (struct it *it
    struct text_pos position;
  
    xassert (STRINGP (it->string));
 -  xassert (!it->bidi_p || it->string == it->bidi_it.string.lstring);
 +  xassert (!it->bidi_p || EQ (it->string, it->bidi_it.string.lstring));
    xassert (IT_STRING_CHARPOS (*it) >= 0);
    position = it->current.string_pos;
  
@@@ -7348,7 -7327,7 +7348,7 @@@ next_element_from_buffer (struct it *it
    xassert (IT_CHARPOS (*it) >= BEGV);
    xassert (NILP (it->string) && !it->s);
    xassert (!it->bidi_p
 -         || (it->bidi_it.string.lstring == Qnil
 +         || (EQ (it->bidi_it.string.lstring, Qnil)
               && it->bidi_it.string.s == NULL));
  
    /* With bidi reordering, the character to display might not be the
                  && IT_CHARPOS (*it) + 1 < ZV
                  && indented_beyond_p (IT_CHARPOS (*it) + 1,
                                        IT_BYTEPOS (*it) + 1,
 -                                      (double) it->selective)) /* iftc */
 +                                      it->selective))
                {
                  success_p = next_element_from_ellipsis (it);
                  it->dpvec_char_len = -1;
@@@ -7641,8 -7620,9 +7641,9 @@@ move_it_in_display_line_to (struct it *
  {
    enum move_it_result result = MOVE_UNDEFINED;
    struct glyph_row *saved_glyph_row;
-   struct it wrap_it, atpos_it, atx_it;
+   struct it wrap_it, atpos_it, atx_it, ppos_it;
    void *wrap_data = NULL, *atpos_data = NULL, *atx_data = NULL;
+   void *ppos_data = NULL;
    int may_wrap = 0;
    enum it_method prev_method = it->method;
    EMACS_INT prev_pos = IT_CHARPOS (*it);
    atpos_it.sp = -1;
    atx_it.sp = -1;
  
+   /* Use ppos_it under bidi reordering to save a copy of IT for the
+      position > CHARPOS that is the closest to CHARPOS.  We restore
+      that position in IT when we have scanned the entire display line
+      without finding a match for CHARPOS and all the character
+      positions are greater than CHARPOS.  */
+   if (it->bidi_p)
+     {
+       SAVE_IT (ppos_it, *it, ppos_data);
+       SET_TEXT_POS (ppos_it.current.pos, ZV, ZV_BYTE);
+       if ((op & MOVE_TO_POS) && IT_CHARPOS (*it) >= to_charpos)
+       SAVE_IT (ppos_it, *it, ppos_data);
+     }
  #define BUFFER_POS_REACHED_P()                                        \
    ((op & MOVE_TO_POS) != 0                                    \
     && BUFFERP (it->object)                                    \
          if (IT_CHARPOS (*it) < CHARPOS (this_line_min_pos))
            SET_TEXT_POS (this_line_min_pos,
                          IT_CHARPOS (*it), IT_BYTEPOS (*it));
+         if (it->bidi_p
+             && (op & MOVE_TO_POS)
+             && IT_CHARPOS (*it) > to_charpos
+             && IT_CHARPOS (*it) < IT_CHARPOS (ppos_it))
+           SAVE_IT (ppos_it, *it, ppos_data);
          continue;
        }
  
          if ((op & MOVE_TO_POS) != 0
              && !saw_smaller_pos
              && IT_CHARPOS (*it) > to_charpos)
-           result = MOVE_POS_MATCH_OR_ZV;
+           {
+             result = MOVE_POS_MATCH_OR_ZV;
+             if (it->bidi_p && IT_CHARPOS (ppos_it) < ZV)
+               RESTORE_IT (it, &ppos_it, ppos_data);
+           }
          else
            result = MOVE_NEWLINE_OR_CR;
          break;
        SET_TEXT_POS (this_line_min_pos, IT_CHARPOS (*it), IT_BYTEPOS (*it));
        if (IT_CHARPOS (*it) < to_charpos)
        saw_smaller_pos = 1;
+       if (it->bidi_p
+         && (op & MOVE_TO_POS)
+         && IT_CHARPOS (*it) >= to_charpos
+         && IT_CHARPOS (*it) < IT_CHARPOS (ppos_it))
+       SAVE_IT (ppos_it, *it, ppos_data);
  
        /* Stop if lines are truncated and IT's current x-position is
         past the right edge of the window now.  */
          if (!FRAME_WINDOW_P (it->f)
              || IT_OVERFLOW_NEWLINE_INTO_FRINGE (it))
            {
-             if (!get_next_display_element (it)
+             int at_eob_p = 0;
+             if ((at_eob_p = !get_next_display_element (it))
                  || BUFFER_POS_REACHED_P ()
                  /* If we are past TO_CHARPOS, but never saw any
                     character positions smaller than TO_CHARPOS,
                      && IT_CHARPOS (*it) > to_charpos))
                {
                  result = MOVE_POS_MATCH_OR_ZV;
+                 if (it->bidi_p && !at_eob_p && IT_CHARPOS (ppos_it) < ZV)
+                   RESTORE_IT (it, &ppos_it, ppos_data);
                  break;
                }
              if (ITERATOR_AT_END_OF_LINE_P (it))
                   && IT_CHARPOS (*it) > to_charpos)
            {
              result = MOVE_POS_MATCH_OR_ZV;
+             if (it->bidi_p && IT_CHARPOS (ppos_it) < ZV)
+               RESTORE_IT (it, &ppos_it, ppos_data);
              break;
            }
          result = MOVE_LINE_TRUNCATED;
      xfree (atx_data);
    if (wrap_data)
      xfree (wrap_data);
+   if (ppos_data)
+     xfree (ppos_data);
  
    /* Restore the iterator settings altered at the beginning of this
       function.  */
@@@ -8802,7 -8817,7 +8838,7 @@@ message_dolog (const char *m, EMACS_IN
        if (nlflag)
        {
          EMACS_INT this_bol, this_bol_byte, prev_bol, prev_bol_byte;
 -        unsigned long int dups;
 +        intmax_t dups;
          insert_1 ("\n", 1, 1, 0, 0);
  
          scan_newline (Z, Z_BYTE, BEG, BEG_BYTE, -2, 0);
                                  this_bol, this_bol_byte, 0);
                  if (dups > 1)
                    {
 -                    char dupstr[40];
 +                    char dupstr[sizeof " [ times]"
 +                                + INT_STRLEN_BOUND (intmax_t)];
                      int duplen;
  
                      /* If you change this format, don't forget to also
                         change message_log_check_duplicate.  */
 -                    sprintf (dupstr, " [%lu times]", dups);
 +                    sprintf (dupstr, " [%"PRIdMAX" times]", dups);
                      duplen = strlen (dupstr);
                      TEMP_SET_PT_BOTH (Z - 1, Z_BYTE - 1);
                      insert_1 (dupstr, duplen, 1, 0, 1);
     Return 0 if different, 1 if the new one should just replace it, or a
     value N > 1 if we should also append " [N times]".  */
  
 -static unsigned long int
 +static intmax_t
  message_log_check_duplicate (EMACS_INT prev_bol_byte, EMACS_INT this_bol_byte)
  {
    EMACS_INT i;
    if (*p1++ == ' ' && *p1++ == '[')
      {
        char *pend;
 -      unsigned long int n = strtoul ((char *) p1, &pend, 10);
 -      if (strncmp (pend, " times]\n", 8) == 0)
 +      intmax_t n = strtoimax ((char *) p1, &pend, 10);
 +      if (0 < n && n < INTMAX_MAX && strncmp (pend, " times]\n", 8) == 0)
        return n+1;
      }
    return 0;
@@@ -11245,7 -11259,7 +11281,7 @@@ DEFUN ("tool-bar-lines-needed", Ftool_b
    f = XFRAME (frame);
  
    if (WINDOWP (f->tool_bar_window)
 -      || (w = XWINDOW (f->tool_bar_window),
 +      && (w = XWINDOW (f->tool_bar_window),
          WINDOW_TOTAL_LINES (w) > 0))
      {
        update_tool_bar (f, 1);
@@@ -11849,42 -11863,40 +11885,42 @@@ hscroll_windows (Lisp_Object window
  
  /* First and last unchanged row for try_window_id.  */
  
 -int debug_first_unchanged_at_end_vpos;
 -int debug_last_unchanged_at_beg_vpos;
 +static int debug_first_unchanged_at_end_vpos;
 +static int debug_last_unchanged_at_beg_vpos;
  
  /* Delta vpos and y.  */
  
 -int debug_dvpos, debug_dy;
 +static int debug_dvpos, debug_dy;
  
  /* Delta in characters and bytes for try_window_id.  */
  
 -EMACS_INT debug_delta, debug_delta_bytes;
 +static EMACS_INT debug_delta, debug_delta_bytes;
  
  /* Values of window_end_pos and window_end_vpos at the end of
     try_window_id.  */
  
 -EMACS_INT debug_end_vpos;
 +static EMACS_INT debug_end_vpos;
  
  /* Append a string to W->desired_matrix->method.  FMT is a printf
 -   format string.  A1...A9 are a supplement for a variable-length
 -   argument list.  If trace_redisplay_p is non-zero also printf the
 +   format string.  If trace_redisplay_p is non-zero also printf the
     resulting string to stderr.  */
  
 +static void debug_method_add (struct window *, char const *, ...)
 +  ATTRIBUTE_FORMAT_PRINTF (2, 3);
 +
  static void
 -debug_method_add (w, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9)
 -     struct window *w;
 -     char *fmt;
 -     int a1, a2, a3, a4, a5, a6, a7, a8, a9;
 +debug_method_add (struct window *w, char const *fmt, ...)
  {
    char buffer[512];
    char *method = w->desired_matrix->method;
    int len = strlen (method);
    int size = sizeof w->desired_matrix->method;
    int remaining = size - len - 1;
 +  va_list ap;
  
 -  sprintf (buffer, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9);
 +  va_start (ap, fmt);
 +  vsprintf (buffer, fmt, ap);
 +  va_end (ap);
    if (len && remaining)
      {
        method[len] = '|';
      fprintf (stderr, "%p (%s): %s\n",
             w,
             ((BUFFERP (w->buffer)
 -             && STRINGP (XBUFFER (w->buffer)->name))
 -            ? SSDATA (XBUFFER (w->buffer)->name)
 +             && STRINGP (BVAR (XBUFFER (w->buffer), name)))
 +            ? SSDATA (BVAR (XBUFFER (w->buffer), name))
              : "no buffer"),
             buffer);
  }
     buffer position, END is given as a distance from Z.  Used in
     redisplay_internal for display optimization.  */
  
 -static INLINE int
 +static inline int
  text_outside_line_unchanged_p (struct window *w,
                               EMACS_INT start, EMACS_INT end)
  {
@@@ -12172,7 -12184,7 +12208,7 @@@ check_point_in_composition (struct buff
  /* Reconsider the setting of B->clip_changed which is displayed
     in window W.  */
  
 -static INLINE void
 +static inline void
  reconsider_clip_changes (struct window *w, struct buffer *b)
  {
    if (b->clip_changed
@@@ -13752,7 -13764,7 +13788,7 @@@ set_cursor_from_row (struct window *w, 
  
     We assume that the window's buffer is really current.  */
  
 -static INLINE struct text_pos
 +static inline struct text_pos
  run_window_scroll_functions (Lisp_Object window, struct text_pos startp)
  {
    struct window *w = XWINDOW (window);
@@@ -15705,8 -15717,7 +15741,8 @@@ try_window_reusing_current_matrix (stru
                row->visible_height -= min_y - row->y;
              if (row->y + row->height > max_y)
                row->visible_height -= row->y + row->height - max_y;
 -            row->redraw_fringe_bitmaps_p = 1;
 +            if (row->fringe_bitmap_periodic_p)
 +              row->redraw_fringe_bitmaps_p = 1;
  
              it.current_y += row->height;
  
            row->visible_height -= min_y - row->y;
          if (row->y + row->height > max_y)
            row->visible_height -= row->y + row->height - max_y;
 -        row->redraw_fringe_bitmaps_p = 1;
 +        if (row->fringe_bitmap_periodic_p)
 +          row->redraw_fringe_bitmaps_p = 1;
        }
  
        /* Scroll the current matrix.  */
@@@ -17022,9 -17032,9 +17058,9 @@@ try_window_id (struct window *w
  
  #if GLYPH_DEBUG
  
 -void dump_glyph_row (struct glyph_row *, int, int);
 -void dump_glyph_matrix (struct glyph_matrix *, int);
 -void dump_glyph (struct glyph_row *, struct glyph *, int);
 +void dump_glyph_row (struct glyph_row *, int, int) EXTERNALLY_VISIBLE;
 +void dump_glyph_matrix (struct glyph_matrix *, int) EXTERNALLY_VISIBLE;
 +void dump_glyph (struct glyph_row *, struct glyph *, int) EXTERNALLY_VISIBLE;
  
  
  /* Dump the contents of glyph matrix MATRIX on stderr.
     GLYPHS > 1 means show glyphs in long form.  */
  
  void
 -dump_glyph_matrix (matrix, glyphs)
 -     struct glyph_matrix *matrix;
 -     int glyphs;
 +dump_glyph_matrix (struct glyph_matrix *matrix, int glyphs)
  {
    int i;
    for (i = 0; i < matrix->nrows; ++i)
     the glyph row and area where the glyph comes from.  */
  
  void
 -dump_glyph (row, glyph, area)
 -     struct glyph_row *row;
 -     struct glyph *glyph;
 -     int area;
 +dump_glyph (struct glyph_row *row, struct glyph *glyph, int area)
  {
    if (glyph->type == CHAR_GLYPH)
      {
        fprintf (stderr,
 -             "  %5d %4c %6d %c %3d 0x%05x %c %4d %1.1d%1.1d\n",
 +             "  %5td %4c %6"pI"d %c %3d 0x%05x %c %4d %1.1d%1.1d\n",
               glyph - row->glyphs[TEXT_AREA],
               'C',
               glyph->charpos,
    else if (glyph->type == STRETCH_GLYPH)
      {
        fprintf (stderr,
 -             "  %5d %4c %6d %c %3d 0x%05x %c %4d %1.1d%1.1d\n",
 +             "  %5td %4c %6"pI"d %c %3d 0x%05x %c %4d %1.1d%1.1d\n",
               glyph - row->glyphs[TEXT_AREA],
               'S',
               glyph->charpos,
    else if (glyph->type == IMAGE_GLYPH)
      {
        fprintf (stderr,
 -             "  %5d %4c %6d %c %3d 0x%05x %c %4d %1.1d%1.1d\n",
 +             "  %5td %4c %6"pI"d %c %3d 0x%05x %c %4d %1.1d%1.1d\n",
               glyph - row->glyphs[TEXT_AREA],
               'I',
               glyph->charpos,
    else if (glyph->type == COMPOSITE_GLYPH)
      {
        fprintf (stderr,
 -             "  %5d %4c %6d %c %3d 0x%05x",
 +             "  %5td %4c %6"pI"d %c %3d 0x%05x",
               glyph - row->glyphs[TEXT_AREA],
               '+',
               glyph->charpos,
     GLYPHS > 1 means show glyphs in long form.  */
  
  void
 -dump_glyph_row (row, vpos, glyphs)
 -     struct glyph_row *row;
 -     int vpos, glyphs;
 +dump_glyph_row (struct glyph_row *row, int vpos, int glyphs)
  {
    if (glyphs != 1)
      {
        fprintf (stderr, "Row Start   End Used oE><\\CTZFesm     X    Y    W    H    V    A    P\n");
        fprintf (stderr, "======================================================================\n");
  
 -      fprintf (stderr, "%3d %5d %5d %4d %1.1d%1.1d%1.1d%1.1d\
 +      fprintf (stderr, "%3d %5"pI"d %5"pI"d %4d %1.1d%1.1d%1.1d%1.1d\
  %1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d%1.1d  %4d %4d %4d %4d %4d %4d %4d\n",
               vpos,
               MATRIX_ROW_START_CHARPOS (row),
        fprintf (stderr, "%9d %5d\t%5d\n", row->start.overlay_string_index,
               row->end.overlay_string_index,
               row->continuation_lines_width);
 -      fprintf (stderr, "%9d %5d\n",
 +      fprintf (stderr, "%9"pI"d %5"pI"d\n",
               CHARPOS (row->start.string_pos),
               CHARPOS (row->end.string_pos));
        fprintf (stderr, "%9d %5d\n", row->start.dpvec_index,
@@@ -17239,7 -17256,7 +17275,7 @@@ glyphs in short form, otherwise show gl
    struct window *w = XWINDOW (selected_window);
    struct buffer *buffer = XBUFFER (w->buffer);
  
 -  fprintf (stderr, "PT = %d, BEGV = %d. ZV = %d\n",
 +  fprintf (stderr, "PT = %"pI"d, BEGV = %"pI"d. ZV = %"pI"d\n",
           BUF_PT (buffer), BUF_BEGV (buffer), BUF_ZV (buffer));
    fprintf (stderr, "Cursor x = %d, y = %d, hpos = %d, vpos = %d\n",
           w->cursor.x, w->cursor.y, w->cursor.hpos, w->cursor.vpos);
@@@ -17321,7 -17338,7 +17357,7 @@@ With ARG, turn tracing on if and only i
  DEFUN ("trace-to-stderr", Ftrace_to_stderr, Strace_to_stderr, 1, MANY, "",
         doc: /* Like `format', but print result to stderr.
  usage: (trace-to-stderr STRING &rest OBJECTS)  */)
 -  (size_t nargs, Lisp_Object *args)
 +  (ptrdiff_t nargs, Lisp_Object *args)
  {
    Lisp_Object s = Fformat (nargs, args);
    fprintf (stderr, "%s", SDATA (s));
@@@ -19526,7 -19543,8 +19562,7 @@@ display_mode_element (struct it *it, in
                        break;
                      case MODE_LINE_STRING:
                        {
 -                        int len = strlen (spec);
 -                        Lisp_Object tem = make_string (spec, len);
 +                        Lisp_Object tem = build_string (spec);
                          props = Ftext_properties_at (make_number (charpos), elt);
                          /* Should only keep face property in props */
                          n += store_mode_line_string (NULL, tem, 0, field, prec, props);
@@@ -20169,8 -20187,7 +20205,8 @@@ decode_mode_spec_coding (Lisp_Object co
        else if (CHARACTERP (eoltype))
        {
          unsigned char *tmp = (unsigned char *) alloca (MAX_MULTIBYTE_LENGTH);
 -        eol_str_len = CHAR_STRING (XINT (eoltype), tmp);
 +        int c = XFASTINT (eoltype);
 +        eol_str_len = CHAR_STRING (c, tmp);
          eol_str = tmp;
        }
        else
@@@ -21286,7 -21303,8 +21322,7 @@@ calc_pixel_width_or_height (double *res
  #if GLYPH_DEBUG
  
  void
 -dump_glyph_string (s)
 -     struct glyph_string *s;
 +dump_glyph_string (struct glyph_string *s)
  {
    fprintf (stderr, "glyph string\n");
    fprintf (stderr, "  x, y, w, h = %d, %d, %d, %d\n",
@@@ -21354,7 -21372,7 +21390,7 @@@ init_glyph_string (struct glyph_string 
  /* Append the list of glyph strings with head H and tail T to the list
     with head *HEAD and tail *TAIL.  Set *HEAD and *TAIL to the result.  */
  
 -static INLINE void
 +static inline void
  append_glyph_string_lists (struct glyph_string **head, struct glyph_string **tail,
                           struct glyph_string *h, struct glyph_string *t)
  {
     list with head *HEAD and tail *TAIL.  Set *HEAD and *TAIL to the
     result.  */
  
 -static INLINE void
 +static inline void
  prepend_glyph_string_lists (struct glyph_string **head, struct glyph_string **tail,
                            struct glyph_string *h, struct glyph_string *t)
  {
  /* Append glyph string S to the list with head *HEAD and tail *TAIL.
     Set *HEAD and *TAIL to the resulting list.  */
  
 -static INLINE void
 +static inline void
  append_glyph_string (struct glyph_string **head, struct glyph_string **tail,
                     struct glyph_string *s)
  {
     Value is a pointer to a realized face that is ready for display if
     DISPLAY_P is non-zero.  */
  
 -static INLINE struct face *
 +static inline struct face *
  get_char_face_and_encoding (struct frame *f, int c, int face_id,
                            XChar2b *char2b, int display_p)
  {
     The encoding of GLYPH->u.ch is returned in *CHAR2B.  Value is
     a pointer to a realized face that is ready for display.  */
  
 -static INLINE struct face *
 +static inline struct face *
  get_glyph_face_and_encoding (struct frame *f, struct glyph *glyph,
                             XChar2b *char2b, int *two_byte_p)
  {
  /* Get glyph code of character C in FONT in the two-byte form CHAR2B.
     Retunr 1 if FONT has a glyph for C, otherwise return 0.  */
  
 -static INLINE int
 +static inline int
  get_char_glyph_code (int c, struct font *font, XChar2b *char2b)
  {
    unsigned code;
@@@ -21942,7 -21960,7 +21978,7 @@@ right_overwriting (struct glyph_string 
     first glyph following S.  LAST_X is the right-most x-position + 1
     in the drawing area.  */
  
 -static INLINE void
 +static inline void
  set_glyph_string_background_width (struct glyph_string *s, int start, int last_x)
  {
    /* If the face of this glyph string has to be drawn to the end of
@@@ -22504,7 -22522,7 +22540,7 @@@ draw_glyphs (struct window *w, int x, s
  /* Store one glyph for IT->char_to_display in IT->glyph_row.
     Called from x_produce_glyphs when IT->glyph_row is non-null.  */
  
 -static INLINE void
 +static inline void
  append_glyph (struct it *it)
  {
    struct glyph *glyph;
     IT->glyph_row.  Called from x_produce_glyphs when IT->glyph_row is
     non-null.  */
  
 -static INLINE void
 +static inline void
  append_composite_glyph (struct it *it)
  {
    struct glyph *glyph;
  /* Change IT->ascent and IT->height according to the setting of
     IT->voffset.  */
  
 -static INLINE void
 +static inline void
  take_vertical_position_into_account (struct it *it)
  {
    if (it->voffset)
@@@ -25123,7 -25141,7 +25159,7 @@@ rows_from_pos_range (struct window *w
  
          while (g < e)
            {
 -            if (BUFFERP (g->object)
 +            if ((BUFFERP (g->object) || INTEGERP (g->object))
                  && start_charpos <= g->charpos && g->charpos < end_charpos)
                *start = row;
              g++;
  
          while (g < e)
            {
 -            if (BUFFERP (g->object)
 +            if ((BUFFERP (g->object) || INTEGERP (g->object))
                  && start_charpos <= g->charpos && g->charpos < end_charpos)
                break;
              g++;
@@@ -26276,13 -26294,13 +26312,13 @@@ note_mouse_highlight (struct frame *f, 
        && XFASTINT (w->last_modified) == BUF_MODIFF (b)
        && XFASTINT (w->last_overlay_modified) == BUF_OVERLAY_MODIFF (b))
      {
 -      int hpos, vpos, i, dx, dy, area;
 +      int hpos, vpos, dx, dy, area;
        EMACS_INT pos;
        struct glyph *glyph;
        Lisp_Object object;
        Lisp_Object mouse_face = Qnil, position;
        Lisp_Object *overlay_vec = NULL;
 -      int noverlays;
 +      ptrdiff_t i, noverlays;
        struct buffer *obuf;
        EMACS_INT obegv, ozv;
        int same_region;
@@@ -27205,7 -27223,7 +27241,7 @@@ x_intersect_rectangles (XRectangle *r1
      {
        result->x = right->x;
  
 -      /* The right end of the intersection is the minimum of the
 +      /* The right end of the intersection is the minimum of
         the right ends of left and right.  */
        result->width = (min (left->x + left->width, right->x + right->width)
                       - result->x);
@@@ -27250,7 -27268,8 +27286,7 @@@ syms_of_xdisp (void
    Vmessage_stack = Qnil;
    staticpro (&Vmessage_stack);
  
 -  Qinhibit_redisplay = intern_c_string ("inhibit-redisplay");
 -  staticpro (&Qinhibit_redisplay);
 +  DEFSYM (Qinhibit_redisplay, "inhibit-redisplay");
  
    message_dolog_marker1 = Fmake_marker ();
    staticpro (&message_dolog_marker1);
    defsubr (&Sinvisible_p);
    defsubr (&Scurrent_bidi_paragraph_direction);
  
 -  staticpro (&Qmenu_bar_update_hook);
 -  Qmenu_bar_update_hook = intern_c_string ("menu-bar-update-hook");
 -
 -  staticpro (&Qoverriding_terminal_local_map);
 -  Qoverriding_terminal_local_map = intern_c_string ("overriding-terminal-local-map");
 -
 -  staticpro (&Qoverriding_local_map);
 -  Qoverriding_local_map = intern_c_string ("overriding-local-map");
 -
 -  staticpro (&Qwindow_scroll_functions);
 -  Qwindow_scroll_functions = intern_c_string ("window-scroll-functions");
 -
 -  staticpro (&Qwindow_text_change_functions);
 -  Qwindow_text_change_functions = intern_c_string ("window-text-change-functions");
 -
 -  staticpro (&Qredisplay_end_trigger_functions);
 -  Qredisplay_end_trigger_functions = intern_c_string ("redisplay-end-trigger-functions");
 -
 -  staticpro (&Qinhibit_point_motion_hooks);
 -  Qinhibit_point_motion_hooks = intern_c_string ("inhibit-point-motion-hooks");
 -
 -  Qeval = intern_c_string ("eval");
 -  staticpro (&Qeval);
 -
 -  QCdata = intern_c_string (":data");
 -  staticpro (&QCdata);
 -  Qdisplay = intern_c_string ("display");
 -  staticpro (&Qdisplay);
 -  Qspace_width = intern_c_string ("space-width");
 -  staticpro (&Qspace_width);
 -  Qraise = intern_c_string ("raise");
 -  staticpro (&Qraise);
 -  Qslice = intern_c_string ("slice");
 -  staticpro (&Qslice);
 -  Qspace = intern_c_string ("space");
 -  staticpro (&Qspace);
 -  Qmargin = intern_c_string ("margin");
 -  staticpro (&Qmargin);
 -  Qpointer = intern_c_string ("pointer");
 -  staticpro (&Qpointer);
 -  Qleft_margin = intern_c_string ("left-margin");
 -  staticpro (&Qleft_margin);
 -  Qright_margin = intern_c_string ("right-margin");
 -  staticpro (&Qright_margin);
 -  Qcenter = intern_c_string ("center");
 -  staticpro (&Qcenter);
 -  Qline_height = intern_c_string ("line-height");
 -  staticpro (&Qline_height);
 -  QCalign_to = intern_c_string (":align-to");
 -  staticpro (&QCalign_to);
 -  QCrelative_width = intern_c_string (":relative-width");
 -  staticpro (&QCrelative_width);
 -  QCrelative_height = intern_c_string (":relative-height");
 -  staticpro (&QCrelative_height);
 -  QCeval = intern_c_string (":eval");
 -  staticpro (&QCeval);
 -  QCpropertize = intern_c_string (":propertize");
 -  staticpro (&QCpropertize);
 -  QCfile = intern_c_string (":file");
 -  staticpro (&QCfile);
 -  Qfontified = intern_c_string ("fontified");
 -  staticpro (&Qfontified);
 -  Qfontification_functions = intern_c_string ("fontification-functions");
 -  staticpro (&Qfontification_functions);
 -  Qtrailing_whitespace = intern_c_string ("trailing-whitespace");
 -  staticpro (&Qtrailing_whitespace);
 -  Qescape_glyph = intern_c_string ("escape-glyph");
 -  staticpro (&Qescape_glyph);
 -  Qnobreak_space = intern_c_string ("nobreak-space");
 -  staticpro (&Qnobreak_space);
 -  Qimage = intern_c_string ("image");
 -  staticpro (&Qimage);
 -  Qtext = intern_c_string ("text");
 -  staticpro (&Qtext);
 -  Qboth = intern_c_string ("both");
 -  staticpro (&Qboth);
 -  Qboth_horiz = intern_c_string ("both-horiz");
 -  staticpro (&Qboth_horiz);
 -  Qtext_image_horiz = intern_c_string ("text-image-horiz");
 -  staticpro (&Qtext_image_horiz);
 -  QCmap = intern_c_string (":map");
 -  staticpro (&QCmap);
 -  QCpointer = intern_c_string (":pointer");
 -  staticpro (&QCpointer);
 -  Qrect = intern_c_string ("rect");
 -  staticpro (&Qrect);
 -  Qcircle = intern_c_string ("circle");
 -  staticpro (&Qcircle);
 -  Qpoly = intern_c_string ("poly");
 -  staticpro (&Qpoly);
 -  Qmessage_truncate_lines = intern_c_string ("message-truncate-lines");
 -  staticpro (&Qmessage_truncate_lines);
 -  Qgrow_only = intern_c_string ("grow-only");
 -  staticpro (&Qgrow_only);
 -  Qinhibit_menubar_update = intern_c_string ("inhibit-menubar-update");
 -  staticpro (&Qinhibit_menubar_update);
 -  Qinhibit_eval_during_redisplay = intern_c_string ("inhibit-eval-during-redisplay");
 -  staticpro (&Qinhibit_eval_during_redisplay);
 -  Qposition = intern_c_string ("position");
 -  staticpro (&Qposition);
 -  Qbuffer_position = intern_c_string ("buffer-position");
 -  staticpro (&Qbuffer_position);
 -  Qobject = intern_c_string ("object");
 -  staticpro (&Qobject);
 -  Qbar = intern_c_string ("bar");
 -  staticpro (&Qbar);
 -  Qhbar = intern_c_string ("hbar");
 -  staticpro (&Qhbar);
 -  Qbox = intern_c_string ("box");
 -  staticpro (&Qbox);
 -  Qhollow = intern_c_string ("hollow");
 -  staticpro (&Qhollow);
 -  Qhand = intern_c_string ("hand");
 -  staticpro (&Qhand);
 -  Qarrow = intern_c_string ("arrow");
 -  staticpro (&Qarrow);
 -  Qtext = intern_c_string ("text");
 -  staticpro (&Qtext);
 -  Qinhibit_free_realized_faces = intern_c_string ("inhibit-free-realized-faces");
 -  staticpro (&Qinhibit_free_realized_faces);
 +  DEFSYM (Qmenu_bar_update_hook, "menu-bar-update-hook");
 +  DEFSYM (Qoverriding_terminal_local_map, "overriding-terminal-local-map");
 +  DEFSYM (Qoverriding_local_map, "overriding-local-map");
 +  DEFSYM (Qwindow_scroll_functions, "window-scroll-functions");
 +  DEFSYM (Qwindow_text_change_functions, "window-text-change-functions");
 +  DEFSYM (Qredisplay_end_trigger_functions, "redisplay-end-trigger-functions");
 +  DEFSYM (Qinhibit_point_motion_hooks, "inhibit-point-motion-hooks");
 +  DEFSYM (Qeval, "eval");
 +  DEFSYM (QCdata, ":data");
 +  DEFSYM (Qdisplay, "display");
 +  DEFSYM (Qspace_width, "space-width");
 +  DEFSYM (Qraise, "raise");
 +  DEFSYM (Qslice, "slice");
 +  DEFSYM (Qspace, "space");
 +  DEFSYM (Qmargin, "margin");
 +  DEFSYM (Qpointer, "pointer");
 +  DEFSYM (Qleft_margin, "left-margin");
 +  DEFSYM (Qright_margin, "right-margin");
 +  DEFSYM (Qcenter, "center");
 +  DEFSYM (Qline_height, "line-height");
 +  DEFSYM (QCalign_to, ":align-to");
 +  DEFSYM (QCrelative_width, ":relative-width");
 +  DEFSYM (QCrelative_height, ":relative-height");
 +  DEFSYM (QCeval, ":eval");
 +  DEFSYM (QCpropertize, ":propertize");
 +  DEFSYM (QCfile, ":file");
 +  DEFSYM (Qfontified, "fontified");
 +  DEFSYM (Qfontification_functions, "fontification-functions");
 +  DEFSYM (Qtrailing_whitespace, "trailing-whitespace");
 +  DEFSYM (Qescape_glyph, "escape-glyph");
 +  DEFSYM (Qnobreak_space, "nobreak-space");
 +  DEFSYM (Qimage, "image");
 +  DEFSYM (Qtext, "text");
 +  DEFSYM (Qboth, "both");
 +  DEFSYM (Qboth_horiz, "both-horiz");
 +  DEFSYM (Qtext_image_horiz, "text-image-horiz");
 +  DEFSYM (QCmap, ":map");
 +  DEFSYM (QCpointer, ":pointer");
 +  DEFSYM (Qrect, "rect");
 +  DEFSYM (Qcircle, "circle");
 +  DEFSYM (Qpoly, "poly");
 +  DEFSYM (Qmessage_truncate_lines, "message-truncate-lines");
 +  DEFSYM (Qgrow_only, "grow-only");
 +  DEFSYM (Qinhibit_menubar_update, "inhibit-menubar-update");
 +  DEFSYM (Qinhibit_eval_during_redisplay, "inhibit-eval-during-redisplay");
 +  DEFSYM (Qposition, "position");
 +  DEFSYM (Qbuffer_position, "buffer-position");
 +  DEFSYM (Qobject, "object");
 +  DEFSYM (Qbar, "bar");
 +  DEFSYM (Qhbar, "hbar");
 +  DEFSYM (Qbox, "box");
 +  DEFSYM (Qhollow, "hollow");
 +  DEFSYM (Qhand, "hand");
 +  DEFSYM (Qarrow, "arrow");
 +  DEFSYM (Qtext, "text");
 +  DEFSYM (Qinhibit_free_realized_faces, "inhibit-free-realized-faces");
  
    list_of_error = Fcons (Fcons (intern_c_string ("error"),
                                Fcons (intern_c_string ("void-variable"), Qnil)),
                         Qnil);
    staticpro (&list_of_error);
  
 -  Qlast_arrow_position = intern_c_string ("last-arrow-position");
 -  staticpro (&Qlast_arrow_position);
 -  Qlast_arrow_string = intern_c_string ("last-arrow-string");
 -  staticpro (&Qlast_arrow_string);
 -
 -  Qoverlay_arrow_string = intern_c_string ("overlay-arrow-string");
 -  staticpro (&Qoverlay_arrow_string);
 -  Qoverlay_arrow_bitmap = intern_c_string ("overlay-arrow-bitmap");
 -  staticpro (&Qoverlay_arrow_bitmap);
 +  DEFSYM (Qlast_arrow_position, "last-arrow-position");
 +  DEFSYM (Qlast_arrow_string, "last-arrow-string");
 +  DEFSYM (Qoverlay_arrow_string, "overlay-arrow-string");
 +  DEFSYM (Qoverlay_arrow_bitmap, "overlay-arrow-bitmap");
  
    echo_buffer[0] = echo_buffer[1] = Qnil;
    staticpro (&echo_buffer[0]);
    staticpro (&previous_help_echo_string);
    help_echo_pos = -1;
  
 -  Qright_to_left = intern_c_string ("right-to-left");
 -  staticpro (&Qright_to_left);
 -  Qleft_to_right = intern_c_string ("left-to-right");
 -  staticpro (&Qleft_to_right);
 +  DEFSYM (Qright_to_left, "right-to-left");
 +  DEFSYM (Qleft_to_right, "left-to-right");
  
  #ifdef HAVE_WINDOW_SYSTEM
    DEFVAR_BOOL ("x-stretch-cursor", x_stretch_cursor_p,
@@@ -27664,18 -27754,18 +27700,18 @@@ but does not change the fact they are i
    unibyte_display_via_language_environment = 0;
  
    DEFVAR_LISP ("max-mini-window-height", Vmax_mini_window_height,
 -    doc: /* *Maximum height for resizing mini-windows.
 +    doc: /* *Maximum height for resizing mini-windows (the minibuffer and the echo area).
  If a float, it specifies a fraction of the mini-window frame's height.
  If an integer, it specifies a number of lines.  */);
    Vmax_mini_window_height = make_float (0.25);
  
    DEFVAR_LISP ("resize-mini-windows", Vresize_mini_windows,
 -    doc: /* *How to resize mini-windows.
 +    doc: /* How to resize mini-windows (the minibuffer and the echo area).
  A value of nil means don't automatically resize mini-windows.
  A value of t means resize them to fit the text displayed in them.
 -A value of `grow-only', the default, means let mini-windows grow
 -only, until their display becomes empty, at which point the windows
 -go back to their normal size.  */);
 +A value of `grow-only', the default, means let mini-windows grow only;
 +they return to their normal size when the minibuffer is closed, or the
 +echo area becomes empty.  */);
    Vresize_mini_windows = Qgrow_only;
  
    DEFVAR_LISP ("blink-cursor-alist", Vblink_cursor_alist,
@@@ -27695,7 -27785,8 +27731,7 @@@ the frame's other specifications determ
  If non-nil, windows are automatically scrolled horizontally to make
  point visible.  */);
    automatic_hscrolling_p = 1;
 -  Qauto_hscroll_mode = intern_c_string ("auto-hscroll-mode");
 -  staticpro (&Qauto_hscroll_mode);
 +  DEFSYM (Qauto_hscroll_mode, "auto-hscroll-mode");
  
    DEFVAR_INT ("hscroll-margin", hscroll_margin,
      doc: /* *How many columns away from the window edge point is allowed to get
@@@ -27751,7 -27842,8 +27787,7 @@@ property
  
  To add a prefix to non-continuation lines, use `line-prefix'.  */);
    Vwrap_prefix = Qnil;
 -  staticpro (&Qwrap_prefix);
 -  Qwrap_prefix = intern_c_string ("wrap-prefix");
 +  DEFSYM (Qwrap_prefix, "wrap-prefix");
    Fmake_variable_buffer_local (Qwrap_prefix);
  
    DEFVAR_LISP ("line-prefix", Vline_prefix,
@@@ -27764,7 -27856,8 +27800,7 @@@ property
  
  To add a prefix to continuation lines, use `wrap-prefix'.  */);
    Vline_prefix = Qnil;
 -  staticpro (&Qline_prefix);
 -  Qline_prefix = intern_c_string ("line-prefix");
 +  DEFSYM (Qline_prefix, "line-prefix");
    Fmake_variable_buffer_local (Qline_prefix);
  
    DEFVAR_BOOL ("inhibit-eval-during-redisplay", inhibit_eval_during_redisplay,
@@@ -27857,27 -27950,31 +27893,27 @@@ Its value should be an ASCII acronym st
  void
  init_xdisp (void)
  {
 -  Lisp_Object root_window;
 -  struct window *mini_w;
 -
    current_header_line_height = current_mode_line_height = -1;
  
    CHARPOS (this_line_start_pos) = 0;
  
 -  mini_w = XWINDOW (minibuf_window);
 -  root_window = FRAME_ROOT_WINDOW (XFRAME (WINDOW_FRAME (mini_w)));
 -  echo_area_window = minibuf_window;
 -
    if (!noninteractive)
      {
 -      struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (root_window)));
 +      struct window *m = XWINDOW (minibuf_window);
 +      Lisp_Object frame = m->frame;
 +      struct frame *f = XFRAME (frame);
 +      Lisp_Object root = FRAME_ROOT_WINDOW (f);
 +      struct window *r = XWINDOW (root);
        int i;
  
 -      XWINDOW (root_window)->top_line = make_number (FRAME_TOP_MARGIN (f));
 -      set_window_height (root_window,
 -                       FRAME_LINES (f) - 1 - FRAME_TOP_MARGIN (f),
 -                       0);
 -      mini_w->top_line = make_number (FRAME_LINES (f) - 1);
 -      set_window_height (minibuf_window, 1, 0);
 +      echo_area_window = minibuf_window;
  
 -      XWINDOW (root_window)->total_cols = make_number (FRAME_COLS (f));
 -      mini_w->total_cols = make_number (FRAME_COLS (f));
 +      XSETFASTINT (r->top_line, FRAME_TOP_MARGIN (f));
 +      XSETFASTINT (r->total_lines, FRAME_LINES (f) - 1 - FRAME_TOP_MARGIN (f));
 +      XSETFASTINT (r->total_cols, FRAME_COLS (f));
 +      XSETFASTINT (m->top_line, FRAME_LINES (f) - 1);
 +      XSETFASTINT (m->total_lines, 1);
 +      XSETFASTINT (m->total_cols, FRAME_COLS (f));
  
        scratch_glyph_row.glyphs[TEXT_AREA] = scratch_glyphs;
        scratch_glyph_row.glyphs[TEXT_AREA + 1]