Fix bug #13661 with w32-downcase-file-names and shell-command.
[bpt/emacs.git] / src / ChangeLog
index 289aed3..35e313c 100644 (file)
@@ -1,3 +1,555 @@
+2013-02-09  Eli Zaretskii  <eliz@gnu.org>
+
+       * callproc.c (Fcall_process_region): Make sure the XXXXXX part of
+       the temporary file pattern is not downcased even when
+       w32-downcase-file-names is non-nil.  (Bug#13661)
+
+       * xdisp.c (decode_mode_spec): Remove handling of %t.
+
+       * msdos.c (careadlinkatcwd): Remove.
+
+2013-02-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * lread.c (skip_dyn_bytes): New function (bug#12598).
+       (read1): Use it.  Use getc instead of READCHAR to read bytes.
+       (load_each_byte): Remove.  Update users.
+
+2013-02-08  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * search.c (scan_buffer): Calculate end byte position just once.
+       (scan_newline): Do not recalculate start_byte.
+       (search_command): Use eassert.
+       * syntax.c (struct lisp_parse_state): New member location_byte.
+       (scan_sexps_forward): Record from_byte and avoid redundant
+       character to byte position calculation ...
+       (Fparse_partial_sexp): ... here.  Break too long line.
+
+2013-02-08  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * lisp.h (make_uninit_vector): New function.
+       * alloc.c (Fvector, Fmake_byte_code):
+       * ccl.c (Fregister_ccl_program):
+       * charset.c (Fdefine_charset_internal, define_charset_internal):
+       * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
+       * composite.c (syms_of_composite):
+       * font.c (Fquery_font, Ffont_info, syms_of_font):
+       * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
+       * ftfont.c (ftfont_shape_by_flt):
+       * indent.c (recompute_width_table):
+       * nsselect.m (clean_local_selection_data):
+       * syntax.c (init_syntax_once):
+       * w32unsubscribe.c (uniscribe_shape):
+       * window.c (Fcurrent_window_configuration):
+       * xfaces.c (Fx_family_fonts):
+       * xselect.c (selection_data_to_lisp_data): Use it.
+
+2013-02-07  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * coding.c (Fdefine_coding_system_internal): Use AREF where
+       argument is known to be a vector.
+       * fns.c (Flocale_info): Likewise for ASET.
+       * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
+       * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
+
+2013-02-05  Jan Djärv  <jan.h.d@swipnet.se>
+
+       * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
+       height.
+
+       * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
+       (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
+       updateCollectionBehaviour.
+
+       * nsterm.m (NEW_STYLE_FS): Remove.
+       (ns_last_use_native_fullscreen): New variable.
+       (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
+       (x_set_window_size): Do not take title bar and tool bar into account
+       if isFullscreen returns YES.
+       (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
+       (check_native_fs): New function.
+       (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
+       (ns_term_init): Remove NEW_STYLE_FS.
+       (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
+       and tool bar if isFullscreen returns NO.
+       (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
+       (initFrameFromEmacs:): Initialize fs_is_native.  Replace NEW_STYLE_FS
+       with HAVE_NATIVE_FS.
+       (window:willUseFullScreenPresentationOptions:): New method.
+       (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
+       Hide toolbar if not enabled (Bug#13444).
+       (windowDidExitFullScreen:): Call updateCollectionBehaviour.
+       Restore tool bar if enabled, hide it otherwise (Bug#13444).
+       (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
+       (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
+       window.  Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
+       Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
+       FRAME_TOOLBAR_HEIGHT (f).  Call updateFrameSize when going non-fs.
+       (syms_of_nsterm): Add ns-use-native-fullscreen.
+
+2013-02-04  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * fileio.c (Qchoose_write_coding_system): Now static.
+
+2013-02-04  Eli Zaretskii  <eliz@gnu.org>
+
+       * xdisp.c (window_buffer_changed): region_showing can be negative,
+       which still means region is being displayed.
+       (redisplay_internal): Resurrect code that forced redisplay of the
+       whole window when showing region and the mark has changed.  Record
+       the new mark position to allow redisplay optimizations.
+       (display_line): If it->region_beg_charpos is non-zero, set the
+       window's region_showing member to -1.  (Bug#13623)  (Bug#13626)
+
+       * window.h (struct window) <region_showing>: Declare ptrdiff_t,
+       not bitfield of 1 bit.
+
+2013-02-03  Daniel Colascione  <dancol@dancol.org>
+
+       * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
+       daemon mode works on cygw32 when Emacs is installed and not just
+       during development.
+
+2013-02-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Avoid file time stamp bug on MS-Windows (Bug#13149).
+       * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
+       as FAT32 doesn't update time stamps when truncating them.
+       Also, check that a file time stamp is not a multiple of 100 ns;
+       this should catch all instances of the problem on MS-Windows,
+       as its native file system resolution is 100 ns or worse, and
+       checking for a non-multiple of 100 ns should impose only a small
+       overhead on systems with ns resolution.
+
+2013-02-02  Eli Zaretskii  <eliz@gnu.org>
+
+       Avoid encoding file names on MS-Windows when they need to be run
+       through dostounix_filename.
+       * w32.c (normalize_filename): Accept an additional argument
+       MULTIBYTE; if non-zero, traverse the file name by bytes and don't
+       downcase it even if w32-downcase-file-names is non-nil.
+       (dostounix_filename): Accept an additional argument MULTIBYTE and
+       pass it to normalize_filename.
+       (emacs_root_dir): Adjust.
+
+       * msdos.h (dostounix_filename): Adjust prototype.
+
+       * w32.h (dostounix_filename): Adjust prototype.
+
+       * msdos.c (dostounix_filename): Accept an additional argument and
+       ignore it.
+       (init_environment): Adjust callers of dostounix_filename.
+
+       * fileio.c (Ffile_name_directory, file_name_as_directory)
+       (directory_file_name, Fexpand_file_name)
+       (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
+       dostounix_filename.
+       [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
+       non-nil.
+       (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
+       variables, as egetenv is case-insensitive for DOS_NT.
+
+       * dired.c (file_name_completion): Don't call Fdirectory_file_name
+       with an encoded file name.
+
+       * w32proc.c (Fw32_short_file_name, Fw32_long_file_name): Adjust
+       calls to dostounix_filename.
+
+       * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
+
+       * unexw32.c (unexec): Adjust call to dostounix_filename.
+
+       * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
+
+       * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
+       dostounix_filename.
+
+       * callproc.c (Fcall_process) [MSDOS]: Adjust call to
+       dostounix_filename.
+
+       * callproc.c (Fcall_process): Make sure program name in PATH and
+       new_argv[0] is encoded, if needed.  Otherwise, un-encoded string
+       is passed to exec/spawnve, which fails unless the file-name
+       encoding is UTF-8.
+
+       * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
+       even if w32-quote-process-args is nil.
+
+2013-02-01  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Fix timestamp bug when write-region appends nothing (Bug#13149).
+       * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
+       the file's time stamp doesn't change if Emacs happens to write nothing
+       to the file, and on a buggy file system this could cause Emacs to
+       incorrectly infer that the file system doesn't have the bug.
+       Avoid this problem by inhibiting the inference in this case.
+
+2013-02-01  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * window.h (struct window): Convert base_line_number, base_line_pos
+       and column_number_displayed members from Lisp_Object to ptrdiff_t.
+       Convert region_showing member from Lisp_Object to bitfield.
+       Remove sequence_number member.  Adjust comments.
+       * window.c (sequence_number): Remove.
+       (make_window): Initialize column_number_displayed.
+       * print.c (print_object): Follow the printed representation of
+       frames and print window pointer to distinguish between windows.
+       (adjust_window_count): Invalidate base_line_pos.  Adjust comment.
+       * xdisp.c (wset_base_line_number, wset_base_line_pos)
+       (wset_column_number_displayed, wset_region_showing): Remove.
+       (window_buffer_changed, mode_line_update_needed, redisplay_internal)
+       (try_scrolling, try_cursor_movement, redisplay_window)
+       (try_window_reusing_current_matrix, try_window_id, display_line)
+       (display_mode_lines, decode_mode_spec): Adjust users.
+       * .gdbinit (pwinx): Do not print sequence_number.
+
+2013-02-01  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
+       * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
+       * dired.c: Include <fcntl.h>.
+       (open_directory): New function, which uses open and fdopendir
+       rather than opendir.  DOS_NT platforms still use opendir, though.
+       (directory_files_internal, file_name_completion): Use it.
+       (file_attributes): New function, with most of the old Ffile_attributes.
+       (directory_files_internal, Ffile_attributes): Use it.
+       (file_attributes, file_name_completion_stat): First arg is now fd,
+       not dir name.  All uses changed.  Use fstatat rather than lstat +
+       stat.
+       (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
+       * fileio.c: Include <allocator.h>, <careadlinkat.h>.
+       (emacs_readlinkat): New function, with much of the old
+       Ffile_symlink_p, but with an fd argument for speed.
+       It uses readlinkat rather than careadlinkatcwd, so that it
+       need not assume the working directory.
+       (Ffile_symlink_p): Use it.
+       * filelock.c (current_lock_owner): Use emacs_readlinkat
+       rather than emacs_readlink.
+       * lisp.h (emacs_readlinkat): New decl.
+       (READLINK_BUFSIZE, emacs_readlink): Remove.
+       * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
+       (emacs_norealloc_allocator, emacs_readlink): Remove.
+       This stuff is moved to fileio.c.
+       * w32.c (fstatat, readlinkat): New functions.
+       (careadlinkat): Don't check that fd == AT_FDCWD.
+       (careadlinkatcwd): Remove; no longer needed.
+
+2013-01-31  Glenn Morris  <rgm@gnu.org>
+
+       * fileio.c (choose_write_coding_system): Make it callable from Lisp.
+       (Fwrite_region): Update for new choose_write_coding_system args.
+       Move the last piece of choose_write_coding_system here.  (Bug#13522)
+       (syms_of_fileio): Add choose-write-coding-system.
+
+2013-01-30  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32.c (sys_open): Zero out the flags for the new file descriptor.
+       (sys_close): Zero out the flags for the file descriptor before
+       closing it.  (Bug#13546)
+
+       * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
+       (logon_network_drive, stat_worker, symlink, chase_symlinks): Use
+       CharNextExA and CharPrevExA to iterate over file names encoded in
+       DBCS.  (Bug#13553)
+
+       * w32.c (w32_get_long_filename, init_environment, readlink):
+       Support file names encoded in DBCS codepages.
+       (readlink): Use the current file-name-coding-system, not the ANSI
+       codepage, to decode and handle targets of symlinks.
+
+2013-01-28  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32.c (opendir): Now accepts a 'const char *'.
+
+2013-01-28  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Remove obsolete redisplay code.  See the discussion at
+       http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
+       * dispnew.c (preemption_period, preemption_next_check): Remove.
+       (Vredisplay_preemption_period): Likewise.
+       (update_frame, update_single_window, update_window, update_frame_1):
+       Adjust users.  Always assume that PERIODIC_PREEMPTION_CHECKING is not
+       used, following the 2012-06-22 change.
+
+2013-01-25  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32notify.c (Fw32notify_add_watch): Doc fix.  (Bug#13540)
+
+2013-01-25  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * font.c (num_fonts): Remove the leftover from old
+       debugging code.  Adjust comment style here and there.
+       * insdel.c (insert_1): Remove.
+       * lisp.h (insert_1): Remove prototype.
+       * xdisp.c (message_dolog): Adjust users to call insert_1_both.
+
+2013-01-25  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32.c (max_filename_mbslen): New function.
+       (normalize_filename, readdir): Use it to detect locales where ANSI
+       encoding of file names uses a double-byte character set (DBCS).
+       If a DBCS encoding is used, advance by characters using
+       CharNextExA, instead of incrementing a 'char *' pointer.  Use
+       _mbslwr instead of _strlwr.  (Bug#13515)
+
+       * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
+       request of memory reservation to 1.7GB.  (Bug#13065)
+
+2013-01-25  Andreas Schwab  <schwab@linux-m68k.org>
+
+       * coding.c (detect_coding_iso_2022): Move back mis-reordered code
+       at check_extra_latin label.  (Bug#13505)
+
+2013-01-24  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
+       Avoid redundant calls to strlen.
+
+2013-01-24  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Drop async_visible and async_iconified fields of struct frame.
+       This is possible because async input is gone; for details, see
+       http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
+       * frame.h (struct frame): Remove async_visible and async_iconified
+       members, convert garbaged to unsigned bitfield.  Adjust comments.
+       (FRAME_SAMPLE_VISIBILITY): Remove.  Adjust all users.
+       (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
+       * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
+       Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
+       FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
+       * w32term.c: Ditto.
+       (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
+       properly.  Likewise for obscured.
+       * xterm.c: Ditto.
+       (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
+       properly.
+       * nsterm.m: Ditto.
+       (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
+
+2013-01-24  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
+       in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
+
+2013-01-23  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * xdisp.c (message2, message2_nolog): Remove functions.
+       (message3, message3_nolog): Extract nbytes and multibyteness directly
+       from the string.  Change all callers.
+       (message3_nolog): Don't set message_enable_multibyte since set_message
+       will reset it anyway.
+       (message1, message1_nolog): Use message3.
+       (vmessage): Use a stack allocated buffer rather than f->message_buf.
+       (with_echo_area_buffer): Remove last two arguments.  Update all callers.
+       (set_message): Drop all but the second arg, which has to be a string.
+       (set_message_1): Simplify now that we know that a1 is NULL and the
+       second arg is a string.
+       * frame.h (struct frame): Remove `message_buf' field.
+       Use glyphs_initialized_p instead.
+       (FRAME_MESSAGE_BUF): Remove macro.
+       * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
+       * lisp.h (message2, message2_nolog): Remove declarations.
+       (message3, message3_nolog): Update declarations.
+       * keyboard.c (read_char_minibuf_menu_text)
+       (read_char_minibuf_menu_width): Remove vars.
+       (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
+       to correctly handle multibyte strings.
+       * frame.c (delete_frame): Don't free message_buf any more.
+       * editfns.c (message_text, message_length): Remove vars.
+       (Fmessage_box): Don't copy the Lisp string's bytes any longer.
+       * fileio.c (auto_save_error): Use message3 instead of message2.
+       * dispnew.c (adjust_frame_message_buffer): Remove function.
+
+2013-01-23  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32term.c (w32fullscreen_hook): Account correctly for the screen
+       real estate used for the tool bar and the menu bar.
+
+2013-01-23  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * insdel.c (prepare_to_modify_buffer): Force redisplay if
+       hidden buffer is prepared to modification (Bug#13164).
+
+2013-01-22  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * window.h (struct window): Change window_end_valid member from
+       Lisp_Object to a bitfield.  Adjust comments.
+       (wset_window_end_valid): Remove.
+       * window.c (adjust_window_count): Clear window_end_valid.
+       (Fwindow_end): Adjust user.  Remove ancient #if 0 code.
+       (Fwindow_line_height, set_window_buffer, Frecenter)
+       (Fsplit_window_internal, Fdelete_other_windows_internal)
+       (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
+       * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
+       * xdisp.c (check_window_end, reconsider_clip_changes)
+       (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
+       (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
+       (find_first_unchanged_at_end_row, try_window_id): Likewise.
+
+2013-01-22  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * xdisp.c (mark_window_display_accurate): Simplify the loop
+       assuming that the only one of vchild, hchild or buffer window
+       slots is non-nil.  Call mark_window_display_accurate_1 for
+       the leaf windows only.
+       (mark_window_display_accurate_1): Always assume leaf window.
+       Adjust comment.
+
+2013-01-22  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * emacs.c (Qkill_emacs_hook): Now static.
+
+       * fileio.c (Finsert_file_contents): Simplify.
+       Remove unnecessary assignments and tests.
+
+2013-01-21  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32.c (acl_set_file): Don't test for errors unless
+       set_file_security returns FALSE.  Avoids spurious errors when
+       saving files.
+
+2013-01-21  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * fileio.c (Finsert_file_contents): Revert code introduced at
+       2013-01-18 in favor of the simpler and generally better fix.
+       Save stack space by removing 'buffer' and reusing 'read_buf'
+       where appropriate.
+
+2013-01-19  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * lisp.h (eabs): Define unconditionally (Bug#13419).
+       The old "#if !defined (eabs)" was an unnecessary revenant of back
+       when this macro was called "abs".  Document 'eabs' better.
+
+2013-01-19  Glenn Morris  <rgm@gnu.org>
+
+       * fns.c (Frandom): Doc fix.
+
+2013-01-19  Eli Zaretskii  <eliz@gnu.org>
+
+       * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
+       segfault when there are lots of overlays.
+
+       * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
+       when there are lots of overlays.  See
+       http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
+       for the details and a way to reproduce.
+
+2013-01-19  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * fileio.c: Use O_APPEND to append.
+       This corresponds better to the natural interpretation of "append",
+       and avoids the need to open the output file twice, or to invoke
+       lseek when APPEND is neither nil nor a number.
+       This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
+       (Fwrite_region): Simplify.  Use O_APPEND instead of opening the
+       file possibly twice, and lseeking to its end; this avoids the
+       need to lseek on non-regular files.  Do not use O_EXCL and O_TRUNC
+       at the same time: the combination is never needed and apparently
+       it doesn't work with DOS_NT.
+
+       Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
+       * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
+
+       Allow floating-point file offsets.
+       Problem reported by Vitalie Spinu in
+       <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
+       * fileio.c (emacs_lseek): Remove.
+       (file_offset): New function.
+       (Finsert_file_contents, Fwrite_region): Use it.
+
+2013-01-19  Chong Yidong  <cyd@gnu.org>
+
+       * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
+       aborting on Fsignal (Bug#13289).
+
+2013-01-19  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
+       set_file_security as failure due to insufficient privileges.
+       Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
+       (fstat): Return owner and group like 'stat' and 'lstat' do.
+
+2013-01-19  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Work around bug in CIFS and vboxsf file systems (Bug#13149).
+       The bug was observed on Ubuntu operating inside a virtual machine,
+       editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
+       The workaround introduces a race condition on non-buggy hosts,
+       but it's an unlikely race and anyway there's a nearly identical
+       nearby race that can't be fixed.
+       * fileio.c (valid_timestamp_file_system, timestamp_file_system):
+       New static vars.
+       (Fwrite_region): Test for file system time stamp bug.
+       (init_fileio): New function.
+       * lisp.h (init_fileio): Declare it.
+       * emacs.c (main): Call it.
+
+       * fileio.c (Finsert_file_contents): Simplify new diagnostic
+       and make it more consistent with other stat-failure diagnostics.
+
+2013-01-18  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       Fix crash when inserting data from non-regular files.  See
+       http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
+       for the error description produced by valgrind.
+       * fileio.c (read_non_regular): Rename to read_contents.
+       Free Lisp_Save_Value object used to pass parameters.
+       (read_non_regular_quit): Rename to read_contents_quit.
+       (Finsert_file_contents): Redesign internal file reading loop to adjust
+       gap and end positions after each read and so help make_gap to work
+       properly.  Do not signal an I/O error too early and so do not leave
+       not yet decoded characters in a buffer, which was the reason of
+       redisplay crash.  Use list2 to build return value.  Adjust comments.
+
+2013-01-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Close a race when statting and reading files (Bug#13149).
+       * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
+       This avoids a race if the file is renamed between stat and open.
+       This race is not the problem originally noted in Bug#13149;
+       see <http://bugs.gnu.org/13149#73> and later messages in the thread.
+
+2013-01-17  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * lisp.h (toplevel): Add comment about using Lisp_Save_Value
+       objects, related functions and macros.
+       (make_save_value): Adjust prototype.
+       (make_save_pointer): New prototype.
+       (SAFE_NALLOCA): Fix indentation.  Use make_save_pointer.
+       (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
+       * alloc.c (format_save_value): Rename to make_save_value.
+       (make_save_pointer): New function.
+       (record_xmalloc): Use make_save_pointer.
+       * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
+       * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
+       Change users of make_save_value to make_save_pointer.
+       Likewise for format_save_value and make_save_value.
+
+2013-01-17  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
+       (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
+       * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
+       debugging stubs.
+
+2013-01-15  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * alloc.c (free_save_value): Now static.
+
+2013-01-15  Dmitry Antipov  <dmantipov@yandex.ru>
+
+       * keymap.c (map_keymap_internal): Use format_save_value.
+       (map_keymap_char_table_item): Adjust accordingly.
+       * fileio.c (non_regular_fd, non_regular_inserted)
+       (non_regular_nbytes): Remove.
+       (Finsert_file_contents): Convert trytry to ptrdiff_t.  Use
+       format_save_value to pass parameters to read_non_regular.
+       (read_non_regular): Use XSAVE_ macros to extract parameters.
+       Adjust comment.
+       * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
+       format_save_value.
+       (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
+
 2013-01-15  Dmitry Antipov  <dmantipov@yandex.ru>
 
        * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow