1. 01 Feb, 2015 1 commit
  2. 01 Jan, 2015 2 commits
  3. 22 Dec, 2014 1 commit
    • Paul Eggert's avatar
      Use bool for boolean in xterm.c · 455e5469
      Paul Eggert authored
      * frame.h, nsterm.m, w32term.c, w32term.h, xterm.c:
      (x_set_window_size, x_bitmap_icon):
      * nsterm.m (ns_frame_raise_lower, x_new_font):
      * termhooks.h (struct terminal.toggle_invisible_pointer_hook)
      (struct terminal.frame_raise_lower_hook):
      * w32term.c (w32_frame_raise_lower):
      * xterm.c, xterm.h (x_text_icon):
      * xterm.c (x_update_window_begin, x_update_window_end)
      (x_update_end, x_after_update_window_line)
      (x_set_glyph_string_gc, x_draw_glyph_string_background)
      (x_draw_glyph_string_foreground)
      (x_draw_composite_glyph_string_foreground)
      (x_alloc_lighter_color, x_draw_relief_rect)
      (x_draw_glyph_string_box, x_draw_image_relief)
      (x_draw_image_glyph_string, x_draw_stretch_glyph_string)
      (x_draw_underwave, x_draw_glyph_string, x_show_hourglass)
      (x_hide_hourglass):
      (XFillRectangle) [HAVE_GTK3]:
      (XTtoggle_invisible_pointer, frame_highlight, frame_unhighlight)
      (x_focus_changed, x_find_modifier_meanings, note_mouse_movement)
      (XTmouse_position, xt_action_hook, xt_horizontal_action_hook)
      (x_send_scroll_bar_event, xm_scroll_callback)
      (xg_scroll_callback, xaw_jump_callback, xaw_scroll_callback)
      (x_create_toolkit_scroll_bar)
      (x_create_horizontal_toolkit_scroll_bar)
      (x_set_toolkit_horizontal_scroll_bar_thumb, x_scroll_bar_create)
      (x_scroll_bar_set_handle, XTset_vertical_scroll_bar)
      (XTset_horizontal_scroll_bar, x_scroll_bar_expose)
      (x_scroll_bar_handle_click, x_scroll_bar_note_movement)
      (x_scroll_bar_report_motion)
      (x_horizontal_scroll_bar_report_motion, x_net_wm_state)
      (handle_one_xevent, XTread_socket, x_draw_bar_cursor)
      (x_draw_window_cursor, x_clear_errors)
      (x_trace_wire, x_new_font, x_set_offset, wm_supports)
      (set_wm_state, x_set_sticky, get_current_wm_state)
      (do_ewmh_fullscreen, x_handle_net_wm_state)
      (x_check_expected_move, x_sync_with_move, x_wait_for_event)
      (x_set_window_size_1, XTframe_raise_lower)
      (x_make_frame_visible, x_iconify_frame)
      (x_timeout_atimer_activated_flag, same_x_server, x_display_ok)
      (x_term_init, x_process_timeouts, x_activate_timeout_atimer)
      (x_delete_terminal, x_initialize, syms_of_xterm):
      Use bool for boolean.
      455e5469
  4. 14 Oct, 2014 1 commit
    • Dmitry Antipov's avatar
      Cleanup terminal handling code. · bb75cdf9
      Dmitry Antipov authored
      * dispextern.h (get_named_tty): Remove prototype but...
      * termhooks.h (get_named_terminal): ...resurrect it under
      more meaningful name.
      (get_terminal): Likewise, but with...
      (decode_live_terminal): ...this name.
      (decode_tty_terminal): Add prototype.
      * term.c (get_tty_terminal): Remove.
      (get_named_tty): Remove.
      (Ftty_display_color_p, Ftty_display_color_cells, Ftty_type)
      (Fcontrolling_tty_p, Fsuspend_tty, Fresume_tty):
      Use decode_tty_terminal.
      (Ftty_no_underline, Ftty_top_frame): Use decode_live_terminal.
      * terminal.c (get_terminal): Refactor to...
      (decode_terminal, decode_live_terminal): ...new functions.
      (decode_tty_terminal): Replacement for get_tty_terminal.
      (get_named_terminal): Likewise for get_named_tty.
      * coding.c (Fset_terminal_coding_system_internal)
      (Fterminal_coding_system, Fset_keyboard_coding_system_internal):
      (Fkeyboard_coding_system):
      * composite.c (Fcomposition_get_gstring):
      * dispnew.c (Fsend_string_to_terminal):
      * frame.c (Fmake_terminal_frame):
      * nsfns.m (check_ns_display_info):
      * w32fns.c, xfns.c (check_x_display_info):
      * xselect.c (frame_for_x_selection): Use decode_live_terminal.
      * keyboard.c (handle_interrupt_signal, handle_interrupt)
      (Fset_quit_char): Use get_named_terminal.
      (Fset_output_flow_control, Fset_input_meta_mode):
      Use decode_tty_terminal.
      bb75cdf9
  5. 24 Sep, 2014 2 commits
    • Paul Eggert's avatar
      Avoid signed integer overflow when converting Time to ptrdiff_t. · 203a9eb0
      Paul Eggert authored
      * keyboard.c (INPUT_EVENT_POS_MAX, INPUT_EVENT_POS_MIN):
      New macros.
      (position_to_Time, Time_to_position): New functions.
      (gen_help_event, kbd_buffer_get_event): Use them.
      * systime.h (Time) [emacs && !HAVE_X_WINDOWS]:
      Go back to plain 'unsigned long', so that 'Time' is the same
      for both X and non-X builds; this is less likely to cause surprise.
      * termhooks.h: Remove compile-time check that Time and ptrdiff_t
      are the same size; this is no longer required.
      203a9eb0
    • Dmitry Antipov's avatar
      * termhooks.h (enum scroll_bar_part): Begin from 0 to allow... · 4b930ccb
      Dmitry Antipov authored
      (struct input_event): ...unsigned bitfields.  Likewise for
      `event_kind' member.  Prefer unsigned for `code' and 'modifiers'.
      Use `timestamp' for HELP_EVENT position.  Add compile-time assert.
      * keyboard.c (gen_help_event, kbd_buffer_store_help_event)
      (kbd_buffer_get_event): Adjust users.
      (scroll_bar_parts): Add Qnil to match scroll_bar_nowhere.
      (make_scroll_bar_position): New function, refactored out of...
      (make_lispy_event): ...adjusted user.
      * nsterm.h (EmacsScroller): Use enum for `last_hit_part' member.
      * nsterm.m (ns_mouse_position, mouseUp):
      * term.c (term_mouse_position):
      * w32inevt.c (w32_console_mouse_position):
      * w32term.c (w32_mouse_position):
      * xterm.c (XTmouse_position): Use scroll_bar_above_handle.
      (x_send_scroll_bar_event, xm_scroll_callback, xg_scroll_callback):
      Prefer enum and explicit enum members to integers and numeric values.
      4b930ccb
  6. 27 Jul, 2014 1 commit
    • Martin Rudalics's avatar
      Complete pixelwise frame/window resizing, add horizontal scrollbar support. · 3477e270
      Martin Rudalics authored
      * frame.el (frame-notice-user-settings): Rewrite using
      frame-initial-frame-tool-bar-height.
      * menu-bar.el (menu-bar-horizontal-scroll-bar)
      (menu-bar-no-horizontal-scroll-bar): New functions.
      (menu-bar-showhide-scroll-bar-menu): Add bindings for horizontal
      scroll bars.
      * scroll-bar.el (scroll-bar-lines)
      (set-horizontal-scroll-bar-mode)
      (get-horizontal-scroll-bar-mode, horizontal-scroll-bar-mode)
      (scroll-bar-horizontal-drag-1, scroll-bar-horizontal-drag)
      (scroll-bar-toolkit-horizontal-scroll): New functions.
      (horizontal-scroll-bar-mode)
      (previous-horizontal-scroll-bar-mode)
      (horizontal-scroll-bar-mode-explicit): New variables.
      (horizontal-scroll-bar-mode): New option.
      (toggle-horizontal-scroll-bar): Do something.
      (top-level): Bind horizontal-scroll-bar mouse-1.
      * startup.el (tool-bar-originally-present): Remove variable.
      (command-line): Don't set tool-bar-originally-present.
      * window.el (window-min-height): Update doc-string.
      (window--dump-frame): Dump horizontal scroll bar values.
      (window--min-size-1): Handle minibuffer window separately.
      Count in margins and horizontal scroll bar.  Return safe value
      iff IGNORE equals 'safe.
      (frame-windows-min-size): New function (used by frame resizing
      routines).
      (fit-frame-to-buffer, fit-window-to-buffer): Count in horizontal
      scroll bars.
      (window--sanitize-window-sizes): New function.
      (window-split-min-size): Remove.
      (split-window): Count divider-width.  Don't use
      `window-split-min-size' any more.  Reword error messages.
      Sanitize windows sizes after splitting.
      * buffer.h (struct buffer): New fields scroll_bar_height and
      horizontal_scroll_bar_type.
      * buffer.c (bset_scroll_bar_height)
      (bset_horizontal_scroll_bar_type): New functions.
      (Fbuffer_swap_text): Handle old_pointm field.
      (init_buffer_once): Set defaults for scroll_bar_height and
      horizontal_scroll_bar_type.
      (syms_of_buffer): New variables scroll_bar_height and
      horizontal_scroll_bar_type.
      * dispextern.h (window_part): Rename ON_SCROLL_BAR to
      ON_VERTICAL_SCROLL_BAR.  Add ON_HORIZONTAL_SCROLL_BAR.
      (set_vertical_scroll_bar): Remove prototype.
      (x_change_tool_bar_height): Add prototype.
      * dispnew.c (adjust_frame_glyphs_for_frame_redisplay)
      (window_to_frame_vpos, update_frame_1, scrolling, init_display):
      Use FRAME_TOTAL_COLS and FRAME_TOTAL_LINES instead of FRAME_COLS
      and FRAME_LINES.
      (adjust_frame_glyphs_for_window_redisplay): Rearrange lines.
      (update_window): Start mode_line_row->y after horizontal scroll
      bar.
      (change_frame_size_1): Call adjust_frame_size.
      (init_display): When changing the size of a tty frame do not
      pass height of menu bar.
      (Qframe_windows_min_size): New symbol.
      * frame.h (struct frame): List tool bar fields after menu bar
      fields.  Add official, total_lines, horizontal_scroll_bars,
      config_scroll_bar_height and config_scroll_bar_lines fields.
      (FRAME_HAS_HORIZONTAL_SCROLL_BARS)
      (FRAME_CONFIG_SCROLL_BAR_HEIGHT, FRAME_CONFIG_SCROLL_BAR_LINES)
      (FRAME_SCROLL_BAR_AREA_HEIGHT, FRAME_SCROLL_BAR_COLS)
      (FRAME_SCROLL_BAR_LINES, FRAME_TOTAL_LINES, SET_FRAME_LINES)
      (FRAME_WINDOWS_HEIGHT): New macros.
      (SET_FRAME_HEIGHT, FRAME_TEXT_LINES_TO_PIXEL_HEIGHT)
      (FRAME_PIXEL_Y_TO_LINE, FRAME_PIXEL_HEIGHT_TO_TEXT_LINES)
      (FRAME_TEXT_TO_PIXEL_HEIGHT): Separately count top margin and
      horizontal scroll bar.
      (frame_inhibit_resize, adjust_frame_size)
      (frame_windows_min_size): Add declarations.
      (Qscroll_bar_height, Qhorizontal_scroll_bars)
      (x_set_scroll_bar_default_height, x_set_left_fringe)
      (x_set_right_fringe, x_set_vertical_scroll_bars)
      (x_set_horizontal_scroll_bars, x_set_scroll_bar_width)
      (x_set_scroll_bar_height): Add external declarations.
      * frame.c: (frame_inhibit_resize, frame_windows_min_size)
      (adjust_frame_size): New functions.
      (make_frame): Initial horizontal_scroll_bars field.  Use
      SET_FRAME_LINES.  Don't allow horizontal scroll bar in
      minibuffer window.
      (make_initial_frame, make_terminal_frame): No horizontal scroll
      bar in initial and terminal frames.  Use adjust_frame_size.
      (Fframe_total_cols): Fix doc-string.
      (Fframe_total_lines, Fscroll_bar_height): New Lisp functions.
      (Fset_frame_height, Fset_frame_width, Fset_frame_size): Rewrite
      using adjust_frame_size.
      (Qscroll_bar_height, Qhorizontal_scroll_bars)
      (Qframe_windows_min_size): New symbols.
      (x_set_frame_parameters): Remove call of check_frame_size.
      (x_report_frame_params): Return scroll_bar_height value.
      (x_set_left_fringe, x_set_right_fringe): New functions.
      (adjust_frame_height, x_set_internal_border_width)
      (x_set_fringe_width): Remove.
      (x_set_internal_border_width, x_set_vertical_scroll_bars)
      (x_set_scroll_bar_width, x_set_right_divider_width)
      (x_set_bottom_divider_width): Rewrite using adjust_frame_size.
      (x_set_horizontal_scroll_bars, x_set_scroll_bar_height): New
      functions.
      (x_figure_window_size): Rewrite to make frame display the
      expected number of lines.
      (Vdefault_frame_scroll_bars): Rewrite doc-string.
      (Vdefault_frame_horizontal_scroll_bars)
      (Vframe_initial_frame_tool_bar_height)
      (frame_inhibit_implied_resize): New variables.
      * fringe.c (compute_fringe_widths): Remove.
      * gtkutil.h (YG_SB_MIN, YG_SB_MAX, YG_SB_RANGE): Define.
      (xg_create_horizontal_scroll_bar)
      (xg_update_horizontal_scrollbar_pos)
      (xg_set_toolkit_horizontal_scroll_bar_thumb)
      (xg_get_default_scrollbar_height)
      (xg_clear_under_internal_border): Extern.
      * gtkutil.c (xg_frame_resized): Don't call
      do_pending_window_change.
      (xg_frame_set_char_size): Use adjust_frame_size.
      (style_changed_cb): Call update_theme_scrollbar_height and
      x_set_scroll_bar_default_height.
      (x_wm_set_size_hint): Don't call check_frame_size.
      (update_theme_scrollbar_height)
      (xg_get_default_scrollbar_height)
      (xg_create_horizontal_scroll_bar)
      (xg_update_horizontal_scrollbar_pos)
      (xg_set_toolkit_horizontal_scroll_bar_thumb): New functions.
      (xg_create_scroll_bar): Set horizontal slot of bar.
      (xg_initialize): Call update_theme_scrollbar_height.
      (xg_clear_under_internal_border): No more static.
      * insdel.c (adjust_suspend_auto_hscroll): New function.
      (adjust_markers_for_delete, adjust_markers_for_insert)
      (adjust_markers_for_replace): Call adjust_suspend_auto_hscroll.
      * keyboard.c (readable_events, discard_mouse_events)
      (make_lispy_event): Handle horizontal scroll bar click events.
      (Fsuspend_emacs): When changing the size of a tty frame do not
      pass height of menu bar.
      (Qbefore_handle, Qhorizontal_handle, Qafter_handle, Qleft)
      (Qright, Qleftmost, Qrightmost): New symbols.
      * menu.c (Fx_popup_dialog): Use FRAME_TOTAL_LINES instead of
      FRAME_LINES.
      * minibuf.c (read_minibuf): Initialize suspend_auto_hscroll.
      * nsfns.m (x_set_internal_border_width): New function.
      * nsterm.m (ns_draw_fringe_bitmap, ns_set_vertical_scroll_bar):
      Remove extended fringe code.
      (x_set_window_size, x_new_font): Don't call
      compute_fringe_widths.
      * term.c (Fresume_tty): When changing the size of a tty frame do
      not pass height of menu bar.
      (clear_tty_hooks, set_tty_hooks): Clear
      horizontal_scroll_bar_hook.
      (init_tty): Frame has no horizontal scroll bars.
      * termhooks.h (enum scroll_bar_part): Add scroll_bar_move_ratio,
      scroll_bar_before_handle, scroll_bar_horizontal_handle,
      scroll_bar_after_handle, scroll_bar_left_arrow,
      scroll_bar_right_arrow, scroll_bar_to_leftmost and
      scroll_bar_to_rightmost entries.
      (enum event_kind): Add HORIZONTAL_SCROLL_BAR_CLICK_EVENT
      (struct terminal): Add set_horizontal_scroll_bar_hook.
      * w32console.c (initialize_w32_display): Clear
      horizontal_scroll_bar_hook.
      * w32fns.c (x_set_mouse_color): Use FRAME_W32_DISPLAY instead of
      FRAME_X_DISPLAY.
      (x_clear_under_internal_border, x_set_internal_border_width):
      New functions.
      (x_set_menu_bar_lines): Rewrite using frame_inhibit_resize.  Set
      windows_or_buffers_changed when adding the menu bar.
      (x_set_tool_bar_lines): Rewrite using adjust_frame_size.
      (x_change_tool_bar_height, x_set_scroll_bar_default_height)
      (w32_createhscrollbar): New functions.
      (w32_createscrollbar): Rename to w32_createvscrollbar.
      (w32_createwindow): Init WND_HSCROLLBAR_INDEX.
      (w32_name_of_message): Replace WM_EMACS_CREATESCROLLBAR by
      WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR.  Add
      WM_EMACS_SHOWCURSOR.
      (w32_wnd_proc): Handle WM_HSCROLL case.  In WM_WINDOWPOSCHANGING
      case do not artificially impose WM size hints.  Handle
      WM_EMACS_SHOWCURSOR case.  Replace WM_EMACS_CREATESCROLLBAR case
      by WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR
      cases.
      (my_create_tip_window): Replace WND_SCROLLBAR_INDEX by
      WND_VSCROLLBAR_INDEX and WND_HSCROLLBAR_INDEX.
      (unwind_create_frame_1): Remove.
      (Fx_create_frame): Make both scrollbars the system standard
      width and height.  Use official field of frame structure to
      inhibit running window-configuration-change-hook.
      (x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
      pixelwise.  Handle frame's official field.
      (w32_frame_parm_handlers): Remove x_set_fringe_width
      entries. Add x_set_scroll_bar_height,
      x_set_horizontal_scroll_bars, x_set_left_fringe and
      x_set_right_fringe.
      * w32inevt.c (resize_event, maybe_generate_resize_event): Do not
      pass height of menu bar to change_frame_size.
      * w32menu.c (set_frame_menubar): Rewrite using
      frame_inhibit_resize.
      * w32term.h (struct w32_display_info): Add
      horizontal_scroll_bar_cursor and cursor_display_counter.
      (struct scroll_bar): Add horizontal.
      (HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
      (HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
      (HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH)
      (HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
      (HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
      (HORIZONTAL_SCROLL_BAR_TOP_BORDER)
      (HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
      (HORIZONTAL_SCROLL_BAR_MIN_HANDLE): New macros.
      (WM_EMACS_CREATEVSCROLLBAR, WM_EMACS_CREATEHSCROLLBAR): Define
      instead of WM_EMACS_CREATESCROLLBAR.
      (WND_VSCROLLBAR_INDEX, WND_HSCROLLBAR_INDEX): Define instead of
      WND_SCROLLBAR_INDEX.
      * w32term.c (horizontal_scroll_bar_min_handle)
      (horizontal_scroll_bar_left_border)
      (horizontal_scroll_bar_right_border): New integers.
      (x_set_frame_alpha): Replace x_highlight_frame by
      w32_focus_frame.
      (x_window_to_scroll_bar): New argument "type".  Update callers
      accordingly.
      (w32_set_horizontal_scroll_bar_thumb)
      (x_horizontal_scroll_bar_report_motion)
      (w32_set_horizontal_scroll_bar)
      (w32_horizontal_scroll_bar_handle_click)
      (x_horizontal_scroll_bar_report_motion): New functions.
      (w32_mouse_position): Discriminate horizontal and vertical
      scrollbar cases.
      (my_create_scrollbar): Replace with two new functions
      my_create_vscrollbar and my_create_hscrollbar.
      (x_scroll_bar_create): New argument "horizontal".  Update
      callers accordingly.
      (x_scroll_bar_remove, w32_condemn_scroll_bars)
      (w32_redeem_scroll_bar, x_scroll_bar_clear): Handle horizontal
      scroll bar case.
      (w32_read_socket): Handle WM_HSCROLL cae.
      (x_new_font): Don't recompute fringe widths.  Use
      frame_inhibit_resize.  Calculate new menu bar height iff we
      build without toolkit.  Always clear under internal border.
      (x_set_window_size): Don't check frame size or recompute
      fringes.  Reset fullscreen status before applying sizes.  Always
      resize as requested by pixelwise argument.  Don't call
      do_pending_window_change.
      (x_wm_set_size_hint): Add call for FRAME_SCROLL_BAR_AREA_HEIGHT.
      (w32_initialize_display_info): Initialize dpyinfo's
      horizontal_scroll_bar_cursor entry.
      (w32_create_terminal): Add set_horizontal_scroll_bar_hook.
      (w32_initialize): Init horizontal_scroll_bar_min_handle and
      horizontal_scroll_bar_left_border.
      (w32fullscreen_hook): Intermittently resize window to normal
      when switching from fullscreen to maximized state.
      (run_window_configuration_change_hook): Don't run it if frame is
      not official yet.
      (unwind_change_frame): Remove.
      (Fset_window_configuration): Rewrite using frame's official field.
      * widget.c (set_frame_size): Don't call compute_fringe_widths.
      (EmacsFrameSetCharSize): Obey frame_inhibit_resize.
      * window.h (struct window): New fields old_pointm,
      horizontal_scroll_bar, horizontal_scroll_bar_type, hscroll_whole,
      scroll_bar_height and suspend_auto_hscroll.
      (wset_horizontal_scroll_bar, wset_horizontal_scroll_bar_type):
      New functions.
      (sanitize_window_sizes): Extern.
      (MINI_NON_ONLY_WINDOW_P, MINI_ONLY_WINDOW_P, WINDOW_PSEUDO_P)
      (WINDOW_TOPMOST_P, WINDOW_HAS_HORIZONTAL_SCROLL_BAR)
      (WINDOW_CONFIG_SCROLL_BAR_HEIGHT)
      (WINDOW_CONFIG_SCROLL_BAR_LINES)
      (WINDOW_SCROLL_BAR_LINES, WINDOW_SCROLL_BAR_AREA_HEIGHT): New
      macros.
      (WINDOW_LEFT_FRINGE_COLS, WINDOW_RIGHT_FRINGE_COLS)
      (WINDOW_FRINGE_COLS, WINDOW_FRINGE_EXTENDED_P): Remove macros.
      (WINDOW_VERTICAL_SCROLL_BAR_TYPE)
      (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT)
      (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT)
      (WINDOW_HAS_VERTICAL_SCROLL_BAR): Minor rewrite.
      (WINDOW_BOX_HEIGHT_NO_MODE_LINE, WINDOW_BOX_TEXT_HEIGHT)
      (WINDOW_SCROLL_BAR_AREA_Y): Count in scroll bar height.
      * window.c (wset_old_pointm, Fwindow_scroll_bar_height)
      (Fwindow_old_point, sanitize_window_sizes): New functions.
      (Qwindow_sanitize_window_sizes): New symbol.
      (window_body_height): Count in horizontal scroll bar.
      (set_window_hscroll, Fscroll_left, Fscroll_right): Set
      suspend_auto_hscroll slot.
      (Fwindow_inside_edges): Count fringes pixelwise.
      (coordinates_in_window, Fcoordinates_in_window_p): Consider
      horizontal scroll bar.
      (check_frame_size, adjust_window_margins): Remove functions and
      corresponding calls.
      (set_window_buffer): Initialize old_pointm and horizontal scroll
      bars.
      (temp_output_buffer_show): Reset hscroll related fields.
      Initialize old_pointm.
      (make_parent_window): Initialize old_pointm.
      (make_window): Initialize old_pointm, horizontal scroll bar type,
      and scroll bar height.
      (resize_frame_windows): Don't count top margin in new sizes.
      Don't use safe sizes when shrinking a frame; let the window
      manager do the clipping.
      (Fsplit_window_internal): Inherit horizontal scroll bar type and
      height.
      (Fdelete_window_internal): Unchain old_pointm marker.
      (window_scroll_pixel_based, Fscroll_other_window): Adjust
      old_pointm.
      (Fwindow_text_width, Fwindow_text_height): New argument
      "pixelwise".
      (struct saved_window): New fields, old_pointm, hscroll_whole,
      suspend_auto_hscroll, scroll_bar_height and
      horizontal_scroll_bar_type.
      (Fset_window_configuration, save_window_save): Set new fields of
      saved_window.
      (apply_window_adjustment): Don't call adjust_window_margins.
      (set_window_margins): Don't change margins if new sizes don't
      fit into window.
      (set_window_scroll_bars): New argument "horizontal_type".
      Handle horizontal scroll bars.  Don't change scroll bars if they
      don't fit into window.
      (Fset_window_scroll_bars): New argument "horizontal_type".
      (Fwindow_scroll_bars): Return values for horizontal scroll bars.
      (compare_window_configurations): Compare horizontal scroll bar
      settings.
      * xdisp.c (window_text_bottom_y, window_box_height): Count in
      horizontal scroll bar height.
      (pixel_to_glyph_coords, init_xdisp): Use FRAME_TOTAL_LINES
      instead of FRAME_LINES.
      (remember_mouse_glyph): Case ON_SCROLL_BAR changed to
      ON_VERTICAL_SCROLL_BAR.
      (with_echo_area_buffer): Initialize old_pointm.
      (with_echo_area_buffer_unwind_data): Store old_pointm values in
      vector.
      (unwind_with_echo_area_buffer): Handle old_pointm.
      (update_tool_bar): Set do_update when the tool bar window has at
      least one line (since this is what the user sets).
      (MAX_FRAME_TOOL_BAR_HEIGHT): Remove macro.
      (redisplay_tool_bar): Return early when toolbar has zero lines.
      Call x_change_tool_bar_height.  Don't use max_tool_bar_height.
      (hscroll_window_tree): Handle suspension of auto_hscroll and
      old_pointm.
      (set_horizontal_scroll_bar): New function.
      (redisplay_window): Set ignore_mouse_drag_p when tool bar has
      more than one line.  Handle horizontal scroll bars.
      (note_mouse_highlight): Handle horizontal scrol bars.
      (expose_frame): Set dimensions of XRectangle from frame's text
      sizes.
      (Vvoid_text_area_pointer): Update doc-string.
      * xfns.c (x_set_menu_bar_lines): Use adjust_frame_size.
      (x_change_tool_bar_height, x_set_scroll_bar_default_height)
      (x_set_internal_border_width): New functions.
      (x_set_tool_bar_lines): Call x_change_tool_bar_height.
      (unwind_create_frame_1): Remove.
      (Fx_create_frame): Handle horizontal scroll bars.  Use official
      field of frame structure to inhibit running
      window-configuration-change-hook.
      (x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
      pixelwise.  Handle frame's official field.
      (x_frame_parm_handlers): Add x_set_scroll_bar_height,
      x_set_horizontal_scroll_bars, x_set_left_fringe,
      x_set_right_fringe.
      * xmenu.c (update_frame_menubar, free_frame_menubar): Use
      adjust_frame_size.
      * xterm.h (struct x_display_info): Add
      horizontal_scroll_bar_cursor and Xatom_Horizontal_Scrollbar
      slots.
      (struct scroll_bar): Add horizontal slot.
      (HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
      (HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
      (HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH): New macros.
      (HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
      (HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
      (HORIZONTAL_SCROLL_BAR_TOP_BORDER)
      (HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
      (HORIZONTAL_SCROLL_BAR_MIN_HANDLE): Define.
      (x_clear_under_internal_border): Remove.
      * xterm.c (XTmouse_position): Handle horizontal scroll bars.
      (x_window_to_scroll_bar): New argument TYPE.  Update callers.
      (x_send_scroll_bar_event, x_scroll_bar_create): New arguments
      HORIZONTAL.  Update callers.
      (horizontal_action_hook_id): New action hook id.
      (x_horizontal_scroll_bar_to_input_event)
      (x_create_horizontal_toolkit_scroll_bar)
      (xt_horizontal_action_hook)
      (x_set_toolkit_horizontal_scroll_bar_thumb)
      (XTset_horizontal_scroll_bar, x_net_wm_state)
      (x_horizontal_scroll_bar_report_motion): New functions.
      (xg_scroll_callback, x_scroll_bar_handle_click): Handle
      horizontal scroll bars.
      (SCROLL_BAR_HORIZONTAL_NAME): Define.
      (XTset_vertical_scroll_bar): Attempt to clear areas not covered
      by scroll bar.
      (XTcondemn_scroll_bars, XTredeem_scroll_bar): Rewrite.  Handle
      horizontal scroll bars.
      (handle_one_xevent): Handle horizontal scroll bar events.  Call
      x_net_wm_state.
      (x_set_window_size_1, x_wm_set_size_hint): Don't call
      check_frame_size.
      (x_set_window_size): Don't call check_frame_size and
      do_pending_window_change.
      (x_term_init): Init horizontal_scroll_bar_cursor display info.
      (x_create_terminal): Add set_horizontal_scroll_bar_hook.
      (x_scroll_bar_set_handle): Add some checks when calling
      x_clear_area.
      3477e270
  7. 08 Jun, 2014 1 commit
    • Paul Eggert's avatar
      If a C name must be extern on some platforms, make it extern on all. · ff2d0e83
      Paul Eggert authored
      * dispextern.h (set_vertical_scroll_bar, erase_phys_cursor)
      (load_color):
      * font.h (ftxfont_driver) [HAVE_XFT]:
      * keyboard.h (menu_items_inuse, ignore_mouse_drag_p, make_ctrl_char):
      * lisp.h (get_frame_param):
      * menu.h (tty_menu_show):
      * process.h (conv_sockaddr_to_lisp, catch_child_signal):
      * termhooks.h (encode_terminal_code):
      * xterm.h (x_menu_wait_for_event):
      Always declare.
      * frame.c (get_frame_param):
      * fringe.c (max_used_fringe_bitmap):
      * ftxfont.c (ftxfont_driver):
      * keyboard.c (ignore_mouse_drag_p, make_ctrl_char):
      * menu.c (menu_items_inuse):
      * process.c (conv_sockaddr_to_lisp, catch_child_signal):
      * term.c (encode_terminal_code, tty_menu_show):
      * xdisp.c (set_vertical_scroll_bar, erase_phys_cursor):
      * xfaces.c (load_color):
      * xmenu.c (x_menu_wait_for_event):
      Now always extern.
      ff2d0e83
  8. 04 Jun, 2014 2 commits
    • Dmitry Antipov's avatar
      Use terminal-specific hooks to display popup dialogs. · 680a6ad9
      Dmitry Antipov authored
      * termhooks.h (struct terminal): New field popup_dialog_hook.
      * menu.c (emulate_dialog_with_menu): New function, refactored from ...
      (Fx_popup_dialog): ... adjusted user.  Also remove old #if 0
      code and use popup_dialog_hook.
      * nsmenu.m (ns_popup_dialog): Make hook-compatible.
      * nsterm.h (ns_popup_dialog): Adjust prototype.
      * nsterm.m (ns_create_terminal):
      * w32term.c (w32_create_terminal):
      * xterm.c (x_create_terminal) [USE_X_TOOLKIT || USE_GTK]: Setup
      popup_dialog_hook.
      680a6ad9
    • Dmitry Antipov's avatar
      Use terminal-specific hooks to display menus. · cfd794af
      Dmitry Antipov authored
      * termhooks.h (struct terminal): New field menu_show_hook.
      * menu.h (<anonymous enum>): Bit flags for menu hooks.
      (x_menu_show, w32_menu_show, ns_menu_show, tty_menu_show):
      Adjust prototypes.
      * menu.c (Fx_popup_menu): Use bit flags and menu_show_hook.
      * nsmenu.m (ns_menu_show):
      * w32menu.c (w32_menu_show):
      * xmenu.c (x_menu_show):
      * term.c (tty_menu_show): Adjust to use bit flags.
      (set_tty_hooks): Set menu_show_hook.
      * xterm.c (x_create_terminal):
      * nsterm.m (ns_create_terminal):
      * msdos.c (initialize_msdos_display):
      * w32term.c (w32_create_terminal): Likewise.
      cfd794af
  9. 14 May, 2014 1 commit
    • Dmitry Antipov's avatar
      Minor cleanup for terminal setup. · 6f1d9822
      Dmitry Antipov authored
      * termhooks.h (create_terminal): Adjust prototype.
      * terminal.c (create_terminal): Pass output method and RIF as args.
      (init_initial_terminal):
      * nsterm.m (ns_create_terminal):
      * term.c (init_tty):
      * w32term.c (w32_create_terminal):
      * xterm.c (x_create_terminal): Adjust users.
      Avoid redundant NULL initializers and add comments.
      6f1d9822
  10. 16 Apr, 2014 1 commit
    • Eli Zaretskii's avatar
      Fix the MSDOS build. · bf6b4923
      Eli Zaretskii authored
       src/unexcoff.c [MSDOS]: Include libc/atexit.h.
       (copy_text_and_data): Zero out the atexit chain pointer before
       dumping Emacs.
       src/termhooks.h (encode_terminal_code): Update prototype.
       src/term.c (encode_terminal_code) [DOS_NT]: Make it externally
       visible for all DOS_NT ports, not just WINDOWSNT.
       (syms_of_term) [!MSDOS]: Don't define 'tty-menu-*' symbols on MSDOS.
       src/sysdep.c (emacs_sigaction_init, init_signals): Don't use SIGCHLD
       unless it is defined.
       (emacs_pipe) [MSDOS]: Redirect to 'pipe'.
       src/process.c (close_on_exec, accept4, process_socket): Move into
       the "ifdef subprocesses" part.
       (catch_child_signal): Condition by "ifdef subprocesses".
       (syms_of_process) <Qinternal_default_process_sentinel>
       <Qinternal_default_process_filter>: Condition by "ifdef subprocesses".
       src/msdos.h: Add prototypes for new functions.
       (EINPROGRESS): Define.
       (O_CLOEXEC): Define to zero.
       src/msdos.c (check_window_system): Remove unnecessary an
       incompatible duplicate function.
       (sys_opendir, readlinkat, faccessat, fstatat, unsetenv): New
       functions in support of new functionality.
       src/menu.c (single_menu_item): Add visual indication  of submenu
       also for menus on MSDOS frames.
       (Fx_popup_menu) [!MSDOS]: Do not call tty_menu_show on MSDOS.
       src/lisp.h (CHECK_PROCESS) [!subprocesses]: Do not define
       when async subprocesses aren't supported.
       src/font.h (FONT_WIDTH) [MSDOS]: MSDOS-specific definition.
       src/emacs.c (close_output_streams): Zero out errno before calling
       close_stream.
       src/dired.c [MSDOS]: Include msdos.h.
       src/conf_post.h (opendir) [MSDOS]: Redirect to sys_opendir.
       (DATA_START) [MSDOS]: Define.
       (SYSTEM_PURESIZE_EXTRA) [MSDOS]: Enlarge by 25K.
       src/callproc.c (block_child_signal, unblock_child_signal) [MSDOS]:
       Ifdef away for MSDOS.
       (record_kill_process) [MSDOS]: Ifdef away the entire body for MSDOS.
       (call_process_cleanup) [MSDOS]: Ifdef away portions not relevant
       for MSDOS.
       (call_process) [MSDOS]: Fix call sequence of dostounix_filename.
       Use temporary file template that is compatible with mkostemp.
       Move vfork-related portions under #ifndef MSDOS.
       (syms_of_callproc): Unify templates of MSDOS and WINDOWSNT.
      
       lisp/term/pc-win.el (x-list-fonts, x-get-selection-value): Provide
       doc strings, as required by snarf-documentation.
      
       msdos/sedlisp.inp:
       msdos/sedlibmk.inp:
       msdos/sedleim.inp:
       msdos/sed3v2.inp:
       msdos/sed2v2.inp:
       msdos/sed1v2.inp: Update Sed scripts for Emacs 24.4.
       msdos/inttypes.h: Add PRIdMAX.
       msdos/INSTALL: Update for Emacs 24.4.
       msdos/sedadmin.inp: New file.
      bf6b4923
  11. 01 Jan, 2014 1 commit
  12. 18 Oct, 2013 1 commit
    • Dmitry Antipov's avatar
      Remove port-specific display name lists to avoid extra · d141d701
      Dmitry Antipov authored
      complexity and data duplication with display info lists.
      * xterm.h (x_display_name_list): Remove declaration.
      * xterm.c (x_display_name_list): Remove.
      (x_term_init, x_delete_display, syms_of_xterm): Adjust users.
      * xfns.c (x_display_info_for_name, Fx_display_list):
      Likewise.  Use x_display_list where appropriate.
      * w32term.h (w32_display_name_list): Remove declaration.
      * w32term.c (w32_display_name_list): Remove.
      (w32_initialize_display_info, x_delete_display, syms_of_w32term):
      Adjust users.
      * w32fns.c (x_display_info_for_name, Fx_display_list):
      Likewise.  Use x_display_list where appropriate.
      * nsterm.h (ns_display_name_list): Remove declaration.
      * nsterm.m (ns_display_name_list): Remove.
      (ns_term_init, syms_of_nsterm): Adjust users.
      * nsfns.m (ns_display_info_for_name, Fx_display_list):
      Likewise.  Use x_display_list where appropriate.
      * termhooks.h (TERMINAL_FONT_CACHE): New macro.
      * alloc.c (toplevel) [HAVE_WINDOW_SYSTEM]: Include TERM_HEADER.
      (mark_terminals): Mark per-terminal font cache.
      d141d701
  13. 17 Oct, 2013 1 commit
    • Paul Eggert's avatar
      Make some functions static in non-Microsoft builds. · 3d798ba7
      Paul Eggert authored
      On my platform (Fedora 19 x86-64), this shrinks the
      Emacs executable (text+data) by 0.25%.
      * dispextern.h (erase_phys_cursor) [!WINDOWSNT]:
      (load_color) [!MSDOS]:
      * gnutls.h (emacs_gnutls_transport_set_errno) [!WINDOWSNT]:
      * keyboard.h (make_ctrl_char) [!WINDOWSNT]:
      * lisp.h (check_existing):
      * process.h (conv_sockaddr_to_lisp, network_interface_list)
      (network_interface_info) [!WINDOWSNT]:
      * termhooks.h (encode_terminal_code) [!WINDOWSNT]:
      Remove extern decls.
      * fileio.c (check_existing):
      * keyboard.c (make_ctrl_char) [!WINDOWSNT]:
      * process.c (conv_sockaddr_to_lisp, network_interface_list)
      (network_interface_info) [!WINDOWSNT]:
      * term.c (encode_terminal_code) [!WINDOWSNT]:
      * xdisp.c (erase_phys_cursor) [!WINDOWSNT]:
      * xfaces.c (load_color) [!MSDOS]:
      Now static.
      * fileio.c (check_existing, check_executable, check_writable):
      * process.c (network_interface_list, network_interface_info):
      Move earlier, so that we don't need forward decls.
      * gnutls.c (fn_gnutls_transport_set_errno)
      (emacs_gnutls_transport_set_errno) [!WINDOWNT]:
      Remove; unused.
      * w32.c (init_environment): Use faccessat rather than
      check_existing, partly for consistency with the rest of the code
      in this file, partly so that check_existing can be static.
      3d798ba7
  14. 15 Oct, 2013 1 commit
  15. 14 Oct, 2013 2 commits
    • Dmitry Antipov's avatar
      * termhooks.h (FRAME_MUST_WRITE_SPACES, FRAME_LINE_INS_DEL_OK) · 77e3b1b7
      Dmitry Antipov authored
      (FRAME_CHAR_INS_DEL_OK, FRAME_SCROLL_REGION_OK)
      (FRAME_SCROLL_REGION_COST, FRAME_MEMORY_BELOW_FRAME):
      Adjust to match the change described below.
      (struct terminal): Move must_write_spaces, line_ins_del_ok,
      char_ins_del_ok, scroll_region_ok, scroll_region_cost and
      memory_below_frame members to...
      * termchar.h (struct tty_display_info): ...here because they're
      relevant only on TTYs.  Prefer unsigned bitfield where appropriate.
      * term.c (init_tty):
      * nsterm.m (ns_create_terminal):
      * w32term.c (w32_create_terminal):
      * xterm.c (x_create_terminal): Adjust users.
      * dispnew.c (line_hash_code, line_draw_cost): Pass frame arg
      to filter out non-TTY frames.  Adjust comment.
      (scrolling): Adjust user.  Prefer eassert for debugging check.
      77e3b1b7
    • Dmitry Antipov's avatar
      * xfaces.c (PT_PER_INCH): Remove unused macro. · e558436b
      Dmitry Antipov authored
      * termhooks.h (struct terminal): Remove set-but-unused
      member fast_clear_end_of_line.
      (FRAME_FAST_CLEAR_END_OF_LINE): Remove.
      * nsterm.m (ns_create_terminal):
      * term.c (init_tty):
      * w32term.c (w32_create_terminal):
      * xterm.c (x_create_terminal): Adjust users.
      e558436b
  16. 20 Sep, 2013 1 commit
    • Paul Eggert's avatar
      A simpler, centralized INLINE. · 00382e8b
      Paul Eggert authored
      * lib-src/profile.c (INLINE): New macro.
      (SYSTIME_INLINE): Remove.
      * src/conf_post.h (INLINE): Define only if not already defined.
      This allows us to use a single INLINE, defined by one file
      per executable.
      * src/emacs.c (INLINE): Define it.
      Also, include category.h, charset.h, composite.h, dispextern.h,
      syntax.h, systime.h, so that their INLINE definitions are expanded
      properly for Emacs.
      * src/blockinput.h, src/keyboard.c (BLOCKINPUT_INLINE):
      * src/buffer.h, src/buffer.c (BUFFER_INLINE):
      * src/category.h, src/category.c (CATEGORY_INLINE):
      * src/character.h, src/character.c (CHARACTER_INLINE):
      * src/charset.h, src/charset.c (CHARSET_INLINE):
      * src/composite.h, src/composite.c (COMPOSITE_INLINE):
      * src/dispextern.h, src/dispnew.c (DISPEXTERN_INLINE):
      * src/frame.h, src/frame.c (FRAME_INLINE):
      * src/intervals.h, src/intervals.c (INTERVALS_INLINE):
      * src/keyboard.h, src/keyboard.c (KEYBOARD_INLINE):
      * src/lisp.h, src/alloc.c (LISP_INLINE):
      * src/process.h, src/process.c (PROCESS_INLINE):
      * src/syntax.h, src/syntax.c (SYNTAX_INLINE):
      * src/systime.h, src/sysdep.c (SYSTIME_INLINE):
      * src/termhooks.h, src/terminal.h (TERMHOOKS_INLINE):
      * src/window.h, src/window.c (WINDOW_INLINE):
      Remove.  All uses replaced with INLINE.
      00382e8b
  17. 11 Sep, 2013 2 commits
    • Dmitry Antipov's avatar
      * termhooks.h (fullscreen_hook): Remove the leftover. · fb55b9d1
      Dmitry Antipov authored
      (struct terminal): Fix typo in comment.
      fb55b9d1
    • Dmitry Antipov's avatar
      Cleaning up a few X scroll bar bits. · 927eec55
      Dmitry Antipov authored
      * termhooks.h (enum scroll_bar_part): Add scroll_bar_nowhere member.
      * xterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS && USE_LUCID]:
      New member last_seen_part, going to replace...
      * xterm.c [USE_TOOLKIT_SCROLL_BARS]: ...global last_scroll_bar_part.
      (xt_action_hook) [USE_LUCID]: Adjust user.
      (xm_scroll_callback, xg_scroll_callback): Do not bloat with
      Lucid-specific scroll bar support.
      (xaw_jump_callback, xaw_scroll_callback): Prefer enum scroll_par_part
      to int and adjust to use last_seen_part member.
      (x_set_toolkit_scroll_bar_thumb) [USE_LUCID]: Adjust user.
      (x_scroll_bar_create) [USE_TOOLKIT_SCROLL_BARS && USE_LUCID]:
      Initialize last_seen_part.
      927eec55
  18. 05 Sep, 2013 1 commit
  19. 30 Aug, 2013 1 commit
    • Dmitry Antipov's avatar
      Minor cleanup to avoid forward declarations. · 9d7693d7
      Dmitry Antipov authored
      * coding.h (struct ccl_spec): Remove forward declaration.
      * composite.h (toplevel): Include font.h.
      (struct composition_it, struct face, struct font_metrics):
      Remove forward declaration.
      * dispextern.h (struct image, struct atimer): Likewise.
      * emacsgtkfixed.h (struct frame): Likewise.
      * emacsgtkfixed.c (toplevel): Reorder headers and drop stdio.h.
      * font.h (struct font_driver, struct font, struct glyph_string)
      (struct face): Remove forward declaration.
      * fontset.h (struct face, struct font): Likewise.
      * frame.h (toplevel): Style cleanup.
      (enum output_method): Move to...
      * termhooks.h (enum output_method): ...here.
      (struct glyph, struct frame, struct ns_display_info)
      (struct x_display_info, struct w32_display_info):
      Remove forward declaration.
      * xterm.h (toplevel): Include termhooks.h.
      (struct font, struct window, struct glyph_matrix, struct frame)
      (struct input_event, struct face, struct image): Remove forward
      declaration.
      * gtkutil.h (struct _widget_value): Likewise.
      * keyboard.h (toplevel): Include termhooks.h.
      (struct input_event): Remove forward declaration.
      9d7693d7
  20. 16 Jul, 2013 1 commit
    • Jan Djärv's avatar
      Stop cursor blink after blink-cursor-blinks (10), stop timers when not blinking. · 18c26d81
      Jan Djärv authored
      * etc/NEWS: Document blink-cursor-blinks and blink timers stopped.
      
      * lisp/frame.el (blink-cursor-blinks): New defcustom.
      (blink-cursor-blinks-done): New defvar.
      (blink-cursor-start): Set blink-cursor-blinks-done to 1.
      (blink-cursor-timer-function): Check if number of blinks has been
      done on X and NS.
      (blink-cursor-suspend, blink-cursor-check): New defuns.
      
      * src/frame.c (Fhandle_focus_in, Fhandle_focus_out): New functions.
      (Fhandle_switch_frame): Call Fhandle_focus_in.
      (syms_of_frame): defsubr handle-focus-in/out.
      
      * src/keyboard.c (Qfocus_in, Qfocus_out): New static objects.
      (make_lispy_focus_in, make_lispy_focus_out): Declare and define.
      (kbd_buffer_get_event): For FOCUS_IN, make a focus_in event if no
      switch frame event is made.  Check ! NILP (event->arg) if X11 (moved
      from xterm.c). Make focus_out event for FOCUS_OUT_EVENT if NS or X11
      and there is a focused frame.
      (head_table): Add focus-in and focus-out.
      (keys_of_keyboard): Add focus-in and focus-out to Vspecial_event_map,
      bind to handle-focus-in/out.
      
      * src/nsterm.m (windowDidResignKey): If this is the focused frame, generate
      FOCUS_OUT_EVENT.
      
      * src/termhooks.h (enum event_kind): Add FOCUS_OUT_EVENT.
      
      * src/xterm.c (x_focus_changed): Always generate FOCUS_IN_EVENT.
      Set event->arg to Qt if switch-event shall be generated.
      Generate FOCUS_OUT_EVENT for FocusOut if this is the focused frame.
      18c26d81
  21. 11 Jul, 2013 1 commit
    • Paul Eggert's avatar
      * sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes. · 653d4f43
      Paul Eggert authored
      * sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
      (emacs_set_tty): Now static.
      * sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
      * term.c (tty_capable_p, tty_default_color_capabilities)
      (get_tty_terminal, term_mouse_movement)
      (handle_one_term_event, init_tty, maybe_fatal):
      * termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
      (tgetent, scan_file, name_match, compare_contin):
      * terminal.c (get_terminal):
      Use bool for boolean.
      * sysdep.c (init_system_name): Don't overflow stack on huge hostname.
      Prefer char to unsigned char if either will do.
      * term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
      (tty_write_glyphs): Prefer int to unsigned.
      (produce_glyphless_glyph): Remove 2nd (unused) int arg.
      All callers changed.
      * termcap.c (tprint, main) [TEST]: Remove non-working test.
      653d4f43
  22. 03 Jun, 2013 1 commit
    • Michael Albinus's avatar
      * configure.ac (file-notification): New option, replaces inotify option. · c9628c79
      Michael Albinus authored
      (HAVE_W32): Remove w32notify.o.
      (with_file_notification): Add checks for glib and w32. Adapt check
      for inotify.
      (Summary): Add entry for file notification.
      
      * autogen/config.in: Add entries for HAVE_GFILENOTIFY,
      HAVE_W32NOTIFY and USE_FILE_NOTIFY.
      
      * lisp/autorevert.el (auto-revert-notify-enabled)
      (auto-revert-notify-rm-watch, auto-revert-notify-add-watch)
      (auto-revert-notify-event-p, auto-revert-notify-event-file-name)
      (auto-revert-notify-handler): Handle also gfilenotify.
      
      * lisp/subr.el: (file-notify-handle-event): New defun. Replacing ...
      (inotify-event-p, inotify-handle-event, w32notify-handle-event):
      Removed.
      
      * src/Makefile.in (NOTIFY_OBJ): New variable.
      (base_obj): Replace inotify.o by $(NOTIFY_OBJ).
      
      * src/emacs.c (main): Use HAVE_W32NOTIFY to wrap respective code.
      Call syms_of_gfilenotify.
      
      * src/gfilenotify.c: New file.
      
      * src/keyboard.c (Qfile_notify): New variable.  Replaces Qfile_inotify
      and Qfile_w32notify.
      (top): Wrap respective code by HAVE_GFILENOTIFY, HAVE_INOTIFY,
      HAVE_W32NOTIFY and USE_FILE_NOTIFY.
      
      * src/lisp.h: Declare syms_of_gfilenotify.
      
      * src/termhooks.h (e): Wrap enum by USE_FILE_NOTIFY.
      c9628c79
  23. 11 Mar, 2013 1 commit
  24. 01 Jan, 2013 1 commit
  25. 10 Dec, 2012 2 commits
    • Eli Zaretskii's avatar
      2b8c9064
    • Rüdiger Sonderfeld's avatar
      Support filesystem notification through inotify on GNU/Linux. · 81606b10
      Rüdiger Sonderfeld authored
       configure.ac (inotify): New option.
       (HAVE_INOTIFY): Test for inotify.
      
       src/termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add
       FILE_NOTIFY_EVENT.
       src/lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
       src/keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
       (syms_of_keyboard): DEFSYM it.
       (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
       (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
       Qfile_inotify events.
       (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
       special-event-map to inotify-handle-event.
       src/emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
       src/Makefile.in (base_obj): Add inotify.o.
       src/inotify.c: New file.
      
       lisp/subr.el (inotify-event-p, inotify-handle-event): New functions.
      
       test/automated/inotify-test.el: New test.
      81606b10
  26. 12 Nov, 2012 1 commit
  27. 02 Nov, 2012 1 commit
    • Dmitry Antipov's avatar
      Remove pad from struct input_event. · 2b371ff7
      Dmitry Antipov authored
      * termhooks.h (struct input_event): Remove padding field.
      Adjust comment.
      * keyboard.c (event_to_kboard): Simplify because frame_or_window
      member is never cons for a long time.  Adjust comment.
      (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
      SELECTION_CLEAR_EVENT has no Lisp_Objects to mark.  Add comment.
      * xterm.c (handle_one_xevent): Do not initialize frame_or_window
      field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
      2b371ff7
  28. 08 Oct, 2012 1 commit
  29. 06 Oct, 2012 1 commit
    • Eli Zaretskii's avatar
      Initial version of the w32notify code. · 477f1e50
      Eli Zaretskii authored
      Adding and removing a watch seems to work: a new thread is launched
      when a watch is added and exits when the watch is removed.
      But there are no notifications, so it seems.  At least, the Lisp
      callback function passed to w32notify-add-watch is not called.
      477f1e50
  30. 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
  31. 20 Sep, 2012 1 commit
    • Paul Eggert's avatar
      Omit unused arg EXPECTED from socket hooks. · f75beb47
      Paul Eggert authored
      * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
      * nsterm.m (ns_term_init):
      * termhooks.h (struct terminal.read_socket_hook):
      * w32inevt.c (w32_console_read_socket):
      * w32term.c (w32_read_socket):
      * xterm.c (XTread_socket):
      Omit unused arg EXPECTED.  All callers changed.
      (store_user_signal_events): Return void, not int, since callers no
      longer care about the return value.  All uses changed.
      f75beb47
  32. 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
  33. 18 Aug, 2012 1 commit
    • Paul Eggert's avatar
      * termhooks.h (TSET): Remove. · 3f22b86f
      Paul Eggert authored
      Replace all uses with calls to new setter functions.
      Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
      (TERMHOOKS_INLINE): New macro.
      (tset_charset_list, tset_selection_alist): New setter functions.
      * terminal.c (TERMHOOKS_INLINE):
      Define to EXTERN_INLINE, so that the corresponding functions
      are compiled into code.
      (tset_param_alist): New setter function.
      
      Fixes: debbugs:12215
      3f22b86f
  34. 09 Aug, 2012 1 commit