1. 03 Feb, 2013 1 commit
  2. 02 Feb, 2013 2 commits
    • Paul Eggert's avatar
      Avoid file time stamp bug on MS-Windows. · 8ea41ea9
      Paul Eggert authored
      * 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.
      
      Fixes: debbugs:13149
      8ea41ea9
    • Eli Zaretskii's avatar
      Avoid encoding file names run through dostounix_filename on MS-Windows. · e7ac588e
      Eli Zaretskii authored
       src/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.
       src/msdos.h (dostounix_filename): Adjust prototype.
       src/w32.h (dostounix_filename): Adjust prototype.
       src/msdos.c (dostounix_filename): Accept an additional argument and
       ignore it.
       (init_environment): Adjust callers of dostounix_filename.
       src/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.
       src/dired.c (file_name_completion): Don't call Fdirectory_file_name
       with an encoded file name.
       src/w32proc.c (Fw32_short_file_name, Fw32_long_file_name): Adjust
       calls to dostounix_filename.
       src/w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
       src/unexw32.c (unexec): Adjust call to dostounix_filename.
       src/termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
       src/emacs.c (decode_env_path) [DOS_NT]: Adjust call to
       dostounix_filename.
       src/callproc.c (Fcall_process) [MSDOS]: Adjust call to
       dostounix_filename.
      e7ac588e
  3. 01 Feb, 2013 5 commits
    • Paul Eggert's avatar
      Fix timestamp bug when write-region appends nothing. · 35e85499
      Paul Eggert authored
      * 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.
      
      Fixes: debbugs:13149
      35e85499
    • Eli Zaretskii's avatar
      Make sure program names are encoded before using them to invoke subprocesses. · e7c3fb06
      Eli Zaretskii authored
       src/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.
      e7c3fb06
    • Eli Zaretskii's avatar
      w32proc.c (sys_spawnve): Initialize escape_char. · 18a80473
      Eli Zaretskii authored
       src/w32proc.c (sys_spawnve): Make sure escape_char is initialized,
       even if w32-quote-process-args is nil.
      18a80473
    • Dmitry Antipov's avatar
      * window.h (struct window): Convert base_line_number, base_line_pos · 422ff52b
      Dmitry Antipov authored
      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.
      422ff52b
    • Paul Eggert's avatar
      Use fdopendir, fstatat and readlinkat, for efficiency. · 8654f9d7
      Paul Eggert authored
      On my host, this speeds up directory-files-and-attributes by a
      factor of 3, when applied to Emacs's src directory.
      These functions are standardized by POSIX and are common these
      days; fall back on a (slower) gnulib implementation if the host
      is too old to supply them.
      * .bzrignore: Add lib/dirent.h.
      * lib/Makefile.am (libgnu_a_SOURCES): Add openat-die.c, save-cwd.c.
      * lib/careadlinkat.c, lib/careadlinkat.h: Merge from gnulib,
      incorporating: 2013-01-29 careadlinkat: do not provide careadlinkatcwd.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * lib/dirent.in.h, lib/fdopendir.c, lib/fstatat.c, lib/openat-priv.h:
      * lib/openat-proc.c, lib/openat.h, m4/dirent_h.m4, m4/fdopendir.m4:
      * m4/fstatat.m4: New files, from gnulib.
      * lib/openat-die.c, lib/save-cwd.c, lib/save-cwd.h: New files.
      These last three are specific to Emacs and are not copied from gnulib.
      They are simpler than the gnulib versions and are tuned for Emacs.
      * admin/merge-gnulib (GNULIB_MODULES): Add fdopendir, fstatat, readlinkat.
      (GNULIB_TOOL_FLAGS): Do not avoid at-internal, openat-h.
      Avoid dup, open, opendir.
      * nt/inc/sys/stat.h (fstatat):
      * nt/inc/unistd.h (readlinkat): New decls.
      * src/conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
      * src/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.
      * src/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.
      * src/filelock.c (current_lock_owner): Use emacs_readlinkat
      rather than emacs_readlink.
      * src/lisp.h (emacs_readlinkat): New decl.
      (READLINK_BUFSIZE, emacs_readlink): Remove.
      * src/sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
      (emacs_norealloc_allocator, emacs_readlink): Remove.
      This stuff is moved to fileio.c.
      * src/w32.c (fstatat, readlinkat): New functions.
      (careadlinkat): Don't check that fd == AT_FDCWD.
      (careadlinkatcwd): Remove; no longer needed.
      
      Fixes: debbugs:13539
      8654f9d7
  4. 31 Jan, 2013 2 commits
  5. 28 Jan, 2013 2 commits
  6. 27 Jan, 2013 1 commit
  7. 26 Jan, 2013 1 commit
  8. 25 Jan, 2013 7 commits
  9. 24 Jan, 2013 3 commits
  10. 23 Jan, 2013 4 commits
    • Stefan Monnier's avatar
      * src/xdisp.c (message2, message2_nolog): Remove functions. · b09cca6a
      Stefan Monnier authored
      (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.
      * src/frame.h (struct frame): Remove `message_buf' field.
      Use glyphs_initialized_p instead.
      (FRAME_MESSAGE_BUF): Remove macro.
      * src/w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
      * src/lisp.h (message2, message2_nolog): Remove declarations.
      (message3, message3_nolog): Update declarations.
      * src/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.
      * src/frame.c (delete_frame): Don't free message_buf any more.
      * src/editfns.c (message_text, message_length): Remove vars.
      (Fmessage_box): Don't copy the Lisp string's bytes any longer.
      * src/fileio.c (auto_save_error): Use message3 instead of message2.
      * src/dispnew.c (adjust_frame_message_buffer): Remove function.
      b09cca6a
    • Eli Zaretskii's avatar
      Fix dimensions of maximized frame on MS-Windows. · 54ab1c5a
      Eli Zaretskii authored
       src/w32term.c (w32fullscreen_hook): Account correctly for the screen
       real estate used for the tool bar, the menu bar, and scroll bar.
      54ab1c5a
    • Eli Zaretskii's avatar
      Fix bug #13515 with processing DBCS file names on MS-Windows. · 6d2851de
      Eli Zaretskii authored
       src/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.
      6d2851de
    • Dmitry Antipov's avatar
      * insdel.c (prepare_to_modify_buffer): Force redisplay if · 6c27465b
      Dmitry Antipov authored
      hidden buffer is prepared to modification (Bug#13164).
      6c27465b
  11. 22 Jan, 2013 5 commits
  12. 21 Jan, 2013 2 commits
  13. 20 Jan, 2013 1 commit
    • Andreas Schwab's avatar
      Fixes: debbugs:13505 · ba14c607
      Andreas Schwab authored
      * src/coding.c (detect_coding_iso_2022): Move back mis-reordered code
      at check_extra_latin label.
      ba14c607
  14. 19 Jan, 2013 4 commits
    • Paul Eggert's avatar
      * lisp.h (eabs): Define unconditionally. · d7a0a7c9
      Paul Eggert authored
      The old "#if !defined (eabs)" was an unnecessary revenant of back
      when this macro was called "abs".  Document 'eabs' better.
      
      Fixes: debbugs:13419
      d7a0a7c9
    • Eli Zaretskii's avatar
      Fix crashes with lots of overlays. · 59ac2d13
      Eli Zaretskii authored
       src/editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
       segfault when there are lots of overlays.
       src/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.
      59ac2d13
    • Paul Eggert's avatar
      * fileio.c: Use O_APPEND to append. · 3a955a1f
      Paul Eggert authored
      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.
      3a955a1f
    • Paul Eggert's avatar
      Fix size bug on DOS_NT introduced by CIFS workaround. · 21cd50b8
      Paul Eggert authored
      * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
      
      Fixes: debbugs:13149
      21cd50b8