1. 29 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      * xterm.c (x_clear_area): Lost 7th arg because it is always False. · 1f5cf200
      Dmitry Antipov authored
      (x_after_update_window_line, x_scroll_bar_create):
      (x_scroll_bar_set_handle, XTset_vertical_scroll_bar):
      (handle_one_xevent, x_clear_frame_area):
      * gtkutil.c (xg_clear_under_internal_border, xg_update_scrollbar_pos):
      * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines): Adjust users.
      * xterm.h (x_clear_area): Adjust prototype.
      1f5cf200
  2. 27 Aug, 2013 2 commits
    • Paul Eggert's avatar
      Simplify EMACS_TIME-related code. · 43aac990
      Paul Eggert authored
      This portability layer is no longer needed, since Emacs has been
      using struct timespec as a portability layer for some time.
      Merge from gnulib, incorporating:
      2013-08-27 timespec: new convenience constants and function
      * src/atimer.h, src/buffer.h, src/dispextern.h, src/xgselect.h:
      Include <time.h> rather than "systime.h"; that's all that's needed now.
      * src/dispnew.c: Include <timespec.h> rather than "systime.h";
      that's all that's needed now.
      * src/systime.h (EMACS_TIME): Remove.  All uses changed to struct timespec.
      (EMACS_TIME_RESOLUTION): Remove.  All uses changed to
      TIMESPEC_RESOLUTION.
      (LOG10_EMACS_TIME_RESOLUTION): Remove.  All uses changed to
      LOG10_TIMESPEC_RESOLUTION.
      (EMACS_SECS, emacs_secs_addr): Remove.  All uses changed to tv_sec.
      (EMACS_NSECS): Remove.  All uses changed to tv_nsec.
      (make_emacs_time): Remove.  All used changed to make_timespec.
      (invalid_timespec): Rename from invalid_emacs_time.  All uses changed.
      (current_timespec): Rename from current_emacs_time.  All uses changed.
      (add_emacs_time): Remove.  All uses changed to timespec_add.
      (sub_emacs_time): Remove.  All uses change dot timespec_sub.
      (EMACS_TIME_SIGN): Remove.  All uses changed to timespec_sign.
      (timespec_valid_p): Rename from EMACS_TIME_VALID_P.  All uses changed.
      (EMACS_TIME_FROM_DOUBLE): Remove.  All uses changed to dtotimespec.
      (EMACS_TIME_TO_DOUBLE): Remove.  All uses changed to timespectod.
      (current_timespec): Rename from current_emacs_time.  All uses changed.
      (EMACS_TIME_EQ, EMACS_TIME_LT, EMACS_TIME_LE): Remove.  All uses
      changed to timespec_cmp.
      * src/xgselect.c: Include <timespec.h>, since our .h files don't.
      43aac990
    • Dmitry Antipov's avatar
      * xterm.h (FONT_TYPE_FOR_UNIBYTE, FONT_TYPE_FOR_MULTIBYTE:) · d350e350
      Dmitry Antipov authored
      * nsterm.h (FONT_TYPE_FOR_UNIBYTE, FONT_TYPE_FOR_MULTIBYTE):
      Remove the leftovers.
      * gtkutil.c (toplevel): Do not declare Qxft but include
      font.h to do so.
      * image.c (toplevel): Do not declare Vlibrary_cache because
      it's already done in lisp.h.
      d350e350
  3. 26 Aug, 2013 1 commit
  4. 24 Aug, 2013 1 commit
  5. 11 Aug, 2013 1 commit
    • Paul Eggert's avatar
      Omit some unnecessary casts. · 7d652d97
      Paul Eggert authored
      Many of these go back to the old pre-C89 days, when they may have
      been needed, but we've been assuming C89 or later for a while now.
      * alloc.c (live_string_p, live_cons_p, live_symbol_p)
      (live_float_p, live_misc_p, live_vector_p):
      * buffer.c (compare_overlays, cmp_for_strings, mmap_find)
      (mmap_alloc, alloc_buffer_text, enlarge_buffer_text)
      (defvar_per_buffer):
      * callint.c (Fcall_interactively):
      * doc.c (Fsubstitute_command_keys):
      * filelock.c (get_boot_time):
      * frame.c (xrdb_get_resource):
      * gtkutil.c (hierarchy_ch_cb, qttip_cb, style_changed_cb)
      (delete_cb, xg_dialog_response_cb, xg_maybe_add_timer)
      (xg_get_file_name_from_selector, menuitem_destroy_callback)
      (menuitem_highlight_callback, menu_destroy_callback)
      (xg_update_menu_item, xg_modify_menubar_widgets, menubar_map_cb)
      (xg_tool_bar_callback, xg_get_tool_bar_widgets)
      (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
      (xg_tool_bar_help_callback, tb_size_cb):
      * image.c (xpm_alloc_color, png_read_from_memory)
      (png_read_from_file, png_load_body, our_memory_skip_input_data)
      (jpeg_memory_src, jpeg_file_src, imagemagick_load_image)
      (syms_of_image):
      * keymap.c (describe_map):
      * nsfns.m (Fns_display_monitor_attributes_list):
      * nsmenu.m (process_dialog:):
      * nsterm.m (hold_event):
      * process.c (wait_reading_process_output):
      * regex.c (REGEX_REALLOCATE, re_set_registers, re_exec, regexec):
      * scroll.c (do_direct_scrolling, scrolling_1):
      * termcap.c (tgetent):
      * window.c (check_window_containing, add_window_to_list)
      (freeze_window_starts):
      * xdisp.c (compare_overlay_entries, vmessage):
      * xfns.c (x_window, x_get_monitor_attributes_xinerama)
      (x_get_monitor_attributes_xrandr)
      (Fx_display_monitor_attributes_list, x_display_info_for_name)
      (Fx_open_connection, file_dialog_cb, file_dialog_unmap_cb):
      * xfont.c (xfont_match, xfont_open):
      * xmenu.c (x_menu_wait_for_event, menu_highlight_callback)
      (menubar_selection_callback, menu_position_func)
      (popup_selection_callback, create_and_show_popup_menu)
      (dialog_selection_callback, create_and_show_dialog):
      * xrdb.c (x_get_string_resource):
      (main) [TESTRM]:
      * xsmfns.c (x_session_check_input):
      * xterm.c (x_draw_glyphless_glyph_string_foreground)
      (xm_scroll_callback, xg_scroll_callback, xg_end_scroll_callback)
      (xaw_jump_callback, xaw_scroll_callback):
      Omit unnecessary casts.
      7d652d97
  6. 03 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      Drop FRAME_PTR typedef. · a10c8269
      Dmitry Antipov authored
      * composite.c, font.c, font.h, fontset.c, fontset.h, frame.c, frame.h:
      * ftfont.c, ftxfont.c, gtkutil.c, gtkutil.h, image.c, keyboard.c:
      * menu.c, menu.h, msdos.c, nsfns.m, nsfont.m, nsmenu.m, nsterm.h:
      * nsterm.m, scroll.c, term.c, w32fns.c, w32font.c, w32font.h:
      * w32inevt.c, w32inevt.h, w32menu.c, w32notify.c, w32term.c, w32term.h:
      * w32uniscribe.c, w32xfns.c, widget.c, window.c, xdisp.c, xfaces.c:
      * xfns.c, xfont.c, xftfont.c, xmenu.c, xselect.c, xterm.c:
      All related users changed.
      a10c8269
  7. 16 Jul, 2013 1 commit
    • Paul Eggert's avatar
      New unwind-protect flavors to better type-check C callbacks. · 27e498e6
      Paul Eggert authored
      This also lessens the need to write wrappers for callbacks,
      and the need for make_save_pointer.
      * alloca.c (free_save_value):
      * atimer.c (run_all_atimers):
      Now extern.
      * alloc.c (safe_alloca_unwind):
      * atimer.c (unwind_stop_other_atimers):
      * keyboard.c (cancel_hourglass_unwind) [HAVE_WINDOW_SYSTEM]:
      * menu.c (cleanup_popup_menu) [HAVE_NS]:
      * minibuf.c (choose_minibuf_frame_1):
      * process.c (make_serial_process_unwind):
      * xdisp.h (pop_message_unwind):
      * xselect.c (queue_selection_requests_unwind):
      Remove no-longer-needed wrapper.  All uses replaced by the wrappee.
      * alloca.c (record_xmalloc):
      Prefer record_unwind_protect_ptr to record_unwind_protect with
      make_save_pointer.
      * alloca.c (Fgarbage_collect):
      Prefer record_unwind_protect_void to passing a dummy.
      * buffer.c (restore_buffer):
      * window.c (restore_window_configuration):
      * xfns.c, w32fns.c (do_unwind_create_frame)
      New wrapper.  All record-unwind uses of wrappee changed.
      * buffer.c (set_buffer_if_live):
      * callproc.c (call_process_cleanup, delete_temp_file):
      * coding.c (code_conversion_restore):
      * dired.c (directory_files_internal_w32_unwind) [WINDOWSNT]:
      * editfns.c (save_excursion_restore)
      (subst_char_in_region_unwind, subst_char_in_region_unwind_1)
      (save_restriction_restore):
      * eval.c (restore_stack_limits, un_autoload):
      * fns.c (require_unwind):
      * keyboard.c (recursive_edit_unwind, tracking_off):
      * lread.c (record_load_unwind, load_warn_old_style_backquotes):
      * macros.c (pop_kbd_macro, restore_menu_items):
      * nsfns.m (unwind_create_frame):
      * print.c (print_unwind):
      * process.c (start_process_unwind):
      * search.c (unwind_set_match_data):
      * window.c (select_window_norecord, select_frame_norecord):
      * xdisp.c (unwind_with_echo_area_buffer, unwind_format_mode_line)
      (fast_set_selected_frame):
      * xfns.c, w32fns.c (unwind_create_tip_frame):
      Return void, not a dummy Lisp_Object.  All uses changed.
      * buffer.h (set_buffer_if_live): Move decl here from lisp.h.
      * callproc.c (call_process_kill):
      * fileio.c (restore_point_unwind, decide_coding_unwind)
      (build_annotations_unwind):
      * insdel.c (Fcombine_after_change_execute_1):
      * keyboard.c (read_char_help_form_unwind):
      * menu.c (unuse_menu_items):
      * minibuf.c (run_exit_minibuf_hook, read_minibuf_unwind):
      * sound.c (sound_cleanup):
      * xdisp.c (unwind_redisplay):
      * xfns.c (clean_up_dialog):
      * xselect.c (x_selection_request_lisp_error, x_catch_errors_unwind):
      Accept no args and return void, instead of accepting and returning
      a dummy Lisp_Object.  All uses changed.
      * cygw32.c (fchdir_unwind):
      * fileio.c (close_file_unwind):
      * keyboard.c (restore_kboard_configuration):
      * lread.c (readevalllop_1):
      * process.c (wait_reading_process_output_unwind):
      Accept int and return void, rather than accepting an Emacs integer
      and returning a dummy object.  In some cases this fixes an
      unlikely bug when the corresponding int is outside Emacs integer
      range.  All uses changed.
      * dired.c (directory_files_internal_unwind):
      * fileio.c (do_auto_save_unwind):
      * gtkutil.c (pop_down_dialog):
      * insdel.c (reset_var_on_error):
      * lread.c (load_unwind):
      * xfns.c (clean_up_file_dialog):
      * xmenu.c, nsmenu.m (pop_down_menu):
      * xmenu.c (cleanup_widget_value_tree):
      * xselect.c (wait_for_property_change_unwind):
      Accept pointer and return void, rather than accepting an Emacs
      save value encapsulating the pointer and returning a dummy object.
      All uses changed.
      * editfns.c (Fformat): Update the saved pointer directly via
      set_unwind_protect_ptr rather than indirectly via make_save_pointer.
      * eval.c (specpdl_func): Remove.  All uses replaced by definiens.
      (unwind_body): New function.
      (record_unwind_protect): First arg is now a function returning void,
      not a dummy Lisp_Object.
      (record_unwind_protect_ptr, record_unwind_protect_int)
      (record_unwind_protect_void): New functions.
      (unbind_to): Support SPECPDL_UNWIND_PTR etc.
      * fileio.c (struct auto_save_unwind): New type.
      (do_auto_save_unwind): Use it.
      (do_auto_save_unwind_1): Remove; subsumed by new do_auto_save_unwind.
      * insdel.c (struct rvoe_arg): New type.
      (reset_var_on_error): Use it.
      * lisp.h (SPECPDL_UNWIND_PTR, SPECPDL_UNWIND_INT, SPECPDL_UNWIND_VOID):
      New constants.
      (specbinding_func): Remove; there are now several such functions.
      (union specbinding): New members unwind_ptr, unwind_int, unwind_void.
      (set_unwind_protect_ptr): New function.
      * xselect.c: Remove unnecessary forward decls, to simplify maintenance.
      27e498e6
  8. 09 May, 2013 1 commit
  9. 08 May, 2013 1 commit
  10. 02 Apr, 2013 1 commit
    • Paul Eggert's avatar
      Prefer < to > in range checks such as 0 <= i && i < N. · 7216e43b
      Paul Eggert authored
      This makes it easier to visualize quantities on a number line.
      This patch doesn't apply to all such range checks,
      only to the range checks affected by the 2013-03-24 change.
      This patch reverts most of the 2013-03-24 change.
      * alloc.c (xpalloc, Fgarbage_collect):
      * ccl.c (ccl_driver, resolve_symbol_ccl_program):
      * character.c (string_escape_byte8):
      * charset.c (read_hex):
      * data.c (cons_to_unsigned):
      * dispnew.c (update_frame_1):
      * doc.c (Fsubstitute_command_keys):
      * doprnt.c (doprnt):
      * editfns.c (hi_time, decode_time_components):
      * fileio.c (file_offset):
      * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
      * font.c (font_intern_prop):
      * frame.c (x_set_alpha):
      * gtkutil.c (get_utf8_string):
      * indent.c (check_display_width):
      * keymap.c (Fkey_description):
      * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
      * lread.c (read1):
      * minibuf.c (read_minibuf_noninteractive):
      * process.c (wait_reading_process_output):
      * search.c (Freplace_match):
      * window.c (get_phys_cursor_glyph):
      * xdisp.c (redisplay_internal):
      * xsmfns.c (smc_save_yourself_CB):
      Prefer < to > for range checks.
      * dispnew.c (sit_for): Don't mishandle NaNs.
      This fixes a bug introduced in the 2013-03-24 change.
      * editfns.c (decode_time_components): Don't hoist comparison.
      This fixes another bug introduced in the 2013-03-24 change.
      7216e43b
  11. 26 Mar, 2013 1 commit
  12. 24 Mar, 2013 1 commit
    • Andreas Schwab's avatar
      Reorder conditions that are written backwards · 908589fd
      Andreas Schwab authored
      * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
      written backwards.
      * blockinput.h (input_blocked_p): Likewise.
      * bytecode.c (exec_byte_code): Likewise.
      * callproc.c (call_process_kill, call_process_cleanup)
      (Fcall_process): Likewise.
      * ccl.c (ccl_driver, resolve_symbol_ccl_program)
      (Fccl_execute_on_string): Likewise.
      * character.c (string_escape_byte8): Likewise.
      * charset.c (read_hex): Likewise.
      * cm.c (calccost): Likewise.
      * data.c (cons_to_unsigned): Likewise.
      * dired.c (directory_files_internal, file_name_completion):
      Likewise.
      * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
      (sit_for): Likewise.
      * doc.c (Fsubstitute_command_keys): Likewise.
      * doprnt.c (doprnt): Likewise.
      * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
      * emacsgtkfixed.c: Likewise.
      * fileio.c (file_offset, Fwrite_region): Likewise.
      * floatfns.c (Fexpt, fmod_float): Likewise.
      * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
      Likewise.
      * font.c (font_intern_prop): Likewise.
      * frame.c (x_set_alpha): Likewise.
      * gtkutil.c (get_utf8_string): Likewise.
      * indent.c (check_display_width): Likewise.
      * intervals.c (create_root_interval, rotate_right, rotate_left)
      (split_interval_right, split_interval_left)
      (adjust_intervals_for_insertion, delete_node)
      (interval_deletion_adjustment, adjust_intervals_for_deletion)
      (merge_interval_right, merge_interval_left, copy_intervals)
      (set_intervals_multibyte_1): Likewise.
      * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
      * keymap.c (Fkey_description): Likewise.
      * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
      * lread.c (openp, read_integer, read1, string_to_number):
      Likewise.
      * menu.c (ensure_menu_items): Likewise.
      * minibuf.c (read_minibuf_noninteractive): Likewise.
      * print.c (printchar, strout): Likewise.
      * process.c (create_process, Faccept_process_output)
      (wait_reading_process_output, read_process_output, send_process)
      (wait_reading_process_output): Likewise.
      * profiler.c (make_log, handle_profiler_signal): Likewise.
      * regex.c (re_exec): Likewise.
      * regex.h: Likewise.
      * search.c (looking_at_1, Freplace_match): Likewise.
      * sysdep.c (get_child_status, procfs_ttyname)
      (procfs_get_total_memory): Likewise.
      * systime.h (EMACS_TIME_VALID_P): Likewise.
      * term.c (dissociate_if_controlling_tty): Likewise.
      * window.c (get_phys_cursor_glyph): Likewise.
      * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
      (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
      Likewise.
      * xfns.c (Fx_window_property): Likewise.
      * xmenu.c (set_frame_menubar): Likewise.
      * xselect.c (x_get_window_property, x_handle_dnd_message):
      Likewise.
      * xsmfns.c (smc_save_yourself_CB): Likewise.
      * xterm.c (x_scroll_bar_set_handle): Likewise.
      908589fd
  13. 14 Feb, 2013 1 commit
  14. 24 Jan, 2013 1 commit
    • Dmitry Antipov's avatar
      Drop async_visible and async_iconified fields of struct frame. · edfa7fa0
      Dmitry Antipov authored
      This is possible because async input is gone; for details, see
      http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
      * frame.h (struct frame): Remove async_visible and async_iconified
      members, convert garbaged to unsigned bitfield.  Adjust comments.
      (FRAME_SAMPLE_VISIBILITY): Remove.  Adjust all users.
      (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
      * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
      Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
      FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
      * w32term.c: Ditto.
      (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
      properly.  Likewise for obscured.
      * xterm.c: Ditto.
      (handle_one_xevent): Save visible state go generate ICONIFY_EVENT
      properly.
      * nsterm.m: Ditto.
      (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
      edfa7fa0
  15. 17 Jan, 2013 1 commit
    • Dmitry Antipov's avatar
      * lisp.h (toplevel): Add comment about using Lisp_Save_Value · 468afbac
      Dmitry Antipov authored
      objects, related functions and macros.
      (make_save_value): Adjust prototype.
      (make_save_pointer): New prototype.
      (SAFE_NALLOCA): Fix indentation.  Use make_save_pointer.
      (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
      * alloc.c (format_save_value): Rename to make_save_value.
      (make_save_pointer): New function.
      (record_xmalloc): Use make_save_pointer.
      * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
      * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
      Change users of make_save_value to make_save_pointer.
      Likewise for format_save_value and make_save_value.
      468afbac
  16. 15 Jan, 2013 1 commit
    • Dmitry Antipov's avatar
      * src/lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow extraction · 2b30549c
      Dmitry Antipov authored
      from any Lisp_Save_Value slot.  Add type checking.
      * src/alloc.c, src/dired.c, src/editfns.c, src/fileio.c, src/ftfont.c:
      * src/gtkutil.c, src/keymap.c, src/lread.c, src/nsterm.h, src/nsmenu.c:
      * src/xfns.c, src/xmenu.c, src/xselect.c: All users changed.
      * admin/coccinelle/xsave.cocci: Semantic patch to adjust users of
      XSAVE_POINTER and XSAVE_INTEGER macros.
      2b30549c
  17. 14 Jan, 2013 2 commits
    • Paul Eggert's avatar
      Avoid needless casts with XSAVE_POINTER. · c50cf2ea
      Paul Eggert authored
      * alloc.c (mark_object) [GC_MARK_STACK]:
      * dired.c (directory_files_internal_unwind):
      * fileio.c (do_auto_save_unwind):
      * gtkutil.c (pop_down_dialog):
      * keymap.c (map_keymap_char_table_item):
      * lread.c (load_unwind):
      * nsmenu.m (pop_down_menu):
      * print.c (print_object) [GC_MARK_STACK]:
      * xfns.c (clean_up_file_dialog):
      * xmenu.c (cleanup_widget_value_tree):
      Omit casts between XSAVE_POINTER and a pointer type.
      c50cf2ea
    • Dmitry Antipov's avatar
      Make Lisp_Save_Value more versatile storage for up to four objects. · 73ebd38f
      Dmitry Antipov authored
      * lisp.h (toplevel): Enumeration to describe types of saved objects.
      (struct Lisp_Save_Value): New layout.  Adjust comments.
      (XSAVE_POINTER): New macro.
      (XSAVE_INTEGER): Likewise.
      (allocate_misc): Add prototype.
      (free_misc): Likewise.
      * alloc.c (allocate_misc): Now global.
      (free_misc): Likewise.  Adjust comment.
      (make_save_value): Use new Lisp_Save_Value layout.  Adjust comment.
      (free_save_value): Likewise.
      (mark_object): Likewise.
      * editfns.c (save_excursion_save): Pack everything within
      Lisp_Save_Value and so avoid xmalloc.
      (save_excursion_restore): Adjust to match new layout.  Use free_misc
      because we do not allocate extra memory any more.  Add eassert.
      * print.c (print_object): New code to print Lisp_Save_Value.  Do not
      rely on valid_lisp_object_p if !GC_MARK_STACK.  Adjust comments.
      * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
      * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
      Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
      73ebd38f
  18. 11 Jan, 2013 2 commits
  19. 10 Jan, 2013 1 commit
  20. 01 Jan, 2013 1 commit
  21. 30 Dec, 2012 2 commits
    • Jan Djärv's avatar
      Check for deprecated gtk tearoff menu item in configure. · 8b745d92
      Jan Djärv authored
      * configure.ac: Check for GtkHandlebox.
      Check for GtkTearoffMenuItem.
      
      * src/gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
      (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
      handlebox_widget.  Set toolbar_in_hbox to false/true, set
      toolbar_is_packed to true.
      (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
      (update_frame_tool_bar): Check toolbar_is_packed for packing.
      Show all on TOOLBAR_TOP_WIDGET.
      (free_frame_tool_bar): Check toolbar_is_packed.  Use widget returned
      by TOOLBAR_TOP_WIDGET.
      (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
      Check toolbar_is_packed.
      (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
      HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
      (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
      false.
      (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
      (xg_update_menubar): Update title only if
      HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
      (xg_update_submenu): Skip tearoff only if
      HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
      (xg_initialize): Initialize xg_detached_menus only if
      HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
      8b745d92
    • Jan Djärv's avatar
      Check for deprecated gtk_handle_box in configure. · 5a1d858b
      Jan Djärv authored
      * configure.ac: Check for GtkHandlebox.
      
      * src/gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
      (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
      handlebox_widget.  Set toolbar_in_hbox to false/true, set
      toolbar_is_packed to true.
      (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
      (update_frame_tool_bar): Check toolbar_is_packed for packing.
      Show all on TOOLBAR_TOP_WIDGET.
      (free_frame_tool_bar): Check toolbar_is_packed.  Use widget returned
      by TOOLBAR_TOP_WIDGET.
      (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
      Check toolbar_is_packed.
      
      * src/xterm.h (struct x_output): Surround handlebox_widget with
      #ifdef HAVE_GTK_HANDLE_BOX_NEW.  toolbar_is_packed is new,
      toolbar_in_hbox is bool.
      5a1d858b
  22. 25 Dec, 2012 1 commit
  23. 12 Dec, 2012 1 commit
  24. 03 Dec, 2012 1 commit
  25. 13 Oct, 2012 1 commit
  26. 23 Sep, 2012 2 commits
    • Paul Eggert's avatar
      gnutls.c, gtkutil.c: Use bool for boolean. · 18e27ea8
      Paul Eggert authored
      * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
      (emacs_gnutls_handle_error):
      * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
      (xg_hide_tooltip, xg_create_frame_widgets)
      (create_dialog, xg_uses_old_file_dialog)
      (xg_get_file_with_chooser, xg_get_file_with_selection)
      (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
      (xg_item_label_same_p, xg_update_menubar)
      (xg_modify_menubar_widgets, xg_event_is_for_menubar)
      (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
      (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
      (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
      (update_frame_tool_bar, free_frame_tool_bar):
      * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
      * nsmenu.m (ns_update_menubar):
      * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
      * xfns.c (Fx_show_tip) [USE_GTK]:
      Use bool for boolean.
      * gtkutil.c (xg_update_frame_menubar):
      * xmenu.c (update_frame_menubar):
      Return void, not int, since caller ignores return value.
      * gtkutil.c (xg_change_toolbar_position):
      Return void, not 1.
      18e27ea8
    • 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
  27. 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
  28. 12 Sep, 2012 1 commit
  29. 07 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Signal-handler cleanup. · 2fe28299
      Paul Eggert authored
      Emacs's signal handlers were written in the old 4.2BSD style with
      sigblock and sigmask and so forth, and this led to some
      inefficiencies and confusion.  Rewrite these to use
      pthread_sigmask etc. without copying signal sets around.  Also,
      get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
      'signal', and instead use functions that do not attempt to take
      over the system name space.  This patch causes Emacs's text
      segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
      * configure.ac (PTY_OPEN, PTY_TTY_NAME_SPRINTF):
      Adjust to syssignal.h changes.
      (SIGNAL_H_AB): Remove; no longer needed.
      * src/alloc.c, src/emacsgtkfixed.c, src/nsfns.m, src/widget.c, src/xmenu.c:
      Do not include <signal.h> or "syssignal.h", as these
      modules do not use signals.
      * src/atimer.c, src/callproc.c, src/data.c, src/dispnew.c, src/emacs.c:
      * src/floatfns.c, src/gtkutil.c, src/keyboard.c, src/process.c, src/sound.c:
      * src/sysdep.c, src/term.c, src/xterm.c:
      Do not include <signal.h>, as "syssignal.h" does that for us now.
      * src/atimer.c (sigmask_atimers): New function.
      (block_atimers, unblock_atimers): New functions,
      replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
      All uses replaced.
      * src/conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
      no longer needed here.
      * src/emacs.c (main): Inspect existing signal handler with sigaction,
      so that there's	no need to block and unblock SIGHUP.
      * src/sysdep.c (struct save_signal): New member 'action', replacing
      old member 'handler'.
      (save_signal_handlers, restore_signal_handlers):
      Use sigaction instead of 'signal' to save and restore.
      (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
      New function.  All users of 'signal' modified to use set_sighandler
      if they're writeonly, and to use sys_signal if they're read+write.
      (emacs_sigaction_init, forwarded_signal): New functions.
      (sys_signal): Remove.  All uses replaced by calls to sigaction
      and emacs_sigaction_init, or by direct calls to 'signal'.
      (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
      (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
      all uses replaced by pthread_sigmask etc. calls.
      * src/syssignal.h: Include <signal.h>.
      (emacs_sigaction_init, forwarded_signal): New decls.
      (SIGMASKTYPE): Remove.  All uses replaced by its definiens, sigset_t.
      (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
      (sigmask, sys_sigmask): Remove; no longer needed.
      (sigpause): Remove.  All uses replaced by its definiens, sigsuspend.
      (sigblock, sigunblock, sigfree):
      (sigsetmask) [!defined sigsetmask]:
      Remove.  All uses replaced by pthread_sigmask.
      (signal): Remove.  Its remaining uses (with SIG_DFL and SIG_IGN)
      no longer need to be replaced, and its typical old uses
      are now done via emacs_sigaction_init and sigaction.
      (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
      (sys_sigdel): Remove; unused.
      (NSIG): Remove a FIXME; the code's fine.  Remove an unnecessary ifdef.
      
      Fixes: debbugs:12327
      2fe28299
  30. 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
  31. 03 Sep, 2012 1 commit
  32. 02 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Clean up some extern decls. · a411ac43
      Paul Eggert authored
      Mostly, this hoists extern decls out of .c files and into .h files.
      That way, we're more likely to catch errors if the interfaces change.
      * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
      declare xg_mark_data.
      * dispextern.h (x_frame_parm_handlers):
      * font.h (Qxft):
      * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
      (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
      (Qultra_bold, Qoblique, Qitalic):
      Move extern decl here from .c file.
      * alloc.c (xg_mark_data) [USE_GTK]:
      * doc.c (Qclosure):
      * eval.c (Qlexical_binding):
      * fns.c (time) [!HAVE_UNISTD_H]:
      * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
      (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
      * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
      * lread.c (Qinternal_interpreter_environment):
      * minibuf.c (Qbuffer):
      * process.c (QCfamily, QCfilter):
      * widget.c (free_frame_faces):
      * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
      * xfont.c (x_clear_errors):
      * xterm.c (x_frame_parm_handlers):
      Remove now-redundant extern decls.
      * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
      * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
      Now static.
      * xfaces.c: Remove unnecessary static decls.
      * xterm.c (updating_frame): Remove decl of nonexistent object.
      a411ac43
  33. 30 Aug, 2012 1 commit
  34. 16 Aug, 2012 2 commits
    • 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
    • Chong Yidong's avatar
      * gtkutil.c (xg_get_font): Demand an Xft font. · a2d19368
      Chong Yidong authored
      Fixes: debbugs:3228
      a2d19368