1. 07 Dec, 2012 2 commits
  2. 06 Dec, 2012 2 commits
    • Dmitry Antipov's avatar
      * frame.h (x_char_width, x_char_height): Remove prototypes. · 1700db3c
      Dmitry Antipov authored
      * w32term.h (x_char_width, x_char_height): Likewise.
      * xfns.c (x_char_width, x_char_height): Remove.
      * w32fns.c (x_char_width, x_char_height): Likewise.
      * nsfns.c (x_char_width, x_char_height): Likewise.
      * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
      all window frames.
      (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
      * keyboard.c (command_loop_1): Remove prototype.
      (command_loop_2, top_level_1): Add static to match prototype.
      1700db3c
    • Dmitry Antipov's avatar
      Avoid code duplication between prev_frame and next_frame. · 565212e5
      Dmitry Antipov authored
      * frame.c (candidate_frame): New function.  Add comment.
      (prev_frame, next_frame): Use it.  Adjust comment.
      565212e5
  3. 24 Nov, 2012 1 commit
  4. 12 Nov, 2012 1 commit
    • Dmitry Antipov's avatar
      Simplify by using FOR_EACH_FRAME here and there. · 5b04e9f9
      Dmitry Antipov authored
      * frame.c (next_frame, prev_frame, other_visible_frames)
      (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
      * w32term.c (x_window_to_scroll_bar): Likewise.
      * window.c (window_list): Likewise.
      * xdisp.c (x_consider_frame_title): Likewise.
      * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
      * xfns.c (x_window_to_frame, x_any_window_to_frame)
      (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
      * xmenu.c (menubar_id_to_frame): Likewise.
      * xselect.c (frame_for_x_selection): Likewise.
      * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
      (x_window_to_menu_bar): Likewise.
      * w32fns.c (x_window_to_frame): Likewise.  Adjust comment.
      5b04e9f9
  5. 06 Nov, 2012 1 commit
    • Dmitry Antipov's avatar
      Widely used frame validity and checking functions. · d9f07150
      Dmitry Antipov authored
      * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
      * frame.c (decode_live_frame, decode_any_frame): New functions.
      (delete_frame, Fredirect_frame_focus, Fframe_parameters)
      (Fframe_parameter, Fframe_char_height, Fframe_char_width)
      (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
      (Fframe_pointer_visible_p): Use decode_any_frame.
      (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
      (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
      (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
      (Fframe_focus): Likewise.  Allow zero number of arguments.
      Adjust docstring.
      (frame_buffer_list, frame_buffer_predicate): Remove.
      * lisp.h (frame_buffer_predicate): Remove prototype.
      * buffer.c (Fother_buffer): Use decode_any_frame.
      * xdisp.c (Ftool_bar_lines_needed): Likewise.
      * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
      * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
      (Fclose_font, Ffont_info): Use decode_live_frame.
      * fontset.c (check_fontset_name): Likewise.
      * terminal.c (Fframe_terminal): Likewise.
      * w32fns.c (check_x_frame): Likewise.
      * window.c (Fminibuffer_window, Fwindow_at)
      (Fcurrent_window_configuration): Likewise.
      (Frun_window_configuration_change_hook, Fwindow_resize_apply):
      Likewise.  Allow zero number of arguments.  Adjust docstring.
      * dispnew.c (Fredraw_frame): Likewise.
      * xfaces.c (frame_or_selected_frame): Remove.
      (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
      (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
      (Fframe_face_alist): Use decode_live_frame.
      * xfns.c (check_x_frame): Likewise.
      d9f07150
  6. 03 Nov, 2012 1 commit
  7. 30 Oct, 2012 1 commit
  8. 28 Oct, 2012 1 commit
  9. 20 Oct, 2012 1 commit
    • Paul Eggert's avatar
      Port to OpenBSD 5.1. · 4973679b
      Paul Eggert authored
      * frame.c (Fmouse_position, Fmouse_pixel_position):
      * xdisp.c (produce_stretch_glyph):
      Declare local vars only when they're needed.
      This is clearer and avoids a warning on OpenBSD about unused vars.
      * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
      This is safer, and avoids OpenBSD warnings about unused vars.
      * keyboard.c (record_menu_key): Remove unnecessary decl.
      (poll_timer): Define only if POLL_FOR_INPUT is defined.
      * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
      as our definition clashes with OpenBSD's.
      * xfaces.c (load_face_colors, check_lface_attrs)
      (get_lface_attributes_no_remap, get_lface_attributes)
      (lface_fully_specified_p, x_supports_face_attributes_p)
      (tty_supports_face_attributes_p, face_fontset, realize_face)
      (realize_x_face, realize_tty_face):
      Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
      merely Lisp_Object *.  This is more informative and avoids
      a warning on OpenBSD about accessing beyond an object's size.
      4973679b
  10. 09 Oct, 2012 1 commit
  11. 02 Oct, 2012 1 commit
    • 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
  12. 01 Oct, 2012 2 commits
    • 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
      * 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
  13. 30 Sep, 2012 1 commit
    • 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
  14. 23 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Simplify and avoid signal-handling races. · 4d7e6e51
      Paul Eggert authored
      * nt/inc/ms-w32.h (emacs_raise): New macro.
      * src/alloc.c (die):
      * src/sysdep.c (emacs_abort) [HAVE_NTGUI]:
      Avoid recursive loop if there's a fatal error in the function itself.
      * src/atimer.c (pending_atimers):
      * src/blockinput.h: Don't include "atimer.h"; no longer needed.
      (interrupt_input_pending): Remove.  All uses removed.
      pending_signals now counts both atimers and ordinary interrupts.
      This is less racy than having three separate pending-signal flags.
      (block_input, unblock_input, totally_unblock_input, unblock_input_to)
      (input_blocked_p):
      Rename from their upper-case counterparts BLOCK_INPUT,
      UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
      INPUT_BLOCKED_P, and turn into functions.  All uses changed.
      This makes it easier to access volatile variables more accurately.
      (BLOCK_INPUT_RESIGNAL): Remove.  All uses replaced by unblock_input ().
      (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
      that's more reliable if the code is buggy and sets
      interrupt_input_blocked to a negative value.  All uses changed.
      * src/atimer.c (deliver_alarm_signal):
      Remove.  No need to deliver this to the parent; any thread can
      handle this signal now.  All uses replaced by underlying handler.
      * src/atimer.c (turn_on_atimers):
      * src/dispnew.c (handle_window_change_signal):
      * src/emacs.c (handle_danger_signal):
      * src/keyboard.c (kbd_buffer_get_event):
      Don't reestablish signal handler; not needed with sigaction.
      * src/blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
      (UNBLOCK_INPUT_TO):
      Rework to avoid unnecessary accesses to volatile variables.
      (UNBLOCK_INPUT_TO): Now a function.
      (totally_unblock_input, unblock_input): New decls.
      * src/data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
      (init_data): Remove.  Necessary stuff now done in init_signal.
      * src/emacs.c, src/xdisp.c: Include "atimer.h", since we invoke atimer functions.
      * src/emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
      (fatal_error_code): Remove; no longer needed.
      (terminate_due_to_signal): Rename from fatal_error_backtrace, since
      it doesn't always backtrace.  All uses changed.  No need to reset
      signal to default, since sigaction and/or die does that for us now.
      Use emacs_raise (FOO), not kill (getpid (), FOO).
      (main): Check more-accurately whether we're dumping.
      Move fatal-error setup to sysdep.c
      * src/floatfns.c: Do not include "syssignal.h"; no longer needed.
      * src/gtkutil.c (xg_get_file_name, xg_get_font):
      Remove no-longer-needed signal-mask manipulation.
      * src/keyboard.c, src/process.c (POLL_FOR_INPUT):
      Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
      * src/keyboard.c (read_avail_input): Remove.
      All uses replaced by gobble_input.
      (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
      (kbd_buffer_store_event_hold, gobble_input):
      (record_asynch_buffer_change) [USABLE_SIGIO]:
      (store_user_signal_events):
      No need to mess with signal mask.
      (gobble_input): If blocking input and there are terminals, simply
      set pending_signals to 1 and return.  All hooks changed to not
      worry about whether input is blocked.
      (process_pending_signals): Clear pending_signals before processing
      them, in case a signal comes in while we're processing.
      By convention callers now test pending_signals before calling us.
      (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
      New functions, to support changes to blockinput.h.
      (handle_input_available_signal): Now extern.
      (reinvoke_input_signal): Remove.  All uses replaced by
      handle_async_input.
      (quit_count): Now volatile, since a signal handler uses it.
      (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.  All
      callers changed.  Block SIGINT only if not already blocked.
      Clear sigmask reliably, even if Fsignal returns, which it can.
      Omit unnecessary accesses to volatile var.
      (quit_throw_to_read_char): No need to restore sigmask.
      * src/keyboard.c (gobble_input, handle_user_signal):
      * src/process.c (wait_reading_process_output):
      Call signal-handling code rather than killing ourselves.
      * src/lisp.h: Include <float.h>, for...
      (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
      (pending_signals): Now volatile.
      (syms_of_data): Now const if IEEE floating point.
      (handle_input_available_signal) [USABLE_SIGIO]:
      (terminate_due_to_signal, record_child_status_change): New decls.
      * src/process.c (create_process): Avoid disaster if memory is exhausted
      while we're processing a vfork, by tightening the critical section
      around the vfork.
      (send_process_frame, process_sent_to, handle_pipe_signal)
      (deliver_pipe_signal): Remove.  No longer needed, as Emacs now
      ignores SIGPIPE.
      (send_process): No need for setjmp/longjmp any more, since the
      SIGPIPE stuff is now gone.  Instead, report an error if errno
      is EPIPE.
      (record_child_status_change): Now extern.  PID and W are now args.
      Return void, not bool.  All callers changed.
      * src/sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
      Remove.  All uses removed.  This bug should be fixed now in a
      different way.
      (wait_for_termination_1): Use waitpid rather than sigsuspend,
      and record the child status change directly.  This avoids the
      need to futz with the signal mask.
      (process_fatal_action): Move here from emacs.c.
      (emacs_sigaction_flags): New function, containing
      much of what used to be in emacs_sigaction_init.
      (emacs_sigaction_init): Use it.  Block nonfatal system signals that are
      caught by emacs, to make races less likely.
      (deliver_process_signal): Rename from handle_on_main_thread.
      All uses changed.
      (BACKTRACE_LIMIT_MAX): Now at top level.
      (thread_backtrace_buffer, threadback_backtrace_pointers):
      New static vars.
      (deliver_thread_signal, deliver_fatal_thread_signal):
      New functions, for more-accurate delivery of thread-specific signals.
      (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
      (deliver_arith_signal): Handle in this thread, not
      in the main thread, since it's triggered by this thread.
      (maybe_fatal_sig): New function.
      (init_signals): New arg DUMPING so that we can be more accurate
      about whether we're dumping.  Caller changed.
      Treat thread-specific signals differently from process-general signals.
      Block all signals while handling fatal error; that's safer.
      xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
      on IEEE hosts.
      When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
      Ignore SIGPIPE unless batch.
      (emacs_backtrace): Output backtrace for the appropriate thread,
      which is not necessarily the main thread.
      * src/syssignal.h: Include <stdbool.h>.
      (emacs_raise): New macro.
      * src/xterm.c (x_connection_signal): Remove; no longer needed
      now that we use sigaction.
      (x_connection_closed): No need to mess with sigmask now.
      (x_initialize): No need to reset SIGPIPE handler here, since
      init_signals does this for us now.
      
      Fixes: debbugs:12471
      4d7e6e51
  15. 19 Sep, 2012 2 commits
  16. 17 Sep, 2012 1 commit
    • Daniel Colascione's avatar
      Implement cygw32 · 0fda9b75
      Daniel Colascione authored
      Here, we use the generic window-system configuration system we just
      implemented to support the w32 window-system in the mainline build
      under Cygwin.  (Previously, the w32 window system could only be
      compiled as part of the NT-native Emacs build process.)
      
      The changes in this patch need to be applied atomically in order to
      avoid breaking Emacs.  The changes include:
      
        - Changes throughout the Lisp and C code to not assume that
            NT Emacs and the w32 window system are synonymous.
      
        - Wiring up the regular select(2) event loop to Windows messages
      
        - Cleaning up the w32 drag-and-drop receiving code.
      
        - Exposing Cygwin path conversion functions to elisp.
      
        - Unicode file dialog support when compiling for Cygwin.
      
        - Splitting the w32 term lisp initialization code into code
          applicable to any w32 window-system and code specific to
          system-type windows-nt.
      
        - Integrating the old and new w32 code into the build system.
      0fda9b75
  17. 15 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Port better to POSIX hosts lacking _setjmp. · 0328b6de
      Paul Eggert authored
      * configure.ac (HAVE__SETJMP, HAVE_SIGSETJMP): New symbols.
      (_setjmp, _longjmp): Remove.
      * src/lisp.h: Include <setjmp.h> here, since we use its symbols here.
      All instances of '#include <setjmp.h>' removed, if the
      only reason for the instance was because "lisp.h" was included.
      (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
      Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
      and _longjmp with the new symbols.  Emacs already uses _setjmp if
      available, so this change affects only POSIXish hosts that have
      sigsetjmp but not _setjmp, such as some versions of Solaris and
      Unixware.  (Also, POSIX-2008 marks _setjmp as obsolescent.)
      * src/image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
      (png_load_body) [HAVE_PNG]:
      (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
      (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
      Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
      since PNG requires jmp_buf.  This is the only exception to the
      general rule that we now use sys_setjmp and sys_longjmp.
      This exception is OK since this code does not change the signal
      mask or longjmp out of a signal handler.
      
      Fixes: debbugs:12446
      0328b6de
  18. 13 Sep, 2012 1 commit
    • Dmitry Antipov's avatar
      Function to mark objects and remove killed buffers at once. · d59a1afb
      Dmitry Antipov authored
      * alloc.c (discard_killed_buffers): Rename to ...
      (mark_discard_killed buffers) ... new name.  Add marking
      of remaining objects.  Fix comment.  Adjust users.
      (mark_object): Do not touch frame buffer lists here.
      * frame.c (delete_frame): Reset frame buffer lists here.
      d59a1afb
  19. 04 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Simplify redefinition of 'abort' (Bug#12316). · 1088b922
      Paul Eggert authored
      Do not try to redefine the 'abort' function.  Instead, redo
      the code so that it calls 'emacs_abort' rather than 'abort'.
      This removes the need for the NO_ABORT configure-time macro
      and makes it easier to change the abort code to do a backtrace.
      * configure.ac (NO_ABRT): Remove.
      * admin/CPP-DEFINES (NO_ABORT): Remove.
      * nt/inc/ms-w32.h (w32_abort) [HAVE_NTGUI]: Remove.
      * src/.gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
      * src/emacs.c (abort) [!DOS_NT && !NO_ABORT]:
      Remove; sysdep.c's emacs_abort now takes its place.
      * src/lisp.h (emacs_abort): New decl.  All calls from Emacs code to
      'abort' changed to use 'emacs_abort'.
      * src/msdos.c (dos_abort) [defined abort]: Remove; not used.
      (abort) [!defined abort]: Rename to ...
      (emacs_abort): ... new name.
      * src/sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
      the place of the old 'abort' in emacs.c.
      * src/w32.c, src/w32fns.c (abort): Do not #undef.
      * src/w32.c (emacs_abort): Rename from w32_abort.
      1088b922
  20. 01 Sep, 2012 1 commit
    • Daniel Colascione's avatar
      Refactor window-system configuration · 17a2cbbd
      Daniel Colascione authored
      This change streamlines the window system selection code in
      configure.in and moves many common function declarations from
      window-specific headers to frame.h.  It introduces a new TERM_HEADER
      macro in config.h: we set this macro to the right header to use for
      the window system for which we're compiling Emacs and have source
      files include it indirectly.  This way, we don't have to teach every
      file about every window system.
      17a2cbbd
  21. 22 Aug, 2012 1 commit
  22. 18 Aug, 2012 2 commits
    • Paul Eggert's avatar
      * buffer.h (BSET): Remove. · 39eb03f1
      Paul Eggert authored
      Replace all uses with calls to new setter functions.
      (bset_bidi_paragraph_direction, bset_case_canon_table)
      (bset_case_eqv_table, bset_directory, bset_display_count)
      (bset_display_time, bset_downcase_table)
      (bset_enable_multibyte_characters, bset_filename, bset_keymap)
      (bset_last_selected_window, bset_local_var_alist)
      (bset_mark_active, bset_point_before_scroll, bset_read_only)
      (bset_truncate_lines, bset_undo_list, bset_upcase_table)
      (bset_width_table):
      * 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):
      * category.c (bset_category_table):
      * syntax.c (bset_syntax_table):
      New setter functions.
      
      Fixes: debbugs:12215
      39eb03f1
    • Paul Eggert's avatar
      * window.h (WSET): Remove. · e8c17b81
      Paul Eggert authored
      Replace all uses with calls to new setter functions.
      Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
      (WINDOW_INLINE): New macro.
      (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
      (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
      (wset_total_lines, wset_vertical_scroll_bar)
      (wset_window_end_pos, wset_window_end_valid)
      (wset_window_end_vpos): New setter functions.
      * window.c (WINDOW_INLINE):
      Define to EXTERN_INLINE, so that the corresponding functions
      are compiled into code.
      (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_next_buffers)
      (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
      (wset_prev_buffers, 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):
      New setter functions.
      
      Fixes: debbugs:12215
      e8c17b81
  23. 17 Aug, 2012 3 commits
    • Paul Eggert's avatar
      * keyboard.h (KSET): Remove. · 15dbb4d6
      Paul Eggert authored
      Replace all uses with calls to new setter functions.
      Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
      (KEYBOARD_INLINE): New macro.
      (kset_default_minibuffer_frame, kset_defining_kbd_macro)
      (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
      (kset_prefix_arg, kset_system_key_alist, kset_window_system):
      New setter functions.
      * keyboard.c (KEYBOARD_INLINE):
      Define to EXTERN_INLINE, so that the corresponding functions
      are compiled into code.
      (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): New setter functions.
      
      Fixes: debbugs:12215
      15dbb4d6
    • Paul Eggert's avatar
      * frame.h (FSET): Remove (Bug#12215). · f00af5b1
      Paul Eggert authored
      Replace all uses with calls to new setter functions.
      Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
      (FRAME_INLINE): New macro.
      (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
      (fset_current_tool_bar_string, fset_desired_tool_bar_string)
      (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
      (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
      (fset_param_alist, fset_root_window, fset_scroll_bars)
      (fset_selected_window, fset_title, fset_tool_bar_items)
      (fset_tool_bar_position, fset_tool_bar_window): New functions.
      * frame.c (FRAME_INLINE):
      Define to EXTERN_INLINE, so that the corresponding functions
      are compiled into code.
      (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
      f00af5b1
    • Dmitry Antipov's avatar
      Functions to get and set Lisp_Object fields of buffer-local variables. · a04e2c62
      Dmitry Antipov authored
      * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
      (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
      (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
      * data.c, eval.c, frame.c: Adjust users.
      a04e2c62
  24. 16 Aug, 2012 1 commit
    • Paul Eggert's avatar
      Use ASCII tests for character types. · 620f13b0
      Paul Eggert authored
      * admin/merge-gnulib (GNULIB_MODULES): Add c-ctype.
      * lwlib/lwlib-Xaw.c, lwlib/lwlib.c, lwlib/xlwmenu.c:
      Don't include <ctype.h>; no longer needed.
      * lwlib/lwlib-Xaw.c (openFont):
      * lwlib/xlwmenu.c (openXftFont): Test just for ASCII digits.
      * src/category.c, src/dispnew.c, src/doprnt.c, src/editfns.c, src/syntax.c
      * src/term.c, src/xfns.c, src/xterm.c:
      Don't include <ctype.h>; was not needed.
      * src/charset.c, src/doc.c, src/fileio.c, src/font.c, src/frame.c:
      * src/gtkutil.c, src/image.c, src/sysdep.c, src/xfaces.c:
      Include <c-ctype.h> instead of <ctype.h>.
      * src/nsterm.m: Include <c-ctype.h>.
      * src/charset.c (read_hex):
      * src/doc.c (Fsnarf_documentation):
      * src/fileio.c (IS_DRIVE) [WINDOWSNT]:
      (DRIVE_LETTER) [DOS_NT]:
      (Ffile_name_directory, Fexpand_file_name)
      (Fsubstitute_in_file_name):
      * src/font.c (font_parse_xlfd, font_parse_fcname):
      * src/frame.c (x_set_font_backend):
      * src/gtkutil.c (xg_get_font):
      * src/image.c (xbm_scan, xpm_scan, pbm_scan_number):
      * src/nsimage.m (hexchar):
      * src/nsterm.m (ns_xlfd_to_fontname):
      * src/sysdep.c (system_process_attributes):
      * src/xfaces.c (hash_string_case_insensitive):
      Use C-locale tests instead of locale-specific tests for character
      types, since we want the ASCII interpretation here, not the
      interpretation suitable for whatever happens to be the current locale.
      620f13b0
  25. 14 Aug, 2012 1 commit
    • Martin Rudalics's avatar
      Don't call Fset_window_buffer from C code. · 08908aca
      Martin Rudalics authored
      * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
      (delete_frame, Fmake_frame_invisible, Ficonify_frame):
      * minibuf.c (choose_minibuf_frame, read_minibuf):
      * w32fns.c (x_create_tip_frame):
      * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
      Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
      08908aca
  26. 13 Aug, 2012 2 commits
  27. 10 Aug, 2012 1 commit
    • Dmitry Antipov's avatar
      Define Qnone once for all platforms. · 9fb0c957
      Dmitry Antipov authored
      * frame.c (Qnone): Define here.
      (syms_of_frame): DEFSYM it.
      * lisp.h (Qnone): New declaration.
      * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
      * xfns.c: Remove duplication.  Adjust users.
      9fb0c957
  28. 07 Aug, 2012 2 commits
    • Dmitry Antipov's avatar
      Drop WGET and revert read access to Lisp_Objects slots of struct window. · d3d50620
      Dmitry Antipov authored
      * window.h (WGET): Remove.
      (struct window): Do not use INTERNAL_FIELD.
      * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
      * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
      * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
      * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
      * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
      Adjust users.
      d3d50620
    • Dmitry Antipov's avatar
      Drop FGET and revert read access to Lisp_Objects slots of struct frame. · e69b0960
      Dmitry Antipov authored
      * frame.h (FGET): Remove.
      (struct frame): Do not use INTERNAL_FIELD.
      * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
      * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
      * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
      * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
      e69b0960
  29. 06 Aug, 2012 2 commits
    • Dmitry Antipov's avatar
      Separate read and write access to Lisp_Object slots of struct window. · 077288cf
      Dmitry Antipov authored
      * window.h (WGET, WSET): New macros similar to AREF and ASET.
      * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
      * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
      * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
      * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
      * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
      Adjust users.
      077288cf
    • Dmitry Antipov's avatar
      Separate read and write access to Lisp_Object slots of struct frame. · edd74c35
      Dmitry Antipov authored
      * frame.h (FGET, FSET): New macros similar to AREF and ASET.
      * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
      * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
      * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
      * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
      edd74c35
  30. 05 Aug, 2012 1 commit
    • Chong Yidong's avatar
      Docfix for kill-buffer-hook and others. · e5d9c0d1
      Chong Yidong authored
      * lisp/files.el (kill-buffer-hook): Provide a defvar.
      
      * src/term.c (Vsuspend_tty_functions, Vresume_tty_functions):
      * src/frame.c (Vdelete_frame_functions):
      * src/emacs.c (Vkill_emacs_hook): Doc fix.
      e5d9c0d1