1. 13 Feb, 2013 1 commit
  2. 12 Feb, 2013 2 commits
    • Eli Zaretskii's avatar
      Fix cursor positioning near scroll margin at top of window. · c4131562
      Eli Zaretskii authored
       src/xdisp.c (try_scrolling): Scroll text up more if point is too close
       to ZV and inside the scroll margin.  This makes sure point is moved
       outside the scroll margin in these cases.
      c4131562
    • Eli Zaretskii's avatar
      Minor additional fix in the wake of bugs #13623 and 13626. · 33b49d71
      Eli Zaretskii authored
       src/xdisp.c (redisplay_internal): Don't set w->region_showing to the
       marker's position.
       (display_line): Set w->region_showing to the value of
       it->region_beg_charpos, not to -1.  This fixes redisplay
       optimization when cursor is moved up after M->.
       src/window.h (struct window): region_showing can no longer be negative.
      33b49d71
  3. 11 Feb, 2013 6 commits
    • Paul Eggert's avatar
      Tune by using memchr and memrchr. · a84b7c53
      Paul Eggert authored
      * .bzrignore: Add string.h.
      * admin/merge-gnulib (GNULIB_MODULES): Add memrchr.
      * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
      * lib/memrchr.c, lib/string.in.h, m4/memrchr.m4, m4/string_h.m4:
      New files, from gnulib.
      * src/doc.c (Fsnarf_documentation):
      * src/fileio.c (Fsubstitute_in_file_name):
      * src/search.c (find_newline, scan_newline):
      * src/xdisp.c (pos_visible_p, display_count_lines):
      Use memchr and memrchr rather than scanning byte-by-byte.
      * src/search.c (find_newline): Rename from scan_buffer.
      Omit first arg TARGET, as it's always '\n'.  All callers changed.
      a84b7c53
    • Paul Eggert's avatar
      Clean up read_key_sequence a tiny bit more. · b09a4810
      Paul Eggert authored
      * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
      (read_key_sequence): Remove unused locals.
      b09a4810
    • Stefan Monnier's avatar
      Clean up read_key_sequence a bit; reread active keymaps after first event. · 99d0d6dc
      Stefan Monnier authored
      * src/keyboard.c (read_char, read_char_x_menu_prompt)
      (read_char_minibuf_menu_prompt):
      Replace nmaps+maps with a single `map' arg.
      (follow_key): Operate on a single map.
      (active_maps): New function.
      (test_undefined): Also return true for nil bindings.
      (read_key_sequence): Use active_maps to replace the arrays of keymaps with
      a single (composed) keymap.  Remember `first_event' to choose the right
      set of active keymaps.  Recompute the set of keymaps after receiving
      the first event.  Remove GOBBLE_FIRST_EVENT.
      (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
      * src/keyboard.h (read_char): Update declaration.
      * src/lread.c (read_filtered_event): Adjust call to read_char.
      * lisp/cus-start.el (all): Remove inhibit-local-menu-bar-menus.
      99d0d6dc
    • Eli Zaretskii's avatar
      Fix previous commit for bug #13675. · f5e1b680
      Eli Zaretskii authored
       src/xdisp.c (move_it_vertically_backward, move_it_by_lines): Don't
       use the limitation on backwards movement when lines are truncated
       in the window.
      f5e1b680
    • Dmitry Antipov's avatar
      * marker.c (set_marker_internal): If desired position is passed · f74de345
      Dmitry Antipov authored
      as a marker, avoid call to buf_charpos_to_bytepos.
      * window.c (Fset_window_point): Omit redundant type checking.
      (Fset_window_start): Likewise.  Format comment.
      (window_scroll_pixel_based): Use set_marker_restricted_both
      with character and byte positions obtained from an iterator.
      (Fset_window_configuration): Use set_marker_restricted_both.
      * xdisp.c (message_dolog): Likewise.
      f74de345
    • Paul Eggert's avatar
      e3777878
  4. 10 Feb, 2013 3 commits
  5. 09 Feb, 2013 5 commits
    • Paul Eggert's avatar
      Minor hashing refactoring. · eff1c190
      Paul Eggert authored
      * fns.c (SXHASH_REDUCE): Move to lisp.h.
      (sxhash_float): Return EMACS_UINT, for consistency with the other
      hash functions.
      * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
      non-static inline function and therefore can't use static vars.
      (SXHASH_REDUCE): Move here from fns.c, and make it inline.
      * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
      with the other hash functions.
      eff1c190
    • Eli Zaretskii's avatar
      Fix last ChangeLog entry. · 4dde2087
      Eli Zaretskii authored
      Fixes: debbugs:13661
      4dde2087
    • Eli Zaretskii's avatar
      Fix bug #13661 with w32-downcase-file-names and shell-command. · 74ba1583
      Eli Zaretskii authored
       src/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.
      74ba1583
    • Eli Zaretskii's avatar
      Remove all references to buffer-file-type and related features. · 8549f9e8
      Eli Zaretskii authored
       src/xdisp.c (decode_mode_spec): Remove handling of %t.
      
       lisp/net/ange-ftp.el (ange-ftp-insert-file-contents): Don't reference
       buffer-file-type.
       lisp/mail/feedmail.el (feedmail-force-binary-write): Doc fix.
       (feedmail-run-the-queue, feedmail-dump-message-to-queue)
       (feedmail-send-it-immediately): Don't bind buffer-file-type, bind
       coding-system-for-write instead.
       lisp/jka-compr.el (jka-compr-write-region): Don't bind
       buffer-file-type.
       lisp/emacs-lisp/bytecomp.el (byte-compile-file): Don't bind
       buffer-file-type.
       lisp/files.el (file-name-buffer-file-type-alist): Remove defvar.
       (insert-file-contents-literally): Remove reference to
       file-name-buffer-file-type-alist.
       lisp/dos-w32.el (file-name-buffer-file-type-alist): Deprecate and
       make-obsolete.
       (find-buffer-file-type-match, find-buffer-file-type): Remove.
       (find-buffer-file-type-coding-system): Remove references to
       find-buffer-file-type-match, find-buffer-file-type, and
       buffer-file-type.
       Don't put find-buffer-file-type-coding-system into
       file-coding-system-alist.
       (find-file-binary, find-file-text): Bind coding-system-for-read
       instead of file-name-buffer-file-type-alist.
       lisp/erc/erc-dcc.el (erc-dcc-get-file): Don't reference buffer-file-type.
      
       doc/emacs/msdog.texi (Text and Binary): Delete the description of
       file-name-buffer-file-type-alist.
      
       doc/lispref/modes.texi (%-Constructs): Remove the description of %t.
       doc/lispref/nonascii.texi (MS-DOS File Types): Delete node.
      
      Fixes: debbugs:12989
      8549f9e8
    • Eli Zaretskii's avatar
      src/msdos.c (careadlinkatcwd): Remove. · 6b48c831
      Eli Zaretskii authored
      6b48c831
  6. 08 Feb, 2013 4 commits
    • Stefan Monnier's avatar
      * src/lread.c (skip_dyn_bytes): New function. · 75a65c7e
      Stefan Monnier authored
      (read1): Use it.  Use getc instead of READCHAR to read bytes.
      (load_each_byte): Remove.  Update users.
      
      Fixes: debbugs:12598
      75a65c7e
    • Dmitry Antipov's avatar
      * search.c (scan_buffer): Calculate end byte position just once. · 8ca30920
      Dmitry Antipov authored
      (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.
      8ca30920
    • Eli Zaretskii's avatar
      c220ea73
    • Dmitry Antipov's avatar
      * lisp.h (make_uninit_vector): New function. · 25721f5b
      Dmitry Antipov authored
      * 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.
      25721f5b
  7. 07 Feb, 2013 1 commit
  8. 06 Feb, 2013 1 commit
  9. 05 Feb, 2013 2 commits
    • Daniel Colascione's avatar
      b8f74366
    • Jan Djärv's avatar
      * lisp/cus-start.el (all): Add ns-use-native-fullscreen. · 6871e574
      Jan Djärv authored
      * src/nsmenu.m (update_frame_tool_bar): Check for negative tool bar
      height.
      
      * src/nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
      (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
      updateCollectionBehaviour.
      
      * src/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.
      (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.
      6871e574
  10. 04 Feb, 2013 2 commits
  11. 03 Feb, 2013 1 commit
  12. 02 Feb, 2013 3 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
    • Paul Eggert's avatar
      Spelling fixes. · d9c287e5
      Paul Eggert authored
      d9c287e5
  13. 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
  14. 31 Jan, 2013 3 commits
  15. 28 Jan, 2013 1 commit