1. 22 Sep, 2013 2 commits
    • Eli Zaretskii's avatar
      Fix bug #15365 with aborts in try_window_id. · 76880d88
      Eli Zaretskii authored
       src/xdisp.c (try_window_id): Don't abort if cursor row could not be
       found (which can legitimately happen when the glyph row at the
       window start is disabled in the current_matrix.
      76880d88
    • Paul Eggert's avatar
      Fix syntax.h bug introduced by recent INLINE change. · c6cfd910
      Paul Eggert authored
      syntax.h defined an extern inline function SYNTAX_ENTRY that was
      conditionally compiled one way in some modules, and a different
      way in others.  This doesn't work with extern inline functions,
      which must have the same definition in all modules, because the
      defining code might be shared across modules, depending on the
      implementation.  Symptoms reported by Martin Rudalics in:
      http://lists.gnu.org/archive/html/emacs-devel/2013-09/msg00414.html
      * regex.c, syntax.c (SYNTAX_ENTRY_VIA_PROPERTY): Remove.
      (SYNTAX, SYNTAX_ENTRY, SYNTAX_WITH_FLAGS): New macros,
      overriding the corresponding functions in syntax.h.
      * syntax.h (syntax_property_entry, syntax_property_with_flags)
      (syntax_property): New inline functions.
      (SYNTAX_ENTRY, SYNTAX_WITH_FLAGS, SYNTAX):
      Rewrite in terms of these new functions.
      c6cfd910
  2. 21 Sep, 2013 1 commit
  3. 20 Sep, 2013 3 commits
    • Paul Eggert's avatar
      Port recent change to hosts where pointers aren't 'long'. · e3b29769
      Paul Eggert authored
      * xterm.c (x_send_scroll_bar_event, x_scroll_bar_to_input_event):
      Don't assume that pointers are the same width as 'long'.
      Add a compile-time check that a pointer fits into two X slots.
      e3b29769
    • 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
    • Dmitry Antipov's avatar
      * xterm.c (handle_one_xevent): Revert part of 2013-09-17 change · 2b943ba6
      Dmitry Antipov authored
      to avoid Bug#15398.
      2b943ba6
  4. 19 Sep, 2013 3 commits
    • Eli Zaretskii's avatar
      Fix a compiler warning on MS-Windows due to recent changes. · 13d9698a
      Eli Zaretskii authored
       src/w32reg.c (w32_get_string_resource): Make the first 2 arguments
       'const char *' to avoid compiler warnings due to similar change in
       the prototype of x_get_string_resource.
      13d9698a
    • Dmitry Antipov's avatar
      * xterm.h (struct x_display_info): New members last_mouse_glyph_frame, · ced135eb
      Dmitry Antipov authored
      last_mouse_scroll_bar, last_mouse_glyph and last_mouse_movement_time,
      going to replace static variables below.  Adjust comments.
      * xterm.c (last_mouse_glyph, last_mouse_glyph_frame)
      (last_mouse_scroll_bar, last_mouse_movement_time): Remove.
      (note_mouse_movement, XTmouse_position, x_scroll_bar_note_movement)
      (x_scroll_bar_report_motion, handle_one_xevent, syms_of_xterm):
      Related users changed.
      * w32term.h (struct w32_display_info): New members last_mouse_glyph_frame,
      last_mouse_scroll_bar, last_mouse_scroll_bar_pos, last_mouse_glyph and
      last_mouse_movement_time, going to replace static variables below.
      Adjust comments.
      * w32term.c (last_mouse_glyph_frame, last_mouse_scroll_bar)
      (last_mouse_scroll_bar_pos, last_mouse_glyph, last_mouse_movement_time):
      Remove.
      (note_mouse_movement, w32_mouse_position, w32_scroll_bar_handle_click)
      (x_scroll_bar_report_motion, syms_of_w32term): Related users changed.
      * nsterm.h (struct ns_display_info): New members last_mouse_glyph,
      last_mouse_movement_time and last_mouse_scroll_bar, going to replace
      static variables below.
      * nsterm.m (last_mouse_glyph, last_mouse_movement_time)
      (last_mouse_scroll_bar): Remove.
      (note_mouse_movement, ns_mouse_position, mouseMoved, mouseEntered)
      (mouseExited): Related users changed.
      ced135eb
    • Dmitry Antipov's avatar
      Do not use external array to process X scroll bar messages. · 091f1e1f
      Dmitry Antipov authored
      * xterm.c (scroll_bar_windows, scroll_bar_windows_size): Remove.
      (x_send_scroll_bar_event): Pack window pointer into two slots
      of XClientMessageEvent if we're 64-bit.  Adjust comment.
      (x_scroll_bar_to_input_event): Unpack accordingly.
      091f1e1f
  5. 18 Sep, 2013 3 commits
    • Dmitry Antipov's avatar
      Ifdef away recent changes which aren't relevant to NS port. · 582ed56c
      Dmitry Antipov authored
      * dispextern.h (x_mouse_grabbed, x_redo_mouse_highlight)
      [!HAVE_NS]: Declare as such.
      * frame.c (x_mouse_grabbed, x_redo_mouse_highlight)
      [!HAVE_NS]: Define as such.
      582ed56c
    • Dmitry Antipov's avatar
      * frame.c (x_redo_mouse_highlight): New function · 18da0d8a
      Dmitry Antipov authored
      to factor out common code used in W32 and X ports.
      * dispextern.h (x_redo_mouse_highlight): Add prototype.
      * xterm.h (struct x_display_info):
      * w32term.h (struct w32_display_info):
      * nsterm.h (struct ns_display_info): New members
      last_mouse_motion_frame, last_mouse_motion_x and
      last_mouse_motion_y, going to replace static variables below.
      * xterm.c (last_mouse_motion_event, last_mouse_motion_frame)
      (redo_mouse_highlight): Remove.
      (note_mouse_movement, syms_of_xterm): Adjust user.
      (handle_one_xevent): Likewise.  Use x_redo_mouse_highlight.
      * w32term.c (last_mouse_motion_event, last_mouse_motion_frame)
      (redo_mouse_highlight): Remove.
      (note_mouse_movement, syms_of_w32term): Adjust user.
      (w32_read_socket): Likewise.  Use x_redo_mouse_highlight.
      * nsterm.m (last_mouse_motion_position, last_mouse_motion_frame):
      Remove.
      (note_mouse_movement, mouseMoved, syms_of_nsterm):
      * nsfns.m (compute_tip_xy): Adjust user.
      18da0d8a
    • Dmitry Antipov's avatar
      * frame.c (x_mouse_grabbed): New function. · 7a0c745a
      Dmitry Antipov authored
      * dispextern.h (x_mouse_grabbed): Add prototype.
      (last_mouse_frame): Remove declaration.
      * xterm.h (struct x_display_info):
      * w32term.h (struct w32_display_info):
      * nsterm.h (struct ns_display_info): New member
      last_mouse_frame, going to replace...
      * xdisp.c (last_mouse_frame): ...global variable.
      (note_tool_bar_highlight):
      * w32term.c (w32_mouse_position, w32_read_socket):
      * xterm.c (XTmouse_position, handle_one_xevent):
      Use x_mouse_grabbed.
      * nsterm.m (ns_mouse_position, mouseDown): Adjust user.
      7a0c745a
  6. 17 Sep, 2013 9 commits
    • Dmitry Antipov's avatar
      * w32term.c (w32_read_socket): Avoid temporary · 0791d107
      Dmitry Antipov authored
      variables in a call to x_real_positions.
      * xterm.c (handle_one_xevent): Likewise.
      0791d107
    • Dmitry Antipov's avatar
      * frame.h (x_set_bitmap_icon) [!HAVE_NS]: New function. · 2cd98812
      Dmitry Antipov authored
      (x_icon_type): Remove prototype.
      (x_bitmap_icon) [!HAVE_NS]: Declare as such.
      * frame.c (x_icon_type): Remove.
      * w32term.c (x_make_frame_visible, x_iconify_frame):
      * xterm.c (x_make_frame_visible, x_iconify_frame):
      Use x_set_bitmap_icon to factor out common code.
      2cd98812
    • Dmitry Antipov's avatar
      * dispextern.h (check_x_display_info, x_get_string_resource): · a6c2ee1b
      Dmitry Antipov authored
      Declare here just once and unify the latter.
      * frame.c (check_x_display_info, x_get_string_resource):
      * nsterm.h (check_x_display_info):
      * xrdb.c (x_get_string_resource):
      * xterm.h (check_x_display_info): Remove prototypes.
      * nsfns.m (x_get_string_resource): Likewise.  Adjust definition.
      * w32reg.c (x_get_string_resource): Likewise.
      (w32_get_rdb_resource): Adjust user.
      a6c2ee1b
    • Dmitry Antipov's avatar
      * xterm.h (struct x_display_info): New member · baed3603
      Dmitry Antipov authored
      x_pending_autoraise_frame, going to replace...
      * xterm.c (pending_autoraise_frame): ...static variable.
      (x_new_focus_frame, XTread_socket): Adjust users.
      * w32term.h (struct w32_display_info): New member
      w32_pending_autoraise_frame, going to replace...
      * w32term.c (pending_autoraise_frame): ...global variable.
      (x_new_focus_frame, w32_read_socket): Adjust users.
      baed3603
    • Glenn Morris's avatar
      Add a major-mode for the *Messages* buffer · 90582f05
      Glenn Morris authored
      Ref: http://lists.gnu.org/archive/html/emacs-devel/2010-02/msg00135.html
      
      * lisp/simple.el (messages-buffer-mode): New major mode.
      (messages-buffer): New function.
      
      * lisp/startup.el (normal-top-level): Switch mode of *Messages* buffer.
      
      * src/xdisp.c (message_dolog): If we create *Messages*,
      switch it to messages-buffer-mode.
      
      * lisp/emacs-lisp/ert.el (ert--force-message-log-buffer-truncation)
      (ert-run-test): Use `message-buffer' function.
      (ert--force-message-log-buffer-truncation): Ignore read-only.
      
      * lisp/help.el (view-echo-area-messages): Use `message-buffer' function.
      
      * lisp/mail/emacsbug.el (report-emacs-bug): Use `message-buffer' function.
      
      * lisp/gnus/gnus-util.el (gnus-message-with-timestamp-1):
      Use `message-buffer' function if available.  Ignore read-only.
      
      * etc/NEWS: Mention this.
      90582f05
    • Dmitry Antipov's avatar
    • Paul Eggert's avatar
      Don't overuse 'const' in types of locals. · b7ad2f74
      Paul Eggert authored
      * bidi.c (bidi_count_bytes):
      * gtkutil.c, gtkutil.h (xg_event_is_for_menubar)
      (xg_event_is_for_scrollbar):
      * xselect.c (x_handle_property_notify)
      (x_handle_selection_notify, x_handle_dnd_message):
      * xsettings.c, xsettings.h (xft_settings_event):
      * xterm.c (x_handle_net_wm_state, handle_one_event)
      (x_menubar_window_to_frame, x_detect_focus_change)
      (construct_mouse_click, note_mouse_movement)
      (x_scroll_bar_to_input_event, x_scroll_bar_expose)
      (x_scroll_bar_handle_click, x_scroll_bar_note_movement)
      (handle_one_xevent, x_handle_net_wm_state):
      * xterm.h (x_handle_property_notify, x_handle_selection_notify)
      (x_handle_dnd_message):
      Avoid unnecessary 'const', typically the second 'const' in
      'const foo * const arg', a 'const' that does not affect the API
      and doesn't significantly help the human reader.
      b7ad2f74
    • Dmitry Antipov's avatar
      * xterm.c (handle_one_xevent): Do not call to x_clear_area · 1893694e
      Dmitry Antipov authored
      if GTK >= 2.7.0.
      1893694e
    • Dmitry Antipov's avatar
      * configure.ac: Do not check for g_type_init because we · 19452b86
      Dmitry Antipov authored
      require glib >= 2.28 for GTK3, glib >= 2.10 for GTK2,
      glib >= 2.26 for GSettings and glib >= 2.7.0 for GConf, so
      suitable glib should provide g_type_init unconditionally.
      * src/image.c (fn_g_type_init) [WINDOWSNT]: Define and load
      only if Glib < 2.36.0.
      (fn_g_type_init) [!WINDOWSNT]: Define only if Glib < 2.36.0.
      * src/xsettings.c (init_gconf, init_gsettings): Do not check
      for g_type_init.
      19452b86
  7. 16 Sep, 2013 5 commits
    • Jan Djärv's avatar
      * xsettings.c (init_gconf, init_gsettings): Check for Glib 2.36.0 · 3f386383
      Jan Djärv authored
      before calling g_type_init.
      3f386383
    • Jan Djärv's avatar
      Fix syms_of_(mac|ms)font calls. · 6434e343
      Jan Djärv authored
      * font.c (syms_of_font): Move call to syms_of_(ns|mac)font ...
      
      * nsterm.m (syms_of_nsterm): ... to here.
      6434e343
    • Dmitry Antipov's avatar
      * xterm.c (toolkit_scroll_bar_interaction): Use bool for boolean. · 83a119f8
      Dmitry Antipov authored
      (ignore_next_mouse_click_timeout): Use Time as X does.
      (handle_one_xevent): Avoid cast and use unsigned comparison.
      83a119f8
    • Dmitry Antipov's avatar
      Do not copy X event in handle_one_xevent except KeyPress case. · 61582e6a
      Dmitry Antipov authored
      Wnen XEvent is processed, it is unlikely to be changed except
      KeyPress case, so we can avoid copying and use const pointer to
      const data to make sure that an event is not changed elsewhere.
      * xterm.c (handle_one_xevent): Change 2nd arg to 'const XEvent *
      const' and do not create local copy except for the KeyPress event.
      Use casts to avoid a few glitches.  Adjust formatting.  Add comments.
      (SET_SAVED_BUTTON_EVENT): Remove and move the code to the only user.
      (x_handle_net_wm_state, x_menubar_window_to_frame)
      (x_detect_focus_change, construct_mouse_click, note_mouse_movement)
      (x_scroll_bar_to_input_event, x_scroll_bar_expose)
      (x_scroll_bar_handle_click, x_scroll_bar_note_movement):
      * gtkutil.c (xg_event_is_for_menubar, xg_event_is_for_scrollbar):
      * xselect.c (x_handle_property_notify, x_handle_selection_notify)
      (x_handle_dnd_message):
      * xsettings.c (xft_settings_event):
      Use 'const XEvent * const' where appropriate.
      * xterm.h, gtkutil.h, xsettngs.h: Adjust related prototypes.
      61582e6a
    • Dmitry Antipov's avatar
      Fix X event waiting to handle multiple frames. · f8eb1572
      Dmitry Antipov authored
      * frame.h (struct frame) [HAVE_X_WINDOWS]: New member wait_event_type.
      * xterm.c (pending_event_wait): Remove.  Adjust users.
      (x_detect_focus_change): Pass frame arg.
      (handle_one_xevent): Find related frame early and clear per-frame
      wait_event_type only if this is an event for the relevant frame.
      (x_wait_for_event): Use per-frame wait_event_type.
      f8eb1572
  8. 15 Sep, 2013 7 commits
    • Jan Djärv's avatar
      Fix compilation for GNUStep due to font changes. · 745d3809
      Jan Djärv authored
      * font.c (syms_of_font): Check MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
      for syms_of_macfont.
      
      * nsfns.m (Fx_create_frame): Fix font driver registration for
      GNUStep.
      745d3809
    • Jan Djärv's avatar
      Port the font backend from the Mac port. · 3fa2054e
      Jan Djärv authored
      * configure.ac: Add check for OSX 10.5, required for macfont.o.
      
      * etc/NEWS: Mention the macfont backend.
      
      * src/Makefile.in (NS_OBJ, SOME_MACHINE_OBJECTS): Add macfont.o.
      
      * src/font.c (syms_of_font): Call syms_of_macfont.
      
      * src/font.h: Declare syms_of_macfont.
      
      * src/nsfns.m: Include macfont.h.
      (Fx_create_frame): Register macfont driver, make a better default font.
      (Fns_popup_font_panel): Get font from macfont driver, if used.
      
      * src/nsfont.m (ns_tmp_flags, ns_tmp_font): Remove.
      (nsfont_open): Set font driver type.
      Set font->ascent and font->descent.  Figure out font instead of
      ns_tmp_font, and flags instead of ns_tmp_flags.
      Fix indentation. Remove call to ns_draw_text_decoration,
      moved to nsterm.
      
      * src/nsterm.m: Include macfont.h.
      (ns_tmp_flags, ns_tmp_font): Remove.
      (ns_compute_glyph_string_overhangs): Check for driver Qns.
      (ns_draw_glyph_string): Use local variables instead of ns_tmp_flags,
      ns_tmp_font.  Call ns_draw_text_decoration here instead of nsfont.m.
      (changeFont:): Fix code style.  Check for font driver type when
      getiing font.
      
      * src/nsterm.h (FONT_DESCENT, FONT_ASCENT): Define to (f)->ascent and
      (f)->descent.
      3fa2054e
    • Dmitry Antipov's avatar
      Drop VERTICAL_SCROLL_BAR_WIDTH_TRIM. For X, it is zero since 1999, · 0eed0355
      Dmitry Antipov authored
      and it is always zero for others, so I assume that this is an ancient
      leftover which nobody will want to change any more.
      * xterm.h, w32term.h, nsterm.h (VERTICAL_SCROLL_BAR_WIDTH_TRIM): Remove.
      (VERTICAL_SCROLL_BAR_INSIDE_WIDTH):
      * frame.c (x_set_scroll_bar_width):
      * w32fns.c (w32_createscrollbar):
      * w32term.c (w32_set_vertical_scroll_bar):
      * xfns.c (x_set_scroll_bar_default_width):
      * xterm.c (XTflash, x_scroll_bar_create, XTset_vertical_scroll_bar)
      (x_scroll_bar_expose): Related users changed.
      0eed0355
    • Dmitry Antipov's avatar
      * xterm.c, xfns.c (toplevel): Remove #ifdef HAVE_X_WINDOWS because · 7f09455e
      Dmitry Antipov authored
      these modules are never compiled otherwise.
      7f09455e
    • Dmitry Antipov's avatar
      * xterm.h (SCROLL_BAR_X_WIDGET, SET_SCROLL_BAR_X_WIDGET) [USE_X_TOOLKIT]: · 901049a6
      Dmitry Antipov authored
      Define as such.
      * w32term.h (SCROLL_BAR_X_WIDGET, SET_SCROLL_BAR_X_WIDGET):
      Remove unused Xisms.
      901049a6
    • Dmitry Antipov's avatar
      * frame.h (FRAME_SMALLEST_CHAR_WIDTH, FRAME_SMALLEST_FONT_HEIGHT): · c7cc32f7
      Dmitry Antipov authored
      Define once here...
      * nsterm.h, w32term.h, xterm.h: ...and not here.
      c7cc32f7
    • Dmitry Antipov's avatar
      * xterm.h (FRAME_X_SCREEN_NUMBER): Add comment. · 07013c68
      Dmitry Antipov authored
      (BLACK_PIX_DEFAULT, WHITE_PIX_DEFAULT): Use FRAME_X_SCREEN_NUMBER.
      07013c68
  9. 14 Sep, 2013 2 commits
  10. 13 Sep, 2013 3 commits
    • Dmitry Antipov's avatar
      Unify Fx_focus_frame between all ports. · fcd42c11
      Dmitry Antipov authored
      * src/frame.h (x_focus_frame): New prototype.
      * src/xfns.c (Fx_focus_frame): Remove.
      (syms_of_xfns): Do not defsubr it.
      (x_focus_frame): X implementation.
      * src/nsfns.m (Fx_focus_frame): Remove.
      (syms_of_nsfns): Do not defsubr it.
      (x_focus_frame): NS implementation.
      * src/w32term.c (Fx_focus_frame): Remove.
      (x_focus_on_frame): Rename to...
      (x_focus_frame): W32 implementation.
      * src/w32term.h (x_focus_on_frame): Remove prototype.
      * src/w32fns.c (Fx_focus_frame): Remove.
      (syms_of_w32fns): Do not defsubr it.
      * src/frame.c (Fx_focus_frame): Define here.
      (syms_of_frame): Defsubr here.
      * src/gtkutil.c (xg_tool_bar_callback): Use x_focus_frame.
      * lisp/frame.el (x-focus-frame): Mark as declared in frame.c.
      fcd42c11
    • Dmitry Antipov's avatar
      Unify FRAME_window_system_DISPLAY_INFO macros between all ports. · aad3612f
      Dmitry Antipov authored
      All of them are replaced with FRAME_DISPLAY_INFO, defined in
      each port to reference the port-specific window system data.
      * msdos.h (FRAME_X_DISPLAY_INFO): Remove.
      (FRAME_DISPLAY_INFO): Define.
      * w32term.h (FRAME_W32_DISPLAY_INFO, FRAME_X_DISPLAY_INFO): Remove.
      (FRAME_DISPLAY_INFO): Define.  Adjust users.
      * xterm.h (FRAME_X_DISPLAY_INFO): Remove.
      (FRAME_DISPLAY_INFO): Define.  Adjust users.
      * frame.h (FRAME_RES_X, FRAME_RES_Y): Unify.
      * font.c, frame.c, gtkutil.c, image.c, menu.c, msdos.c, nsfns.m:
      * nsfont.m, nsterm.m, w32fns.c, w32font.c, w32menu.c, w32term.c:
      * w32xfns.c, widget.c, xdisp.c, xfaces.c, xfns.c, xfont.c, xmenu.c:
      * xselect.c, xterm.c: All related users changed.
      aad3612f
    • Dmitry Antipov's avatar
      * xterm.h (x_window_to_frame, x_any_window_to_frame) · 9a650e62
      Dmitry Antipov authored
      (x_menubar_window_to_frame): Remove prototypes.
      * xfns.c (x_window_to_frame, x_any_window_to_frame)
      (x_menubar_window_to_frame, x_top_window_to_frame):
      Move from here...
      * xterm.c (x_window_to_frame, x_any_window_to_frame)
      (x_menubar_window_to_frame, x_top_window_to_frame):
      ...to here and convert all but the last to static.
      9a650e62
  11. 12 Sep, 2013 2 commits