1. 08 Oct, 2012 3 commits
  2. 07 Oct, 2012 6 commits
    • Eli Zaretskii's avatar
      Don't abort when ralloc.c:relinquish cannot return a heap to the system. · 98daa893
      Eli Zaretskii authored
       src/ralloc.c (relinquish): If a heap is ready to be relinquished,
       but it still has blocs in it, don't return it to the system,
       instead of aborting.  (Bug#12402)
      98daa893
    • Jan Djärv's avatar
      Reformat last entries to fit 80 columns. · 8ad5b73b
      Jan Djärv authored
      8ad5b73b
    • Jan Djärv's avatar
    • Jan Djärv's avatar
      Check for OSX >= 10.4 to match what the maunal says and what we actually support. · 335f5ae4
      Jan Djärv authored
      * configure.ac: Check that OSX is 10.4 or newer.
      
      * etc/NEWS (NextStep/OSX port changes): OSX 10.4 or newer is required.
      
      * src/nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
      (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
      
      * src/nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
      
      * src/nsmenu.m (fillWithWidgetValue:): Remove code for < MAC_OS_X_VERSION_10_2.
      
      * src/nsselect.m (ns_string_from_pasteboard): Remove check for >=
      MAC_OS_X_VERSION_10_4.
      
      * src/nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
      (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
      (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
      335f5ae4
    • Jan Djärv's avatar
      * nsfns.m (ns_in_resize): Remove. · 3bc0a2f7
      Jan Djärv authored
      (x_set_icon_name, ns_set_name, ns_set_name_as_filename):  Remove ns_in_resize
      check.
      
      * nsterm.m (ns_in_resize): Remove.
      (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
      (ns_clear_frame, sendEvent, windowDidResize, drawRect:): Remove ns_in_resize
      check.
      (ns_clear_frame_area): Remove resize handle code.
      
      Fixes: debbugs:12479
      3bc0a2f7
    • Paul Eggert's avatar
      Improve sys_siglist detection. · c622b48f
      Paul Eggert authored
      * configure.ac (sys_siglist): Look for its decl in <signal.h>.
      Otherwise, it's not found in either Fedora 17 or Solaris 11.
      * src/sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
      defined as a macro, as is done in Solaris.
      (sys_siglist_entries): New macro.
      (save_strsignal): Use it.
      * src/syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
      GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
      c622b48f
  3. 06 Oct, 2012 2 commits
    • Jan Djärv's avatar
      Handle fullscreen parameter in initial/defult-frame-alist for NS. · 04fafa46
      Jan Djärv authored
      * nsfns.m (Fx_create_frame): Call x_default_parameter with
      fullscreen/Fullscreen.
      
      * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
      tobar_height is new.
      
      * nsterm.m (x_make_frame_visible): Check for fullscreen.
      (ns_fullscreen_hook): Activate old style fullscreen with a timer.
      (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
      (windowDidResize:): Check for correct window if old style fullscreen.
      Capitalize word in comment.  Remove incorrect comment.
      (initFrameFromEmacs:): tbar_height renamed tibar_height.
      (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
      error in drawing background.
      (toggleFullScreen:): Remove comment. Rearrange calls.
      Set toolbar values to zero, save old height in tobar_height.
      Restore tool bar height when leaving fullscreen.
      (canBecomeMainWindow): New function.
      04fafa46
    • Paul Eggert's avatar
  4. 05 Oct, 2012 2 commits
    • Eli Zaretskii's avatar
      Fix a typo in a w32proc.c declaration. · a65fbb5f
      Eli Zaretskii authored
       src/w32proc.c (stop_timer_thread): Fix declaration of 'err'.
      a65fbb5f
    • Eli Zaretskii's avatar
      Support setting file times of directories on MS-Windows. · 0d9f584b
      Eli Zaretskii authored
       src/w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
       that time stamps of directories could also be changed.  Don't
       request the too broad GENERIC_WRITE, only the more restrictive
       FILE_WRITE_ATTRIBUTES access rights.
       src/fileio.c (Fset_file_times): Special-case ignoring errors for
       directories only on MSDOS, not on MS-Windows.
      0d9f584b
  5. 04 Oct, 2012 4 commits
  6. 02 Oct, 2012 8 commits
    • Paul Eggert's avatar
      * profiler.c (handle_profiler_signal): Fix a malloc race · a3c5c0c5
      Paul Eggert authored
      that caused Emacs to hang on Fedora 17 when profiling Lisp.
      a3c5c0c5
    • Jan Djärv's avatar
      914e743b
    • Eli Zaretskii's avatar
      Fix compilation warnings in the MS-Windows build. · d8ab37a8
      Eli Zaretskii authored
       src/w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
       consistent with the change in return value of 'safe_strsignal'.
      
       nt/preprep.c (RVA_TO_PTR): Cast the result to 'void *', to avoid
       compiler warnings when using the value.
      d8ab37a8
    • Paul Eggert's avatar
      Prefer plain 'static' to 'static inline'. · 0a99eee1
      Paul Eggert authored
      * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
      (bidi_set_sor_type, bidi_push_embedding_level)
      (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
      (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
      (bidi_cache_search, bidi_cache_ensure_space)
      (bidi_cache_iterator_state, bidi_cache_find)
      (bidi_peek_at_next_level, bidi_set_paragraph_end)
      (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
      (bidi_explicit_dir_char, bidi_resolve_neutral_1):
      Now 'static', not 'static inline'.
      
      Fixes: debbugs:12541
      0a99eee1
    • Paul Eggert's avatar
      Count overruns when profiling; change units to ns. · b3ecad33
      Paul Eggert authored
      * lisp/profiler.el (profiler-sampling-interval): Change units
      from ms to ns, multiplying the default by 1000000 so that
      it remains 1 ms.
      (profiler-report-cpu-line-format): Give enough room for
      the maximum counters on 64-bit hosts.
      (profiler-report-render-calltree-1): Call them "CPU samples",
      not "Time (ms)", since they are not milliseconds now (and
      never really were).
      * src/profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
      Give extra weight to samples after overruns, to attempt to count
      the time more accurately.
      (setup_cpu_timer): Change sampling interval units from ms to ns, since
      the underlying primitives nominally do ns.
      (Fprofiler_cpu_start): Document the change.  Mention that
      the sampling intervals are only approximate.
      b3ecad33
    • Stefan Monnier's avatar
      * src/buffer.c (Fmake_overlay): Fix last change. · 64edc777
      Stefan Monnier authored
      (fix_start_end_in_overlays): Remove redundant recentering.
      64edc777
    • Stefan Monnier's avatar
      Misc minor simplifications in C code. · 090cf9db
      Stefan Monnier authored
      * src/buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
      (Fmake_overlay): Remove redundant tests.
      * src/coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
      case for the special 0 coding-system.
      * src/frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
      090cf9db
    • Juanma Barranquero's avatar
  7. 01 Oct, 2012 12 commits
    • Paul Eggert's avatar
      Fix a malloc race condition involving strsignal. · aa1ba90e
      Paul Eggert authored
      A signal can arrive in the middle of a malloc, and Emacs's signal
      handler can invoke strsignal, which can invoke malloc, which is
      not portable.  This race condition bug makes Emacs hang on GNU/Linux.
      Fix it by altering the signal handler so that it does not invoke
      strsignal.
      * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
      * process.c (status_message): Use const pointer, in case strsignal
      is #defined to safe_strsignal.
      * sysdep.c (sys_siglist, init_signals): Always define and
      initialize a substitute sys_siglist if the system does not define
      one, even if HAVE_STRSIGNAL.
      (safe_strsignal): Rename from strsignal.  Always define,
      using sys_siglist.  Return a const pointer.
      * syssignal.h (safe_strsignal): New decl.
      (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
      aa1ba90e
    • Eli Zaretskii's avatar
      Fix high CPU usage in profiling on MS-Windows. · ace917bd
      Eli Zaretskii authored
       src/w32proc.c (timer_loop): Fix code that waits for timer
       expiration, to avoid high CPU usage.
      ace917bd
    • Stefan Monnier's avatar
      * src/fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table) · 9eb71b9c
      Stefan Monnier authored
      (sweep_weak_table): Remove redundant prototypes.
      9eb71b9c
    • Fabrice Popineau's avatar
      Fix minor compilation problem with MSVC. · b3317662
      Fabrice Popineau authored
       src/emacs.c: Move the inclusion of TERM_HEADER after including
       windows.h on WINDOWSNT.  This avoids compilation problems with
       MSVC.
      b3317662
    • Eli Zaretskii's avatar
      Clean up the Windows x64 changes. · 2d7d1608
      Eli Zaretskii authored
       nt/preprep.c (RVA_TO_PTR): Use 'unsigned char *' instead of
       'void *', for pointer arithmetics.
       (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET): Enclose all
       macro arguments in parentheses.
      
       src/unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
       (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
       (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
       as the previous version used 'void *'.
       src/ralloc.c (ROUNDUP): Fix last change.
       (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
       'size_t'.
      
      Fixes: debbugs:12544
      2d7d1608
    • Eli Zaretskii's avatar
      Improve 'alarm' implementation on MS-Windows. · 4cdfbb89
      Eli Zaretskii authored
       src/w32proc.c (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
       return results.
       [!HAVE_SETITIMER]: Behave as the previous version that didn't
       support timers.
      4cdfbb89
    • Eli Zaretskii's avatar
      Fix termination sequence on Windows wrt interval timers. · f0e5f225
      Eli Zaretskii authored
       src/w32proc.c <disable_itimers>: New static flag.
       (init_timers): Initialize it to zero, after creating the critical
       sections used by the timer threads.
       (term_timers): Set to 1 before deleting the critical sections.
       (getitimer, setitimer): If disable_itimers is non-zero, return an
       error indication without doing anything.  Reported by Fabrice
       Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
      f0e5f225
    • Paul Eggert's avatar
    • Paul Eggert's avatar
      Prefer plain 'static' to 'static inline'. · b0ab8123
      Paul Eggert authored
      With static functions, modern compilers inline pretty well by
      themselves; advice from programmers often hurts as much as it helps.
      On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
      this change shrinks the text size of the Emacs executable by 1.1%
      without affecting CPU significantly in my benchmark.
      * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
      (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
      (mark_maybe_object, mark_maybe_pointer, bounded_number):
      * buffer.c (bset_abbrev_mode, bset_abbrev_table)
      (bset_auto_fill_function, bset_auto_save_file_format)
      (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
      (bset_bidi_display_reordering, bset_buffer_file_coding_system)
      (bset_cache_long_line_scans, bset_case_fold_search)
      (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
      (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
      (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
      (bset_fringe_indicator_alist, bset_fringes_outside_margins)
      (bset_header_line_format, bset_indicate_buffer_boundaries)
      (bset_indicate_empty_lines, bset_invisibility_spec)
      (bset_left_fringe_width, bset_major_mode, bset_mark)
      (bset_minor_modes, bset_mode_line_format, bset_mode_name)
      (bset_name, bset_overwrite_mode, bset_pt_marker)
      (bset_right_fringe_width, bset_save_length)
      (bset_scroll_bar_width, bset_scroll_down_aggressively)
      (bset_scroll_up_aggressively, bset_selective_display)
      (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
      (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
      (set_buffer_overlays_after):
      * category.c (bset_category_table):
      * charset.c (read_hex):
      * coding.c (produce_composition, produce_charset)
      (handle_composition_annotation, handle_charset_annotation)
      (char_encodable_p):
      * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
      (assign_row, set_frame_matrix_frame, make_current)
      (add_row_entry):
      * eval.c (set_specpdl_symbol, set_specpdl_old_value):
      * fns.c (maybe_resize_hash_table):
      * frame.c (fset_buffer_predicate, fset_minibuffer_window):
      * gmalloc.c (register_heapinfo):
      * image.c (lookup_image_type):
      * intervals.c (set_interval_object, set_interval_left)
      (set_interval_right, copy_interval_parent, rotate_right)
      (rotate_left, balance_possible_root_interval):
      * keyboard.c (kset_echo_string, kset_kbd_queue)
      (kset_keyboard_translate_table, kset_last_prefix_arg)
      (kset_last_repeatable_command, kset_local_function_key_map)
      (kset_overriding_terminal_local_map, kset_real_last_command)
      (kset_system_key_syms, clear_event, set_prop):
      * lread.c (digit_to_number):
      * marker.c (attach_marker, live_buffer, set_marker_internal):
      * nsterm.m (ns_compute_glyph_string_overhangs):
      * process.c (pset_buffer, pset_command)
      (pset_decode_coding_system, pset_decoding_buf)
      (pset_encode_coding_system, pset_encoding_buf, pset_filter)
      (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
      (pset_status, pset_tty_name, pset_type, pset_write_queue):
      * syntax.c (bset_syntax_table, dec_bytepos):
      * terminal.c (tset_param_alist):
      * textprop.c (interval_has_some_properties)
      (interval_has_some_properties_list):
      * window.c (wset_combination_limit, wset_dedicated)
      (wset_display_table, wset_hchild, wset_left_fringe_width)
      (wset_left_margin_cols, wset_new_normal, wset_new_total)
      (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
      (wset_right_fringe_width, wset_right_margin_cols)
      (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
      (wset_vertical_scroll_bar_type, wset_window_parameters):
      * xdisp.c (wset_base_line_number, wset_base_line_pos)
      (wset_column_number_displayed, wset_region_showing)
      (window_box_edges, run_window_scroll_functions)
      (append_glyph_string_lists, prepend_glyph_string_lists)
      (append_glyph_string, set_glyph_string_background_width)
      (append_glyph, append_composite_glyph)
      (take_vertical_position_into_account):
      * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
      (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
      (lface_hash, lface_same_font_attributes_p, lookup_face):
      * xml.c (libxml2_loaded_p):
      * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
      (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
      Now 'static', not 'static inline'.
      
      Fixes: debbugs:12541
      b0ab8123
    • Paul Eggert's avatar
      * bidi.c: Tune. · 05584c31
      Paul Eggert authored
      (bidi_copy_it): Do the whole copy with a single memcpy.
      (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
      05584c31
    • Paul Eggert's avatar
      86ec63ba
    • Paul Eggert's avatar
      * frame.c (x_report_frame_params): Port better to wider ints. · 82ef37c1
      Paul Eggert authored
      Do not assume that EMACS_UINT is the same width as uprintmax_t,
      or that pointers can be printed in 15 decimal digits.
      Avoid GCC warnings if EMACS_UINT is wider than a pointer.
      82ef37c1
  8. 30 Sep, 2012 3 commits
    • Fabrice Popineau's avatar
      Fix last commit. · 5e4daaf3
      Fabrice Popineau authored
      5e4daaf3
    • Fabrice Popineau's avatar
      Support x64 build on MS-Windows with MSVC. · 62aba0d4
      Fabrice Popineau authored
       src/w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
       (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
       compatibility with x64.
       src/w32term.c (w32_draw_underwave): Don't use GCC extensions for
       defining an XRectangle structure.
       src/w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
       arithmetics for compatibility with x64.
       src/w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
       compatibility with x64.
       src/w32heap.h: Adjust prototypes and declarations.
       src/w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
       (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
       DWORD, long, and unsigned long, for compatibility with x64.
       (allocate_heap) [_WIN64]: Reserve 32GB of memory.
       (sbrk): Argument is now of type ptrdiff_t.
       src/w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
       less than 0x0500.
       (w32_msg_pump): Use WPARAM type for 'result'.
       src/w32.c (init_environment, get_emacs_configuration): Support AMD64
       architecture.
       (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
       compatibility with x64.
       src/vm-limit.c (lim_data): Now size_t.
       (check_memory_limits): Adjust prototypes of real_morecore and
       __morecore to receive argument of type ptrdiff_t.  Use size_t for
       five_percent and data_size.
       src/unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
       variables, for compatibility with x64.
       (rva_to_section, offset_to_section, relocate_offset)
       (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
       (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
       (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
       for compatibility with x64.
       src/sysdep.c (STDERR_FILENO): Define if not already defined.
       src/ralloc.c (real_morecore): Argument type is now ptrdiff_t.
       (__morecore): Argument type is now ptrdiff_t.
       (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
       (relinquish): Use ptrdiff_t type for 'excess'.
       (r_alloc_sbrk): Argument type is now ptrdiff_t.
       src/makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
       (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
       instead of a literal number.
       src/gmalloc.c [WINDOWSNT]: Include w32heap.h.
       (min): Define only if not already defined.
       src/frame.c (x_report_frame_params): Use EMACS_UINT for the return
       value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
       hosts.
       src/image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
       'bitmaps' is a pointer.
       src/dispextern.h (x_bitmap_pixmap): Adjust prototype.
       src/alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
      
       nt/makefile.w32-in ($(TRES)): Use $(EMACS_MANIFEST).
       nt/inc/sys/socket.h: Don't map Winsock error codes to standard ones
       that are already defined.
       nt/inc/ms-w32.h (EMACS_INT, EMACS_UINT, EMACS_INT_MAX, PRIuMAX)
       (pI, _INTPTR) [_MSC_VER]: Fix definitions for MSVC.
       [_MSC_VER]: Add pragmas to suppress some MSVC warnings.
       nt/preprep.c (pfnCheckSumMappedFile, rva_to_section)
       (offset_to_section, relocate_offset, OFFSET_TO_RVA)
       (RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET, PTR_TO_RVA)
       (OFFSET_TO_PTR, ROUND_UP, ROUND_DOWN)
       (copy_executable_and_move_sections, ADJUST_IMPORT_RVA, main): Use
       DWORD_PTR instead of DWORD for compatibility with x64.
       nt/nmake.defs: Support AMD64.
       (EMACS_HEAPSIZE, EMACS_PURESIZE, EMACS_MANIFEST): New macros.
       nt/gmake.defs: (EMACS_HEAPSIZE, EMACS_PURESIZE, EMACS_MANIFEST):
       New macros.
       nt/addsection.c (pfnCheckSumMappedFile, rva_to_section)
       (offset_to_section, relocate_offset, OFFSET_TO_RVA)
       (RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET, PTR_TO_RVA)
       (OFFSET_TO_PTR, ROUND_UP, ROUND_DOWN)
       (copy_executable_and_add_section, main): Use DWORD_PTR instead of
       DWORD, for compatibility with x64.
       nt/emacs-x64.manifest: New file.
       nt/emacs-x86.manifest: Renamed from emacs.manifest.
      
       lib-src/ntlib.c (gettimeofday): Copy from src/w32.c.  lib/gettime. 
       needs this function.
      62aba0d4
    • Paul Eggert's avatar
      file-attributes has a new optional arg FOLLOW-SYMLINKS. · e7a2937b
      Paul Eggert authored
      * doc/lispref/files.texi (File Attributes): Describe it.
      (Magic File Names): Use it.
      * etc/NEWS: Document the change.
      * lisp/files.el (remote-file-name-inhibit-cache):
      * lisp/time.el (display-time-file-nonempty-p): Use it.
      * lisp/files.el (after-find-file): Don't chase links before calling
      file-exists-p, as file-exists-p already does the right thing.
      * src/dired.c (directory_files_internal, Ffile_attributes):
      New arg follow_symlinks.  All uses changed.
      e7a2937b