1. 19 Jan, 2016 1 commit
    • Joakim Verona's avatar
      Support for the new Xwidget feature. · 7c1f66a9
      Joakim Verona authored
      * configure.ac:
      (HAVE_XWIDGETS, WIDGET_OBJ, EMACS_CONFIG_FEATURES):
      * xterm.c (x_draw_glyph_string, x_draw_bar_cursor):
      * xdisp.c:
      (handle_display_spec, handle_single_display_spec, push_it)
      (pop_it, set_iterator_to_next, dump_glyph)
      (calc_pixel_width_or_height, fill_xwidget_glyph_string)
      (BUILD_XWIDGET_GLYPH_STRING, BUILD_GLYPH_STRINGS)
      (produce_xwidget_glyph, x_produce_glyphs)
      (get_window_cursor_type):
      * window.c (Fdelete_window_internal):
      * termhooks.h (e):
      * print.c (print_object):
      * lisp.h (ptrdiff_t):
      * keyboard.c (kbd_buffer_get_event, make_lispy_event)
      (syms_of_keyboard):
      * emacs.c (main):
      * dispnew.c (update_window, scrolling_window):
      * dispextern.h (g, i):
      * Makefile.in (XWIDGETS_OBJ, WEBKIT_CFLAGS, WEBKIT_LIBS)
      (GIR_LIBS, ALL_CFLAGS, base_obj, LIBES):
      * keyboard.c (kbd_buffer_get_event):
      * emacsgtkfixed.c (emacs_fixed_gtk_widget_size_allocate)
      (emacs_fixed_class_init): Add case for an xwidget view.
      
      * xwidget.c, xwidget.h, xwidget.el: New files for xwidgets
      Co-authored-by: default avatarGrégoire Jadi  <daimrod@gmail.com>
      
      Various improvements to the Xwidget feature.
      * xwidgets.c:
      * emacsgtkfixed.c:
      * xwidget.el:
      7c1f66a9
  2. 01 Jan, 2016 1 commit
  3. 31 Dec, 2015 1 commit
    • YAMAMOTO Mitsuharu's avatar
      Clean up cairo printing code · ce5ad125
      YAMAMOTO Mitsuharu authored
      * src/gtkutil.c (xg_get_page_setup): Use listn.
      * src/xfns.c (Fx_export_frames, Fx_print_frames_dialog): Doc fix.  Use
      decode_window_system_frame and FRAME_VISIBLE_P.
      (Fx_print_frames_dialog): Use redisplay_preserve_echo_area instead
      of Fdisplay.
      * src/xterm.c (x_cr_export_frames): Use redisplay_preserve_echo_area
      instead of Fdisplay.  Temporarily unblock_input around QUIT.
      ce5ad125
  4. 13 Nov, 2015 2 commits
    • Paul Eggert's avatar
      Port recent XCB changes to 64-bit ‘long int’ · da05685d
      Paul Eggert authored
      For historical reasons, libX11 represents 32-bit values like Atoms as
      ‘long int’ even on platforms where ‘long int’ is 64 bits.  XCB doesn’t
      do that, so adapt the recent XCB code to behave properly on 64-bit
      platforms.  Also, fix what appears to be a bug in the interpretation
      of xcb_get_property_value_length, at least on my Fedora platform
      which is running libxcb-1.11-5.fc21.
      * src/xfns.c (x_real_pos_and_offsets):
      * src/xterm.c (get_current_wm_state):
      xcb_get_property_value_length returns a byte count, not a word count.
      For 32-bit quantities, xcb_get_property_value returns a vector
      of 32-bit words, not of (possibly 64-bit) long int.
      
      Backport.
      da05685d
    • Paul Eggert's avatar
      Port recent XCB changes to 64-bit ‘long int’ · 4c4b5205
      Paul Eggert authored
      For historical reasons, libX11 represents 32-bit values like Atoms as
      ‘long int’ even on platforms where ‘long int’ is 64 bits.  XCB doesn’t
      do that, so adapt the recent XCB code to behave properly on 64-bit
      platforms.  Also, fix what appears to be a bug in the interpretation
      of xcb_get_property_value_length, at least on my Fedora platform
      which is running libxcb-1.11-5.fc21.
      * src/xfns.c (x_real_pos_and_offsets):
      * src/xterm.c (get_current_wm_state):
      xcb_get_property_value_length returns a byte count, not a word count.
      For 32-bit quantities, xcb_get_property_value returns a vector
      of 32-bit words, not of (possibly 64-bit) long int.
      4c4b5205
  5. 12 Nov, 2015 2 commits
    • Ken Raeburn's avatar
      Enable use of XCB for checking window manager state · a838c833
      Ken Raeburn authored
      * src/xterm.c (get_current_wm_state) [USE_XCB]: Use XCB calls instead
      of XGetWindowProperty plus error-catching, since we can explicitly
      check for errors in the XCB version.  This eliminates 3 XSync calls on
      top of the round-trip actually fetching the information.
      a838c833
    • Ken Raeburn's avatar
      Detect XCB and save a connection handle · c7f2b6ad
      Ken Raeburn authored
      * configure.ac: If using X11, check for XCB libraries and header.
      * src/Makefile.in (XCB_LIBS): Define.
      (LIBX_EXTRA): Include it.
      
      * src/xterm.h [USE_XCB]: Include X11/Xlib-xcb.h.
      (struct x_display_info) [USE_XCB]: Add an XCB connection handle field.
      * src/xterm.c (x_term_init) [USE_XCB]: Initialize the new field.
      c7f2b6ad
  6. 09 Nov, 2015 1 commit
    • Paul Eggert's avatar
      Use INT_ADD_WRAPV etc. to check integer overflow · 10873055
      Paul Eggert authored
      * src/alloc.c (xnmalloc, xnrealloc, xpalloc, Fmake_string):
      * src/buffer.c (record_overlay_string, overlay_strings):
      * src/casefiddle.c (casify_object):
      * src/ccl.c (Fccl_execute_on_string):
      * src/character.c (char_width, c_string_width, lisp_string_width)
      (count_size_as_multibyte, string_escape_byte8):
      * src/coding.c (coding_alloc_by_realloc, produce_chars):
      * src/data.c (arith_driver):
      * src/dispnew.c (realloc_glyph_pool, init_display):
      * src/editfns.c (styled_format):
      * src/fns.c (Ffillarray):
      * src/ftfont.c (ftfont_shape_by_flt):
      * src/gnutls.c (gnutls_hex_string):
      * src/gtkutil.c (get_utf8_string):
      * src/image.c (x_to_xcolors, x_detect_edges, png_load_body):
      * src/keymap.c (Fkey_description):
      * src/lisp.h (SAFE_ALLOCA_LISP):
      * src/term.c (encode_terminal_code):
      * src/tparam.c (tparam1):
      * src/xselect.c (x_property_data_to_lisp):
      * src/xsmfns.c (smc_save_yourself_CB):
      * src/xterm.c (x_term_init):
      When checking for integer overflow, prefer INT_MULTIPLY_WRAPV to
      more-complicated code involving division and/or
      INT_MULTIPLY_OVERFLOW, and similarly for INT_ADD_WRAPV and
      subtraction and/or INT_ADD_OVERFLOW.
      * src/casefiddle.c (casify_object): Simplify multibyte size check.
      * src/character.c: Remove some obsolete ‘#ifdef emacs’s.
      * src/data.c (arith_driver): Also check for division overflow,
      as that’s now possible given that the accumulator can now contain
      any Emacs integer.
      * src/lisp.h (lisp_word_count): Remove; no longer used.
      10873055
  7. 06 Nov, 2015 1 commit
  8. 21 Oct, 2015 1 commit
    • Paul Eggert's avatar
      Include-file cleanup for src directory · 63cfb75f
      Paul Eggert authored
      Omit ‘#include "foo.h"’ unless the file needs foo.h (Bug#21707).
      In a few cases, add ‘#include "foo.h"’ if the file needs foo.h
      but does not include it directly.  As a general rule, a source
      file should include foo.h if it needs the interfaces that foo.h
      defines.
      * src/alloc.c: Don’t include process.h.  Include dispextern.h,
      systime.h.
      * src/atimer.c: Don’t include blockinput.h.
      * src/buffer.c: Include coding.h, systime.h.  Don’t include
      keyboard.h, coding.h.
      * src/callint.c: Don’t include commands.h, keymap.h.
      * src/callproc.c: Don’t include character.h, ccl.h, composite.h,
      systty.h, termhooks.h.
      * src/casetab.c: Don’t include character.h.
      * src/category.c: Don’t include charset.h, keymap.h.
      * src/ccl.h: Don’t include character.h.
      * src/character.c: Don’t include charset.h.
      * src/charset.c: Don’t include disptab.h.
      * src/chartab.c: Don’t include ccl.h.
      * src/cm.c: Don’t include frame.h, termhooks.h.
      * src/cmds.c: Don’t include window.h, dispextern.h.
      * src/coding.c: Don’t include window.h, frame.h.
      * src/composite.c: Include composite.h.  Don’t include window.h,
      font.h.
      * src/data.c: Don’t include syssignal.h, termhooks.h, font.h.
      * src/dbusbind.c: Don’t include frame.h.
      * src/decompress.c: Don’t include character.h.
      * src/dired.c: Don’t include character.h, commands.h, charset.h.
      * src/dispnew.c: Don’t include character.h, indent.h, intervals.h,
      process.h, timespec.h.  Include systime.h.
      * src/doc.c: Include coding.h.  Don’t include keyboard.h.
      * src/editfns.c: Include composite.h.  Don’t include frame.h.
      * src/emacs.c: Include fcntl.h, coding.h.  Don’t include
      commands.h, systty.h..
      * src/fileio.c: Don’t include intervals.h, dispextern.h.
      Include composite.h.
      * src/filelock.c: Don’t include character.h, systime.h.
      * src/fns.c: Don’t include time.h, commands.h, keyboard.h,
      keymap.h, frame.h, blockinput.h, xterm.h.  Include composite.h.
      * src/font.c: Include termhooks.h.
      * src/font.h: Don’t include ccl.h, frame.h.  Add forward decls of
      struct composition_it, struct face, struct glyph_string.
      * src/fontset.c: Don’t include buffer.h, ccl.h, keyboard.h,
      intervals.h, window.h, termhooks.h.
      * src/frame.c: Don’t include character.h, commands.h, font.h.
      * src/frame.h: Don’t include dispextern.h.
      * src/fringe.c: Don’t include character.h.
      * src/ftcrfont.c: Don’t include dispextern.h, frame.h,
      character.h, charset.h, fontset.h.
      * src/ftfont.c: Don’t include frame.h, blockinput.h, coding.h,
      fontset.h.
      * src/ftxfont.c: Don’t include dispextern.h, character.h,
      charset.h, fontset.h.
      * src/gfilenotify.c: Don’t include frame.h, process.h.
      * src/gtkutil.c: Include dispextern.h, frame.h, systime.h.
      Don’t include syssignal.h, buffer.h, charset.h, font.h.
      * src/gtkutil.h: Don’t include frame.h.
      * src/image.c: Include fcntl.h and stdio.h instead of sysstdio.h.
      Don’t include character.h.
      * src/indent.c: Don’t include keyboard.h, termchar.h.
      * src/inotify.c: Don’t include character.h, frame.h.
      * src/insdel.c: Include composite.h.  Don’t include blockinput.h.
      * src/intervals.c: Don’t include character.h, keyboard.h.
      * src/intervals.h: Don’t include dispextern.h, composite.h.
      * src/keyboard.c: Don’t include sysstdio.h, disptab.h, puresize.h.
      Include coding.h.
      * src/keyboard.h: Don’t incldue systime.h.
      * src/keymap.c: Don’t include charset.h, frame.h.
      * src/lread.c: Include dispextern.h and systime.h.
      Don’t include frame.h.  Include systime.h.
      * src/macros.c: Don’t include commands.h, character.h, buffer.h.
      * src/menu.c: Include character.h, coding.h.  Don’t include
      dispextern.h.
      * src/menu.h: Don’t include systime.h.
      * src/minibuf.c: Don’t include commands.h, dispextern.h, syntax.h,
      intervals.h, termhooks.h.
      * src/print.c: Include coding.h.  Don’t include keyboard.h,
      window.h, dispextern.h, termchar.h, termhooks.h, font.h.
      Add forward decl of struct terminal.
      * src/process.c: Don’t include termhooks.h, commands.h,
      dispextern.h, composite.h.
      * src/region-cache.c: Don’t include character.h.
      * src/scroll.c: Don’t include keyboard.h, window.h.
      * src/search.c: Don’t include category.h, commands.h.
      * src/sound.c: Don’t include dispextern.h.
      * src/syntax.c: Don’t include command.h, keymap.h.
      * src/sysdep.c: Don’t include window.h, dispextern.h.
      * src/systime.h: Use ‘#ifdef emacs’, not ‘#ifdef EMACS_LISP_H’,
      * src/term.c: Don’t include systty.h, intervals.h, xterm.h.
      * src/terminal.c: Include character.h.
      Don’t include charset.h, coding.h.
      * src/textprop.c: Don’t include character.h.
      * src/undo.c: Don’t include character.h, commands.h, window.h.
      * src/unexsol.c: Don’t include character.h, charset.h.
      * src/widget.c: Include widget.h.  Don’t include keyboard.h,
      window.h, dispextern.h, blockinput.h, character.h, font.h.
      * src/widgetprv.h: Don’t include widget.h.
      * src/window.c: Don’t include character.h, menu.h, intervals.h.
      * src/xdisp.c: Include composite.h, systime.h.  Don’t include
      macros.h, process.h.
      * src/xfaces.c: Don’t include charset.h, keyboard.h, termhooks.h,
      intervals.h.
      * src/xfns.c: Don’t include menu.h, character.h, intervals.h,
      epaths.h, fontset.h, systime.h, atimer.h, termchar.h.
      * src/xfont.c: Don’t include dispextern.h, fontset.h, ccl.h.
      * src/xftfont.c: Don’t include dispextern.h, character.h, fontset.h.
      * src/xgselect.c: Don’t include timespec.h, frame.h.
      Include systime.h.
      * src/xgselect.h: Don’t include time.h.
      Use a forward decl to struct timespec instead.
      * src/xmenu.c: Don’t include keymap.h, character.h, charset.h,
      dispextern.h.  Include systime.h.
      * src/xml.c: Don’t include character.h.
      * src/xrdb.c [USE_MOTIF]: Don’t include keyboard.h.
      * src/xselect.c: Don’t include dispextern.h, character.h,
      buffer.h, process.h.
      * src/xsmfns.c: Don’t include systime.h, sysselect.h.
      * src/xterm.c: Don’t include syssignal.h, charset.h, disptab.h,
      intervals.h process.h, keymap.h, xgselect.h.  Include composite.h.
      63cfb75f
  9. 14 Oct, 2015 2 commits
    • Paul Eggert's avatar
      Spelling fixes · 943f7f90
      Paul Eggert authored
      * configure.ac (bitmapdir): Fix misspelling of bmd_acc.
      * test/automated/coding-tests.el (ert-test-coding-bogus-coding-systems):
      Fix misspelling of nonexistent file name.
      943f7f90
    • Ken Raeburn's avatar
      Do process ConfigureNotify events indicating size changes. · 85c12310
      Ken Raeburn authored
      * src/xterm.c (handle_one_xevent): If consecutive ConfigureNotify
      events don't have the same size, process each one.
      85c12310
  10. 13 Oct, 2015 1 commit
    • Martin Rudalics's avatar
      Allow setting frame pixel sizes from frame parameters (Bug#21415) · d4fe840d
      Martin Rudalics authored
      Also fix some misfeatures in frame (re-)sizing code, add more
      debugging information and remove some dead code.
      
      * lisp/frame.el (frame-notice-user-settings, make-frame): Change
      parameter names when setting `frame-size-history'.
      (frame--size-history): New function.
      
      * src/frame.c (frame_inhibit_resize): If frame has not been made
      yet, return t if inhibit_horizontal_resize or
      inhibit_vertical_resize bit have been set.
      (adjust_frame_size): Simplify.
      (make_frame): Initialize inhibit_horizontal_resize,
      inhibit_vertical_resize, tool_bar_redisplayed, tool_bar_resized.
      (Fframe_after_make_frame): Reset inhibit_horizontal_resize and
      inhibit_vertical_resize slots.
      (x_set_frame_parameters): Handle `text-pixels' specification for
      width and height parameters.  Don't consider new_height or
      new_width changes.  Call adjust_frame_size instead of
      Fset_frame_size.
      (x_figure_window_size): Two new arguments x_width and y_width
      returning frame's figures width and height.  Calculate tool bar
      height before frame sizes so SET_FRAME_HEIGHT can pick it up.
      Handle `text-pixels' specification for width and height
      parameters.
      (Qtext_pixels, Qx_set_frame_parameters, Qset_frame_size)
      (Qx_set_window_size_1, Qx_set_window_size_2)
      (Qx_set_window_size_3, Qx_set_menu_bar_lines)
      (Qupdate_frame_menubar, Qfree_frame_menubar_1)
      (Qfree_frame_menubar_2): New symbols.
      * src/frame.h (structure frame): New booleans
      tool_bar_redisplayed, tool_bar_resized,
      inhibit_horizontal_resize, inhibit_vertical_resize.
      (x_figure_window_size): Update external declaration.
      * src/gtkutil.c (xg_frame_set_char_size): Set size hints before
      calling gtk_window_resize.
      (update_frame_tool_bar): Make inhibiting of frame resizing more
      discriminative.  Set tool_bar_resized bit.
      * src/nsfns.m (x_set_tool_bar_lines): Make inhibiting of frame
      resizing more discriminative.  Call adjust_frame_size instead of
      x_set_window_size.
      (Fx_create_frame): Handle x_width and x_height if
      set by x_figure_window_size.
      * src/nsterm.m (x_set_window_size): For GNUSTEP build don't
      subtract 3 from tool bar height.
      (x_set_window_size): Add frame_size_history_add call.
      (x_new_font): Call adjust_frame_size instead of
      x_set_window_size.
      * src/w32fns.c (x_change_tool_bar_height): Reset
      tool_bar_redisplayed and tool_bar_resized bits when adding tool
      bar.  Make inhibiting of frame resizing more discriminative.
      (w32_wnd_proc): Remove dead code in WM_WINDOWPOSCHANGING case.
      (Fx_create_frame): Handle x_width and x_height if set by
      x_figure_window_size.  Set size hints before adjusting frame size.
      (x_create_tip_frame): Adjust x_figure_window_size call.
      * src/w32term.c (x_set_window_size): Add frame_size_history_add
      call.
      * src/widget.c (set_frame_size): Remove dead code.  Add
      frame_size_history_add call.  When frame_resize_pixelwise is t
      use FRAME_PIXEL_WIDTH and FRAME_PIXEL_HEIGHT instead of
      pixel_width and pixel_height.
      (update_various_frame_slots): Remove dead code.
      (EmacsFrameResize): Add more information in
      frame_size_history_add call.
      (EmacsFrameQueryGeometry): Round only when frame_resize_pixelwise
      is not set.
      * src/xdisp.c (redisplay_tool_bar): Set tool_bar_redisplayed bits.
      * src/xfns.c (x_set_menu_bar_lines): Change argument name.
      (x_change_tool_bar_height): Reset tool_bar_redisplayed and
      tool_bar_resized bits when adding tool bar.  Make inhibiting of
      frame resizing more discriminative.
      (Fx_create_frame): Handle x_width and x_height if set by
      x_figure_window_size.  Set size hints before adjusting frame size.
      (x_create_tip_frame): Adjust x_figure_window_size call.
      * src/xmenu.c (update_frame_menubar): Don't handle Lucid specially.
      (set_frame_menubar): On Lucid never add core-border-width to
      avoid that adding XtNinternalBorderWidth adds it again.
      (free_frame_menubar): Handle frame_inhibit_resize true for Motif.
      * src/xterm.c (x_new_font): In non-toolkit case handle size
      change of menu bar.
      (x_set_window_size_1): Fix calls to frame_size_history_add.
      (x_wm_set_size_hint): Remove dead code.  Set
      size_hints.min_width and size_hints.min_height to base_width and
      base_height.
      d4fe840d
  11. 11 Oct, 2015 3 commits
    • Ken Raeburn's avatar
      Handle an opaque-move X11 window manager operation more efficiently. · ce402dd7
      Ken Raeburn authored
      * src/xterm.c (handle_one_xevent): If a ConfigureNotify event is
      followed by more ConfigureNotify events for the same window, process
      only the last one.
      ce402dd7
    • Ken Raeburn's avatar
      Add x_catch_errors_with_handler. · fcb5d3e8
      Ken Raeburn authored
      * src/xterm.c (struct x_error_message_stack): Add new fields for a
      callback function and associated data pointer.
      (x_error_catcher): If the callback function is set, call it after
      saving the error message string.
      (x_catch_errors_with_handler): Renamed from x_catch_errors but now
      accepts a callback function and data pointer.
      (x_catch_errors): Now a wrapper function.
      * src/xterm.h (x_special_error_handler): New typedef.
      (x_catch_errors_with_handler): Declare.
      fcb5d3e8
    • Ken Raeburn's avatar
      Introduce x_uncatch_errors_after_check to reduce XSync calls. · 5504ede9
      Ken Raeburn authored
      Both x_had_errors_p and x_check_errors call XSync, so if they're
      immediately followed by x_uncatch_errors, its XSync call will be
      redundant, resulting in a wasted round trip to the X server.
      
      * src/xterm.c (x_uncatch_errors_after_check): New routine; a copy of
      x_uncatch_errors without the XSync call.
      (XTmouse_position, x_wm_supports):
      * src/xfns.c (x_set_mouse_color):
      * src/xmenu.c (Fx_menu_bar_open_internal):
      * src/xselect.c (x_own_selection, x_get_foreign_selection):
      (Fx_get_atom_name): Call it instead of x_uncatch_errors.
      * src/xterm.h (x_uncatch_errors_after_check): Declare.
      5504ede9
  12. 08 Oct, 2015 4 commits
    • Paul Eggert's avatar
      Fix problems caught with --enable-gcc-warnings · 5a3a6aa7
      Paul Eggert authored
      * src/image.c (lookup_rgb_color):
      * src/xfns.c (x_defined_color):
      * src/xterm.c (x_parse_color):
      Remove unused locals.
      5a3a6aa7
    • Ken Raeburn's avatar
      Reduce some unnecessary X calls. · ee529429
      Ken Raeburn authored
      * src/xfns.c (x_real_pos_and_offsets): Remove a redundant XGetGeometry
      call.  If border width is wanted, get it from the XGetGeometry call
      instead of calling XGetWindowAttributes on the same window.  Skip some
      X calls if we've already detected an error from the X server.
      * src/xterm.c (x_wm_supports): Delete x_sync before x_had_errors_p.
      (handle_one_xevent): Delete XSync call before x_uncatch_errors.
      ee529429
    • Ken Raeburn's avatar
      Reduce color allocation/query traffic in the TrueColor case. · e23ed19f
      Ken Raeburn authored
      When working with an X visual with TrueColor class, pixel values can
      be generated from the RGB values according to mask value provided by
      the server on connection.  Some of the image-handling code was already
      doing this.
      
      * src/xterm.h (x_make_truecolor_pixel): New function; code taken from
      lookup_rgb_color.
      (x_mutable_colormap): New function.
      * src/image.c (lookup_rgb_color): Move pixel composition code to
      x_make_truecolor_pixel.
      (x_kill_gs_process): Call x_mutable_colormap.
      * src/xfaces.c (x_free_colors, x_free_dpy_colors): Call
      x_mutable_colormap.
      * src/xftfont.c (xftfont_get_colors): Call x_query_colors.
      * src/xterm.c (x_query_colors): For a TrueColor display, decompose the
      pixel value into RGB values directly, and don't send a request to the
      server.
      (x_alloc_nearest_color): For a TrueColor display, construct the pixel
      value with x_make_truecolor_pixel.
      (x_copy_color): For an immutable color map, just return the provided
      pixel value.
      e23ed19f
    • Ken Raeburn's avatar
      Cache XParseColor results in the X display info structure. · b8eea1d7
      Ken Raeburn authored
      With repeated lookups of foreground and background colors for multiple
      faces per frame, we issue a lot of redundant color name lookups to the
      X server, waiting every time for the response.  On a remote network
      with, say, 30ms round-trip time, this can add nearly a full second to
      creation of a new frame.
      
      * src/gtkutil.c (xg_check_special_colors): Call x_parse_color.
      * src/image.c (get_spec_bg_or_alpha_as_argb):
      (xpm_init_color_cache, xpm_lookup_color):
      * src/xfns.c (x_defined_color):
      * src/xterm.c (x_parse_color): New function; caches color names not
      starting with "#" in the display-info structure.
      (x_delete_display): Delete the cache content.
      * src/xterm.h (struct color_name_cache_entry): New type.
      (x_parse_color): Declare.
      (struct x_display_info): Add a new field for the cache.
      b8eea1d7
  13. 23 Sep, 2015 1 commit
    • Paul Eggert's avatar
      Prefer CALLN in a few more places · 791355fd
      Paul Eggert authored
      * src/macfont.m (macfont_set_family_cache):
      * src/nsterm.m (append2):
      * src/xterm.c (x_cr_export_frames):
      Prefer CALLN to allocating the arg arrays by hand.
      791355fd
  14. 16 Sep, 2015 1 commit
    • Paul Eggert's avatar
      Add -Wswitch to --enable-gcc-warnings · 8865587c
      Paul Eggert authored
      Make --enable-gcc-warnings a bit pickier, by also using -Wswitch.
      * configure.ac (WERROR_CFLAGS): Don’t add -Wno-switch.
      * lib-src/etags.c (main, consider_token, C_entries):
      * src/coding.c (encode_invocation_designation):
      * src/data.c (Ftype_of):
      * src/eval.c (Fdefvaralias, default_toplevel_binding)
      (Fbacktrace__locals, mark_specpdl):
      * src/lisp.h (record_xmalloc):
      * src/syntax.c (scan_lists, scan_sexps_forward):
      * src/window.c (window_relative_x_coord):
      * src/xdisp.c (push_it, pop_it):
      * src/xterm.c (xg_scroll_callback, x_check_fullscreen):
      Error out or do nothing (as appropriate) if a switch statement
      with an enum value does not cover all of the enum.
      * src/dispextern.h (struct iterator_stack_entry.u.comp):
      Remove unused member discovered by using -Wswitch.
      * src/lisp.h (record_xmalloc): Add a ‘+ 0’ to pacify -Wswitch.
      * src/vm-limit.c (check_memory_limits):
      Simplify warning-diagnostic computation by using a table.
      8865587c
  15. 31 Aug, 2015 1 commit
  16. 27 Aug, 2015 1 commit
    • Paul Eggert's avatar
      Assume GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS · 60d1b187
      Paul Eggert authored
      This removes the need for GCPRO1 etc.  Suggested by Stefan Monnier in:
      http://lists.gnu.org/archive/html/emacs-devel/2015-08/msg00918.html
      * doc/lispref/internals.texi (Writing Emacs Primitives):
      * etc/NEWS:
      Document the change.
      * src/alloc.c (gcprolist, dump_zombies, MAX_ZOMBIES, zombies)
      (nzombies, ngcs, avg_zombies, max_live, max_zombies, avg_live)
      (Fgc_status, check_gcpros, relocatable_string_data_p, gc-precise):
      * src/bytecode.c (mark_byte_stack) [BYTE_MARK_STACK]:
      * src/eval.c (gcpro_level) [DEBUG_GCPRO]:
      * src/lisp.h (struct handler.gcpro, struct gcpro, GC_MARK_STACK)
      (GC_USE_GCPROS_AS_BEFORE, GC_MAKE_GCPROS_NOOPS)
      (GC_MARK_STACK_CHECK_GCPROS, GC_USE_GCPROS_CHECK_ZOMBIES)
      (BYTE_MARK_STACK, GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6)
      (GCPRO7, UNGCPRO, RETURN_UNGCPRO):
      Remove.  All uses removed.  The code now assumes
      GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS.
      * src/bytecode.c (relocate_byte_stack):
      Rename from unmark_byte_stack, since it now only relocates.
      All callers changed.
      * src/frame.c (make_frame): Add an IF_LINT to pacify GCC 5.2
      with GCPROs removed.
      * src/systime.h: Use EMACS_LISP_H as the canary instead of GCPRO1.
      * test/automated/finalizer-tests.el (finalizer-basic)
      (finalizer-circular-reference, finalizer-cross-reference)
      (finalizer-error):
      * test/automated/generator-tests.el (cps-test-iter-close-finalizer):
      Remove tests, as they depend on gc-precise.
      60d1b187
  17. 24 Aug, 2015 1 commit
    • Pip Cet's avatar
      Fix full-screen code when there is no window manager (Bug#21317) · 93da8ac5
      Pip Cet authored
      * src/xterm.h (x_wm_supports): Declare external.
      * src/xterm.c (wm_suppports): Rename to `x_wm_supports', export.
      (do_ewmh_fullscreen, x_ewmh_activate_frame): Adjust for rename.
      (x_check_fullscreen): Call `x_wm_set_size_hint', restore
      `fullscreen' frame parameter.
      * gtkutil.c (x_wm_set_size_hint): Set size hints when running
      without a window manager.
      
      Copyright-paperwork-exempt: yes
      93da8ac5
  18. 25 Jun, 2015 1 commit
  19. 23 Jun, 2015 1 commit
    • Paul Eggert's avatar
      Fix bug that munged selection info · 1552e673
      Paul Eggert authored
      On some optimizing C compilers, copying a structure did not
      copy the padding bytes between elements, and the type punning
      between struct input_data and struct selection_input_data did
      not work.  Change the C code to use a proper union type instead.
      Problem reported by YAMAMOTO Mitsuharu (Bug#20756).
      * src/keyboard.c (kbd_buffer, kbd_fetch_ptr, kbd_store_ptr)
      (readable_events, discard_mouse_events, kbd_buffer_events_waiting)
      (kbd_buffer_get_event, process_special_events, stuff_buffered_input)
      (mark_kboards):
      Use union buffered_input_event, not struct input_event.
      (clear_event, deliver_input_available_signal, process_special_events):
      Remove unnecessary forward decls.
      (kbd_buffer_store_buffered_event): New function, mostly just the
      old kbd_buffer_store_event_hold, except its argument is of type
      union buffered_input_event, not struct input_event.
      (kbd_buffer_unget_event): Define only if HAVE_X11, since it's
      not needed otherwise.  Argument is now of type
      struct selection_input_event *, not struct input_event *.
      All callers changed.
      (clear_event): Arg is now of type union buffered_input_event *,
      not struct input_event *.  All callers changed.
      * src/keyboard.h [HAVE_X11]: Include "xterm.h".
      (union buffered_input_event): New type.
      (kbd_buffer_store_event_hold): Now an inline function,
      defined here.
      * src/termhooks.h (EVENT_KIND_WIDTH): New constant.
      (struct input_event): Use it.
      * src/xselect.c (struct selection_event_queue):
      Make elements be of type struct selection_input_event,
      not struct input_event.
      (selection_input_event_equal): New static function.
      (x_queue_event): Use it.
      (x_queue_event, x_decline_selection_request)
      (x_selection_current_request, x_reply_selection_request)
      (x_handle_selection_request, x_handle_selection_clear)
      (x_handle_selection_event): Use struct selection_input_event,
      not struct input_event.  All callers changed.
      (x_convert_selection): Omit unused first arg.  All callers changed.
      (Fx_disown_selection_internal): Omit unnecessary union.
      * src/xterm.c (handle_one_xevent): Use new union buffered_input_event
      rather than rolling our own equivalent.  Prefer sie.kind when
      setting up that kind of structure.
      Call kbd_buffer_store_buffered_event, not kbd_buffer_store_event_hold.
      * src/xterm.h (struct selection_input_event: Use EVENT_KIND_WIDTH.
      (SELECTION_EVENT_DISPLAY, SELECTION_EVENT_DPYINFO)
      (SELECTION_EVENT_REQUESTOR, SELECTION_EVENT_SELECTION)
      (SELECTION_EVENT_TARGET, SELECTION_EVENT_PROPERTY)
      (SELECTION_EVENT_TIME, x_handle_selection_event):
      Arg is now of type struct selection_input_event *)
      not struct input_event *.  All callers changed.
      1552e673
  20. 05 Jun, 2015 1 commit
  21. 03 Jun, 2015 1 commit
  22. 01 Jun, 2015 1 commit
    • Paul Eggert's avatar
      Avoid grave accent quoting in stderr diagnostics · 2c656f7d
      Paul Eggert authored
      A few Emacs diagnostics go directly to stderr, and so can't easily
      contain curved quotes (as non-UTF-8 locales might mishandle them).
      Instead of bothering to add support for this rarity, reword the
      diagnostics so that they don't use grave accent to quote.
      * src/alloc.c (mark_memory): Fix comment.
      * src/buffer.c (init_buffer):
      * src/dispnew.c (init_display):
      * src/emacs.c (main, sort_args):
      * src/lread.c (dir_warning):
      * src/term.c (init_tty):
      * src/unexmacosx.c (unexec):
      * src/xfns.c (select_visual):
      * src/xterm.c (cvt_string_to_pixel, x_io_error_quitter):
      Reword stderr diagnostics to avoid quoting `like this'.
      * src/unexmacosx.c: Include errno.h.
      * src/xfns.c (select_visual): Encode value for locale.
      2c656f7d
  23. 31 May, 2015 1 commit
    • Eli Zaretskii's avatar
      Attempt to fix crashes due to accesses beyond glyph matrix end · cab645a6
      Eli Zaretskii authored
      * src/xdisp.c (x_produce_glyphs): When it->ascent and it->descent
      are determined from per-character metrics, don't let the
      max_ascent and max_descent become smaller than values returned by
      normal_char_ascent_descent, to avoid unpleasant dynamic resizing
      of screen line heights when text changes.
      
      * src/xterm.c (x_new_font)
      * src/w32term.c (x_new_font): Call get_font_ascent_descent to
      obtain a reasonable value for FRAME_LINE_HEIGHT, even when a font
      claims very large value for its height.
      
      * src/font.c (font_open_entity): Call get_font_ascent_descent to
      obtain a reasonable value for FRAME_SMALLEST_FONT_HEIGHT, even
      when a font claims very large value for its height.
      cab645a6
  24. 28 May, 2015 1 commit
    • Eli Zaretskii's avatar
      Fix display of glyphless characters with problematic fonts · c76605fa
      Eli Zaretskii authored
      * src/w32term.c (x_draw_glyph_string_background): Force redraw of
      glyph string background also when the font in use claims
      preposterously large global height value.  Helps to remove
      artifacts left from previous displays when glyphless characters
      are displayed as hex code in a box.
      * src/xterm.c (x_draw_glyph_string_background): Force redraw of
      glyph string background also when the font in use claims
      preposterously large global height value.  Helps to remove
      artifacts left from previous displays when glyphless characters
      are displayed as hex code in a box.
      * src/w32font.c (w32font_draw): Fix background drawing for
      glyphless characters that display as acronyms or hex codes in a
      box.
      * src/xftfont.c (xftfont_draw): Fix background drawing for
      glyphless characters that display as acronyms or hex codes in a
      box.
      * src/xdisp.c (produce_glyphless_glyph): Compute reasonable values
      for it->ascent and it->descent when the font claims preposterously
      large global values.
      (FONT_TOO_HIGH): Move from here...
      * src/dispextern.h (FONT_TOO_HIGH): ...to here.
      c76605fa
  25. 23 May, 2015 3 commits
    • Glenn Morris's avatar
      Fix --without-toolkit-scroll-bars builds. · 238e8b66
      Glenn Morris authored
      * src/xterm.c (x_scroll_bar_set_handle) [!USE_TOOLKIT_SCROLL_BARS]:
      Add new argument to x_clear_area1.
      (XTset_horizontal_scroll_bar) [!USE_TOOLKIT_SCROLL_BARS]:
      Update x_clear_area arguments.
      238e8b66
    • Paul Eggert's avatar
      Pacify --enable-gcc-warnings · 22191349
      Paul Eggert authored
      * src/frame.h (x_query_color): Remove redundant extern decl.
      * src/ftcrfont.c (ftcrfont_glyph_extents, ftcrfont_list)
      (ftcrfont_match, ftcrfont_open, ftcrfont_close)
      (ftcrfont_text_extents, ftcrfont_draw):
      * src/xterm.c (x_set_window_size_1, *x_color_cells, x_update_end)
      (XTframe_up_to_date, x_clear_area1, x_clear_frame)
      (x_ins_del_lines, frame_highlight, frame_unhighlight)
      (x_new_focus_frame, x_focus_changed, XTframe_rehighlight)
      (x_draw_hollow_cursor, x_draw_bar_cursor, x_flush, x_update_begin)
      (x_update_window_begin, x_connection_closed)
      (x_set_clip_rectangles, x_reset_clip_rectangles, x_fill_rectangle)
      (x_draw_rectangle, x_fill_trapezoid_for_relief, x_clear_window)
      (*x_gc_get_ext_data, x_extension_initialize)
      (x_cr_accumulate_data):
      Remove redundant static decl.  Many of these GCC doesn't complain
      about, but we might as well clean out the duplication while we're
      in the neighborhood.
      * src/xterm.c (x_fill_trapezoid_for_relief):
      Remove decl of nonexistent function.
      22191349
    • Jan D's avatar
      Fixes to compile cairo branch without cairo. · ee14727c
      Jan D authored
      * src/gtkutil.c (xg_update_scrollbar_pos): x_clear_area takes frame as
      first argument.
      
      * src/xterm.c (handle_one_xevent): Surround x_cr_destroy_surface with
      USE_CAIRO.
      ee14727c
  26. 17 May, 2015 3 commits
  27. 14 May, 2015 1 commit
    • Jan D's avatar
      Don't access display after i/o error (Bug#19147). · 9341956c
      Jan D authored
      * xterm.c (x_connection_closed): Add third arg ioerror.
      If ioerror, set display to 0 (Bug#19147).
      (x_error_quitter): Call x_connection_closed with third arg false.
      (x_io_error_quitter): Call x_connection_closed with third arg true.
      9341956c
  28. 25 Apr, 2015 1 commit
    • Paul Eggert's avatar
      Port --enable-gcc-warnings to GCC 5.1 x86-64 · 52ba851d
      Paul Eggert authored
      * lib-src/ebrowse.c (dump_sym):
      * lib-src/hexl.c (main):
      * src/ccl.c (ccl_driver):
      * src/character.c (string_escape_byte8):
      * src/dbusbind.c (xd_retrieve_arg, xd_add_watch):
      * src/gnutls.c (Fgnutls_boot):
      * src/gtkutil.c (xg_check_special_colors):
      * src/image.c (x_build_heuristic_mask):
      * src/print.c (safe_debug_print, print_object):
      * src/term.c (produce_glyphless_glyph):
      * src/xdisp.c (get_next_display_element)
      (produce_glyphless_glyph):
      * src/xterm.c (x_draw_glyphless_glyph_string_foreground):
      Don't use a signed format to print an unsigned integer, or vice
      versa.  GCC 5.1's new -Wformat-signedness option warns about this.
      * src/image.c (png_load_body, jpeg_load_body):
      Silence a bogus setjump diagnostic from GCC 5.1 (GCC bug 54561).
      52ba851d