Fix bugs in file timestamp newness comparisons.
[bpt/emacs.git] / src / ChangeLog
index d392dd5..5433c2f 100644 (file)
@@ -1,3 +1,846 @@
+2012-07-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Fix bugs in file timestamp newness comparisons.
+       * fileio.c (Ffile_newer_than_file_p):
+       * lread.c (Fload): Use full timestamp resolution of files,
+       not just the 1-second resolution, so that files that are only
+       slightly newer still count as newer.
+       * fileio.c (Ffile_newer_than_file_p): Don't assume file
+       timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
+
+2012-07-03  Paul Eggert  <eggert@cs.ucla.edu>
+
+
+       * fileio.c: Improve handling of file time marker.  (Bug#11852)
+       (special_mtime): New function.
+       (Finsert_file_contents, Fverify_visited_file_modtime):
+       Use it to set special mtime values consistently.
+
+2012-07-03  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * fileio.c (Finsert_file_contents): Properly handle st_mtime
+       marker for non-existing file.  (Bug#11852)
+
+2012-07-03  Glenn Morris  <rgm@gnu.org>
+
+       * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
+       and did not make it into globals.h).
+
+2012-07-03  Tom Tromey  <tromey@redhat.com>
+
+       * window.c (Fset_window_margins, Fset_window_fringes)
+       (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
+       * textprop.c (Fprevious_property_change): No longer static.
+       * syntax.c (Fsyntax_table_p): No longer static.
+       * process.c (Fget_process, Fprocess_datagram_address): No longer
+       static.
+       * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
+       * keyboard.c (Fcommand_execute): No longer static.
+       Remove EXFUN.
+       * insdel.c (Fcombine_after_change_execute): No longer static.
+       * image.c (Finit_image_library): No longer static.
+       * fileio.c (Fmake_symbolic_link): No longer static.
+       * eval.c (Ffetch_bytecode): No longer static.
+       * editfns.c (Fuser_full_name): No longer static.
+       * doc.c: (Fdocumentation_property, Fsnarf_documentation): No
+       longer static.
+       * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
+       static.
+       * dired.c (Ffile_attributes): No longer static.
+       * composite.c (Fcomposition_get_gstring): No longer static.
+       * callproc.c (Fgetenv_internal): No longer static.
+
+       * ccl.h: Remove EXFUNs.
+       * buffer.h: Remove EXFUNs.
+       * dispextern.h: Remove EXFUNs.
+       * intervals.h: Remove EXFUNs.
+       * fontset.h: Remove EXFUN.
+       * font.h: Remove EXFUNs.
+       * dosfns.c (system_process_attributes): Remove EXFUN.
+       * keymap.h: Remove EXFUNs.
+       * lisp.h: Remove EXFUNs.
+       * w32term.h: Remove EXFUNs.
+       * window.h: Remove EXFUNs.
+       * xsettings.h: Remove EXFUN.
+       * xterm.h: Remove EXFUN.
+
+2012-07-03  Glenn Morris  <rgm@gnu.org>
+
+       * lisp.h (Frandom): Make it visible to C.
+       * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
+       buffer for invisible buffers.  (Bug#1229)
+
+2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
+       values which aren't power of 2.
+       * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.  Verify
+       it's value and the value of VECTOR_BLOCK_SIZE.  Adjust users
+       accordingly.
+
+2012-07-03  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
+
+       * alloc.c (mark_object): Revert part of last patch to use `switch'.
+
+2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c (allocate_vector_block): Remove redundant
+       calls to mallopt if DOUG_LEA_MALLOC is defined.
+       (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
+       avoid calls to mallopt if zero_vector is returned.
+
+2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
+       is enabled, avoid dereferencing NULL current_sblock if
+       running undumped.
+
+2012-07-03  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Cleanup basic buffer management.
+       * buffer.h (struct buffer): Change layout to use generic vector
+       marking code.  Fix some comments.  Change type of 'clip_changed'
+       to bitfield.  Remove unused #ifndef old.
+       (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
+       (GET_OVERLAYS_AT): Fix indentation.
+       (for_each_per_buffer_object_at): New macro.
+       * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
+       (Fbuffer_local_variables): Use it.
+       (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
+       * alloc.c (allocate_buffer): Adjust to match new layout of
+       struct buffer.  Fix comment.
+       (mark_overlay): New function.
+       (mark_buffer): Use it.  Use mark_vectorlike to mark normal
+       Lisp area of struct buffer.
+       (mark_object): Use it.  Adjust marking of misc objects
+       and related comments.
+
+2012-07-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
+       wrapper that is not needed because the wrapped code is a no-op (zero
+       machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
+       This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
+
+2012-07-02  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c (mark_buffer): Simplify.  Remove prototype.
+       (mark_object): Add comment.  Reorganize marking of vector-like
+       objects.  Use CHECK_LIVE for all vector-like objects except buffers
+       and subroutines when GC_CHECK_MARKED_OBJECTS is defined.  Avoid
+       redundant calls to mark_vectorlike for bool vectors.
+
+2012-06-30  Glenn Morris  <rgm@gnu.org>
+
+       * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
+
+       * epaths.in (PATH_SITELOADSEARCH): New.
+       * lread.c (init_lread): Use PATH_SITELOADSEARCH.
+       This is rather than relying on --enable-locallisppath elements
+       having "site-lisp" in their names.  (Bug#10208#25, 11658)
+
+2012-06-30  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32proc.c (sys_select): Accept and ignore one more argument.
+
+       * w32.c (emacs_gnutls_pull): Call select with one more argument.
+
+       * sysselect.h [DOS_NT]: Don't include sys/select.h.
+       (pselect) [!MS_DOS]: Redirect to sys_select.
+
+       * sysdep.c: Don't include dos.h and dosfns.h.
+
+       * process.c (sys_select):
+       * msdos.c (sys_select): Accept one more argument and ignore it.
+
+       * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
+       adapt data types and code to that.
+
+       * dosfns.c:
+       * msdos.c (gettime, settime): Define away the prototypes in dos.h,
+       which clashes with the gnulib function of the same name.
+
+2012-06-30  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * font.c (font_style_to_value, font_style_symbolic)
+       (font_prop_validate_style): Add type checks for values in
+       font_style_table.
+
+       * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
+       argument.
+       * character.c, charset.c, menu.c, process.c, window.c: Adjust all
+       uses.
+
+2012-06-29  Eli Zaretskii  <eliz@gnu.org>
+
+       * xdisp.c (try_window_id): Undo last change.
+
+       * w32.c (getwd): Adjust commentary about startup_dir.
+       (init_environment): Always call sys_access, even in non-MSVC
+       builds.  Don't chdir to the directory of the Emacs executable.
+       This undoes code from 1997 which was justified by the need to
+       "avoid conflicts when removing and renaming directories".  But its
+       downside was that every relative file name was being interpreted
+       relative to the directory of the Emacs executable, which can never
+       be TRT.  In particular, it broke sys_access when called with
+       relative file names.
+       (sys_access): Map GetLastError to errno.
+
+2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * window.h (struct window): Change type of 'fringes_outside_margins'
+       to bitfield.  Fix comment.  Adjust users accordingly.
+       (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
+       Adjust comment.
+       * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
+       to ptrdiff_t.
+
+2012-06-29  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * gnutls.c (emacs_gnutls_handshake):
+       Add QUIT to make the loop interruptible.
+
+2012-06-29  Glenn Morris  <rgm@gnu.org>
+
+       * charset.c (init_charset): Make lack of etc/charsets fatal.
+
+2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * editfns.c (region_limit): Fix type mismatch.
+
+2012-06-29  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
+       undefined.  Convert from xassert to eassert.
+       * nsmenu.m: Convert from xassert to eassert.
+       * nsterm.m: Likewise.
+
+2012-06-28  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * editfns.c (region_limit): Clip to narrowing (bug#11770).
+
+2012-06-28  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Avoid integer overflow on scroll-left and scroll-right.
+       * window.c (HSCROLL_MAX): New macro.
+       (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
+       overflow when requested scroll falls outside ptrdiff_t range.
+
+2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * window.h (struct window): Change type of 'hscroll',
+       'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
+       'last_modified' and 'last_overlay_modified' to EMACS_INT.
+       Adjust users accordingly.
+       * xdisp.c (try_cursor_movement): Replace type check with eassert.
+       * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
+       from EMACS_INT to ptrdiff_t.
+       (make_window): Omit redundant initialization.
+
+2012-06-28  Juanma Barranquero  <lekktu@gmail.com>
+
+       * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
+
+2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * window.h (struct window): Change type of 'use_time' and
+       'sequence_number' from Lisp_Object to int.
+       * frame.c (make_frame): Adjust users accordingly.
+       * print.c (print_object): Likewise.
+       * window.c (select_window, Fwindow_use_time, make_parent_window)
+       (make_window): Likewise.
+
+2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
+       enabled with --enable-checking=[all,glyphs] configure option.
+       Fix GLYPH_DEBUG usage assuming that it may be undefined,
+       adjust comments accordingly.
+       * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
+       undefined, adjust comments accordingly.
+       * image.c: Likewise.
+       * scroll.c: Likewise.
+       * w32fns.c: Likewise.
+       * w32term.c: Likewise.
+       * xdisp.c: Likewise.
+       * xfaces.c: Likewise.
+       * xfns.c: Likewise.
+       * xterm.c: Likewise.
+
+2012-06-28  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Generalize run-time debugging checks.
+       * dispextern.h (XASSERTS): Remove.
+       * fontset.c (xassert): Remove.
+       Convert from xassert to eassert.
+       * alloc.c: Convert from xassert to eassert.
+       * bidi.c: Likewise.
+       * dispnew.c: Likewise.
+       * fns.c: Likewise.
+       * fringe.c: Likewise.
+       * ftfont.c: Likewise.
+       * gtkutil.c: Likewise.
+       * image.c: Likewise.
+       * keyboard.c: Likewise.
+       * menu.c: Likewise.
+       * process.c: Likewise.
+       * scroll.c: Likewise.
+       * sound.c: Likewise.
+       * term.c: Likewise.
+       * w32console.c: Likewise.
+       * w32fns.c: Likewise.
+       * w32term.c: Likewise.
+       * window.c: Likewise.
+       * xdisp.c: Likewise.
+       * xfaces.c: Likewise.
+       * xfns.c: Likewise.
+       * xselect.c: Likewise.
+       * xterm.c: Likewise.
+
+2012-06-27  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * fns.c (maybe_resize_hash_table): Output message when growing the
+       purify-hashtable.
+
+2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c (allocate_string_data): Remove dead code.
+       * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
+       avoid GCC warning about unused macro.
+
+2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c (allocate_string): Omit intervals initialization.
+       * alloc.c (make_uninit_multibyte_string): Initialize intervals
+       as in make_pure_string and make_pure_c_string.
+
+2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c (allocate_string):  Fix last change.
+
+2012-06-27  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c (allocate_string):  Remove two redundant calls
+       to memset, add explicit initialization where appropriate.
+
+2012-06-27  Glenn Morris  <rgm@gnu.org>
+
+       * lisp.mk (lisp): Remove paths.elc.
+
+2012-06-27  Chong Yidong  <cyd@gnu.org>
+
+       * doc.c (Fsubstitute_command_keys): Fix punctuation.
+
+2012-06-26  John Wiegley  <johnw@newartisans.com>
+
+       * unexmacosx.c (copy_data_segment): Add two section names used
+       on Mac OS X Lion: __mod_init_func and __mod_term_func.
+
+       * alloc.c (mark_memory): Do not check with -faddress-sanitizer
+       when building with Clang.
+
+2012-06-26  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * eval.c (Fapply): Allow calling it with a single argument.
+
+2012-06-26  Eli Zaretskii  <eliz@gnu.org>
+
+       * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
+       _stricmp and _strnicmp.
+       (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
+
+2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c (allocate_window): Zero out non-Lisp part of newly
+       allocated window.
+       (allocate_process): Likewise for new process.
+       (allocate_terminal): Change to use offsetof.
+       (allocate_frame): Likewise.
+       * frame.c (make_frame): Omit redundant initialization.
+       * window.c (make_parent_window): Use memset.
+       (make_window): Omit redundant initialization.
+       * process.c (make_process): Omit redundant initialization.
+       * terminal.c (create_terminal): Likewise.
+
+2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * term.c (delete_tty): Remove redundant call to memset.
+
+2012-06-26  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c: Remove build_string.
+       * lisp.h: Define build_string as static inline.  This provides
+       a better opportunity to optimize away calls to strlen when the
+       function is called with compile-time constant argument.
+       * image.c (imagemagick_error): Convert to build_string.
+       * w32proc.c (sys_spawnve): Likewise.
+       * xterm.c (x_term_init): Likewise.
+
+2012-06-26  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Use sprintf return value instead of invoking strlen on result.
+       In the old days this wasn't portable, since some sprintf
+       implementations returned char *.  But they died out years ago and
+       Emacs already assumes sprintf returns int.
+       Similarly for float_to_string.
+       This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
+       * ccl.c (ccl_driver):
+       * character.c (string_escape_byte8):
+       * data.c (Fnumber_to_string):
+       * doprnt.c (doprnt):
+       * print.c (print_object):
+       * xdisp.c (message_dolog):
+       * xfns.c (syms_of_xfns):
+       Use sprintf or float_to_string result to avoid need to call strlen.
+       * data.c (Fnumber_to_string):
+       Use make_unibyte_string, since the string must be ASCII.
+       * lisp.h, print.c (float_to_string): Now returns int length.
+       * term.c (produce_glyphless_glyph):
+       Use sprintf result rather than recomputing it.
+
+       Clean out last vestiges of the old HAVE_CONFIG_H stuff.
+       * Makefile.in (ALL_CFLAGS):
+       * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
+       * gmalloc.c, regex.c: Include <config.h> unconditionally.
+
+2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * dispextern.h (xstrcasecmp): Define to library function
+       strcasecmp if available.
+       * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
+
+2012-06-25  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
+       Avoid comma operator.
+       * menu.c (push_submenu_start, push_submenu_end)
+       (push_left_right_boundary, push_menu_pane): Likewise.
+       * msdos.c (dos_rawgetc): Likewise.
+
+2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * xfns.c (xic_create_fontsetname): Remove redundant calls
+       to memset.
+
+2012-06-25  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * gtkutil.c (get_utf8_string): Remove redundant assignment.
+       sprintf already null-terminates its output.
+
+       * xfns.c (x_window): Remove redundant cast.
+
+2012-06-25  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
+       `const char *' to `char *' to avoid compiler warning.
+
+2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
+       instead of truncating it to 63 (admittedly a generous limit).
+
+       * process.c: Fix spelling and caps in comments.
+
+2012-06-24  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       * emacs.c (setpgrp): Remove definition, unused.
+       * sysdep.c (setpgrp): Remove definition, not used in this file.
+
+2012-06-24  Juanma Barranquero  <lekktu@gmail.com>
+
+       * makefile.w32-in: Update dependencies.
+
+2012-06-24  Eli Zaretskii  <eliz@gnu.org>
+
+       * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
+       (SYSTIME_H): Add nt/inc/sys/time.h.
+
+       * systime.h [WINDOWSNT]: Include sys/time.h.
+
+       * s/ms-w32.h (struct timespec): Definition moved from
+       nt/inc/sys/time.h.  Suggested by Paul Eggert <eggert@cs.ucla.edu>.
+
+2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
+       * buffer.h (buffer_slot_type_mismatch):
+       * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
+       * eval.c (unwind_to_catch):
+       * image.c (my_png_error, my_error_exit):
+       * keyboard.c (quit_throw_to_read_char, user_error)
+       (Fexit_recursive_edit, Fabort_recursive_edit):
+       * lisp.h (die, args_out_of_range, args_out_of_range_3)
+       (wrong_type_argument, buffer_overflow, __executable_start)
+       (memory_full, buffer_memory_full, string_overflow, Fthrow)
+       (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
+       (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
+       (fatal):
+       (child_setup) [!DOS_NT]:
+       * lread.c (end_of_file_error, invalid_syntax):
+       * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
+       * puresize.h (pure_write_error):
+       * search.c (matcher_overflow):
+       * sound.c (sound_perror, alsa_sound_perror):
+       * sysdep.c, syssignal.h (croak):
+       * term.c (maybe_fatal, vfatal):
+       * textprop.c (text_read_only):
+       * undo.c (user_error):
+       * unexmacosx.c (unexec_error):
+       * xterm.c (x_ins_del_lines, x_delete_glyphs):
+       Use _Noreturn rather than NO_RETURN.
+       No need for separate decl merely because of _Noreturn.
+       * sound.c (sound_warning, parse_sound):
+       Remove unnecessary forward decls.
+
+2012-06-24  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
+       * lisp.h (WAIT_READING_MAX): New macro.
+       * dispnew.c (Fsleep_for, sit_for):
+       * keyboard.c (kbd_buffer_get_event):
+       * process.c (Faccept_process_output):
+       Use it to avoid bogus compiler warnings with obsolescent GCC versions.
+       This improves on the previous patch, which introduced a bug
+       when time_t is unsigned and as wide as intmax_t.
+       See <http://bugs.gnu.org/9000#51>.
+
+2012-06-23  Eli Zaretskii  <eliz@gnu.org>
+
+       * dispnew.c (sit_for, Fsleep_for):
+       * keyboard.c (kbd_buffer_get_event):
+       * process.c (Faccept_process_output): Avoid compiler warnings when
+       comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
+
+2012-06-23  Juanma Barranquero  <lekktu@gmail.com>
+
+       * makefile.w32-in: Update dependencies.
+
+       * w32.c (ltime): Add return type and declare static.
+       (w32_get_internal_run_time): Remove usused variable `time_100ns'.
+
+2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
+       Privately reported by Herbert J. Skuhra.
+       (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
+       All uses changed.
+       (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
+       not make_lisp_timeval, when the argument is of type EMACS_TIME.
+
+2012-06-23  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
+       last argument of make_unibyte_string.
+
+       * keyboard.c (kbd_buffer_get_event): Include the codepage and the
+       language ID in the event parameters.
+
+       * w32term.c (w32_read_socket): Put the new keyboard codepage into
+       event.code, not the obscure "character set ID".
+
+2012-06-23  Chong Yidong  <cyd@gnu.org>
+
+       * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
+
+2012-06-23  Eli Zaretskii  <eliz@gnu.org>
+
+       Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
+       * w32.c (fdutimens): New function.
+
+       * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
+
+       * s/ms-w32.h (pselect): Redirect to sys_select.
+
+       * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
+
+       * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
+       in the logic of incrementing and decrementing the value of
+       use_relocatable_buffers.
+
+2012-06-23  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
+       Privately reported by Herbert J. Skuhra.
+       [__FreeBSD__]: Remove "*/" typo after "#include".
+       (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
+       (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
+       (TIMEVAL, system_process_attributes) [__FreeBSD__]:
+       Don't assume EMACS_TIME and struct timeval are the same type.
+
+2012-06-22  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Support higher-resolution time stamps (Bug#9000).
+       The time stamps are only nanosecond-resolution at the C level,
+       since that's the best that any real-world system supports now.
+       But they are picosecond-resolution at the Lisp level, as that's
+       easy, and leaves room for future OS improvements.
+
+       * Makefile.in (LIB_CLOCK_GETTIME): New macro.
+       (LIBES): Use it.
+
+       * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
+       Don't get current time unless it's needed.
+
+       * atimer.c: Include <sys/time.h> unconditionally, since gnulib
+       now provides it if it's absent.
+       (start_atimer): Port to higher-res time stamps.
+       Check for time stamp overflow.  Don't get current time more
+       often than is needed.
+
+       * buffer.h (struct buffer): Buffer modtime now has high resolution.
+       Include systime.h, not time.h.
+       (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
+
+       * dired.c: Include stat-time.h.
+       (Ffile-attributes): File times now have higher resolution.
+
+       * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
+       (struct image): Timestamp now has higher resolution.
+
+       * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
+       has at least microseconds now.  All uses removed.
+       (update_frame, update_single_window, update_window, update_frame_1)
+       (Fsleep_for, sit_for): Port to higher-resolution time stamps.
+
+       * editfns.c (time_overflow): Now extern.
+       (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
+       (float-time, Fformat_time_string, Fcurrent_time_string)
+       (Fcurrent_time_zone): Accept and generate higher-resolution
+       time stamps.
+       (make_time_tail, make_lisp_time, dissassemble_lisp_time)
+       (decode_time_components, lisp_seconds_argument): New functions.
+       (make_time): Now static.
+       (lisp_time_argument): Now returns EMACS_TIME.  New arg ppsec.
+       Report an error if the time is invalid, rather than having the caller
+       do that.
+
+       * fileio.c: Include <stat-time.h>
+       (Fcopy_file): Copy higher-resolution time stamps.
+       Prefer to set the time stamp via a file descriptor if that works.
+       (Fset_file_times, Finsert_file_contents, Fwrite_region)
+       (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
+       (Fvisited_file_modtime, Fset_visited_file_modtime):
+       Support higher-resolution time stamps.
+
+       * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
+
+       * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
+
+       * image.c (prepare_image_for_display, clear_image_cache)
+       (lookup_image): Port to higer-resolution time stamps.
+
+       * keyboard.c (start_polling, bind_polling_period):
+       Check for time stamp overflow.
+       (read_char, kbd_buffer_get_event, timer_start_idle)
+       (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
+       (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
+       Port to higher-resolution time stamps.  Do not assume time_t is signed.
+       (decode_timer): New function.  Timers are now vectors of length 9,
+       not 8, to accommodate the picosecond component.
+       (timer_check_2): Use it.
+
+       * nsterm.m (select_timeout, timeval_subtract): Remove.
+       (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
+       as they're a bit more accurate and handle overflow better.
+       (ns_select): Change prototype to be compatible with pselect.
+       (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
+       * nsterm.h (ns_select): Adjust prototype.
+
+       * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
+       us-resolution time stamps.
+       (sys_select): Use the new EMACS_TIME_SIGN macro instead.
+
+       * lread.c (read_filtered_event): Port to ns-resolution time stamps.
+
+       * lisp.h (time_overflow): New decl.
+       (wait_reading_process_output): First arg is now intmax_t, not int,
+       to accommodate larger waits.
+
+       * process.h (struct Lisp_Process.read_output_delay):
+       Now counts nanoseconds, not microseconds.
+       * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
+       EMACS_HAS_USECS.
+       (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
+       (wait_reading_process_output):
+       Port to ns-resolution time stamps.
+       (Faccept_process_output, wait_reading_process_output):
+       Check for time stamp overflow.  Do not assume time_t is signed.
+       (select_wrapper): Remove; we now use pselect.
+       (Fprocess_attributes): Now generates ns-resolution time stamps.
+
+       * sysdep.c: Include utimens.h.  Don't include utime.h
+       or worry about struct utimbuf; gnulib does that for us now.
+       (gettimeofday): Remove; gnulib provides a substitute.
+       (make_timeval): New function.
+       (set_file_times): Now sets ns-resolution time stamps.
+       New arg FD; all uses changed.
+       (time_from_jiffies, ltime_from_jiffies, get_up_time)
+       (system_process_attributes):
+       Now returns ns-resolution time stamp.  All uses changed.
+       Check for time stamp overflow.
+
+       * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
+       provides a substitute now.
+
+       * systime.h: Include timespec.h rather than sys/time.h and time.h,
+       since it guarantees struct timespec.
+       (EMACS_TIME): Now struct timespec, so that we can support
+       ns-resolution time stamps.
+       (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
+       (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
+       (EMACS_USECS): Remove.
+       (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
+       so multiply the arg by 1000 before storing it.
+       (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
+       New macros.
+       (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
+       Port to ns-resolution time stamps.
+       (EMACS_TIME_NEG_P): Remove; replaced by....
+       (EMACS_TIME_SIGN): New macro.
+       (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
+       (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
+       (set_file_times, make_time, lisp_time_argument): Adjust signature.
+       (make_timeval, make_lisp_time, decode_time_components): New decls.
+       (EMACS_TIME_CMP): Remove; no longer used.  Plus, it was buggy, in
+       that it mishandled time_t overflow.  You can't compare by subtracting!
+       (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
+       (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
+
+       * term.c: Include <sys/time.h>.
+       (timeval_to_Time): New function, for proper overflow wraparound.
+       (term_mouse_position, term_mouse_click): Use it.
+
+       * undo.c (record_first_change): Support higher-resolution time stamps
+       in the undo buffer.
+       (Fprimitive_undo): Use them when restoring time stamps.
+
+       * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
+       (w32_get_internal_run_time):
+       Port to higher-resolution Emacs time stamps.
+       (ltime): Now accepts single 64-bit integer, as that's more convenient
+       for callers.
+
+       * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
+
+       * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
+       for compatibility with pselect.  Support ns-resolution time stamps.
+
+       * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
+
+       * xselect.c (wait_for_property_change, x_get_foreign_selection):
+       Check for time stamp overflow, and support ns-resolution time stamps.
+
+       * xterm.c: Don't include sys/time.h; gnulib does that for us now.
+       Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
+       (timeval_subtract): Remove; no longer needed.
+       (XTflash, XTring_bell, x_wait_for_event):
+       Port to ns-resolution time stamps.  Don't assume time_t is signed.
+
+2012-06-22  Chong Yidong  <cyd@gnu.org>
+
+       * xdisp.c (x_consider_frame_title): Revert last change.
+
+2012-06-22  Eli Zaretskii  <eliz@gnu.org>
+
+       * alloc.c (NSTATICS): Enlarge to 0x650.  Otherwise, Emacs compiled
+       with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
+       aborts in staticpro during startup.  (Without -DBYTE_CODE_METER,
+       staticidx goes up to 1597 out of 1600 = 0x640.)
+
+2012-06-20  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
+       Otherwise, the umask might be mistakenly 0 while handling input signals.
+
+2012-06-19  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * minibuf.c (Fread_string): Bind minibuffer-completion-table.
+
+2012-06-19  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
+       * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
+       * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
+       access to `contents' member of Lisp_Vector objects with AREF and ASET
+       where appropriate.
+
+2012-06-19  Chong Yidong  <cyd@gnu.org>
+
+       * frame.c (delete_frame): When selecting a frame on a different
+       text terminal, do not alter the terminal's top-frame.
+
+       * xdisp.c (format_mode_line_unwind_data): Record the target
+       frame's selected window and its terminal's top-frame.
+       (unwind_format_mode_line): Restore them.
+       (x_consider_frame_title, display_mode_line, Fformat_mode_line):
+       Callers changed.
+       (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
+       since tty frames can be explicitly named.
+       (prepare_menu_bars): Likewise.
+
+       * term.c (Ftty_top_frame): New function.
+
+2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Port byte-code-meter to modern targets.
+       * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
+       !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG.  Problem with
+       CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
+       <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
+       (METER_1, METER_2): Simplify.
+
+2012-06-18  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * data.c (Fdefalias): Return `symbol' (bug#11686).
+
+2012-06-18  Martin Rudalics  <rudalics@gmx.at>
+
+       * buffer.c (Fkill_buffer): Don't throw an error when the buffer
+       gets killed during executing of this function (Bug#11665).
+       Try to always return Qt when the buffer has been actually killed.
+       (Vkill_buffer_query_functions): In doc-string say that functions
+       run by this hook should not change the current buffer.
+
+2012-06-18  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Fix recently-introduced process.c problems found by static checking.
+       * process.c (write_queue_push, write_queue_pop, send_process):
+       Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
+       (write_queue_pop): Fix pointer signedness problem.
+       (send_process): Remove unused local.
+
+2012-06-17  Chong Yidong  <cyd@gnu.org>
+
+       * xdisp.c (redisplay_internal): No need to redisplay terminal
+       frames that are not on top.
+
+2012-06-17  Troels Nielsen  <bn.troels@gmail.com>
+
+       * process.c (make_process): Initialize write_queue.
+       (write_queue_push, write_queue_pop): New functions.
+       (send_process): Use them to maintain correct ordering of process
+       writes (Bug#10815).
+
+2012-06-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * lisp.h (eassert): Assume C89 or later.
+       This removes the need for CHECK.
+       (CHECK): Remove.  Its comments about always evaluating its
+       argument were confusing, as 'eassert' typically does not evaluate
+       its argument.
+
+       * coding.c (produce_chars): Use ptrdiff_t, not int.
+
+       * xterm.c (x_draw_underwave): Check for integer overflow.
+       This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
+
+2012-06-17  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
+       referenced (Bug#11583).
+
 2012-06-16  Aurelien Aptel  <aurelien.aptel@gmail.com>
 
        Implement wave-style variant of underlining.
        (x_draw_glyph_string): Use them.
        * xfaces.c (Qline, Qwave): New Lisp objects.
        (check_lface_attrs, merge_face_ref)
-       (Finternal_set_lisp_face_attribute, realize_x_face): Handle
-       wave-style underline face attributes.
+       (Finternal_set_lisp_face_attribute, realize_x_face):
+       Handle wave-style underline face attributes.
        * xterm.c (x_draw_underwave): New function.
        (x_draw_glyph_string): Use it.
 
 
 2012-06-16  Eli Zaretskii  <eliz@gnu.org>
 
-       * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.  If
-       all the glyphs of the glyph row came from strings, and we have no
+       * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
+       If all the glyphs of the glyph row came from strings, and we have no
        cursor positioning clues, put the cursor on the first glyph of the
        row.
        (handle_face_prop): Use chunk-relative overlay string index when
        Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
        (INTTYPEBITS): New macro, for clarity.
        (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
-       (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P): Simplify
-       now that USE_LSB_TAG is always defined.
+       (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
+       Simplify now that USE_LSB_TAG is always defined.
        (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
        (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
 
        * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
        instead of union.
        (XLI, XIL): Define.
-       (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG): Use
-       them.
-       * emacs.c (gdb_use_struct): Renamed from gdb_use_union.
+       (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
+       Use them.
+       * emacs.c (gdb_use_struct): Rename from gdb_use_union.
        * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
-       * alloc.c (widen_to_Lisp_Object): Removed.
+       * alloc.c (widen_to_Lisp_Object): Remove.
        (mark_memory): Use XIL instead of widen_to_Lisp_Object.
        * frame.c (delete_frame): Remove outdated comment.
        * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking