1. 27 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Rename C names to match Lisp symbols better · f41f573e
      Paul Eggert authored
      This was inspired by commit e65c3079,
      which fixed a bug where the C name for a symbol disagreed with the
      symbol name itself.  Fix other instances of disagreements that I found.
      Although this doesn’t fix a bug, it should make code easier to follow.
      The remaining disagreements are idiosyncratic: Qminus, Qplus,
      Qsans__serif, Qbackquote, Qcomma, Qcomma_at, Qcomma_dot.
      All uses changed.
      * src/alloc.c (QAutomatic_GC): Rename from Qautomatic_gc.
      * src/dbusbind.c (QCsystem): Rename from QCdbus_system_bus.
      (QCsession): Rename from QCdbus_session_bus.
      (QCtimeout): Rename from QCdbus_timeout.
      (QCbyte): Rename from QCdbus_type_byte.
      (QCboolean): Rename from QCdbus_type_boolean.
      (QCint16): Rename from QCdbus_type_int16.
      (QCuint16): Rename from QCdbus_type_uint16.
      (QCint32): Rename from QCdbus_type_int32.
      (QCuint32): Rename from QCdbus_type_uint32.
      (QCint64): Rename from QCdbus_type_int64.
      (QCuint64): Rename from QCdbus_type_uint64.
      (QCdouble): Rename from QCdbus_type_double.
      (QCstring): Rename from QCdbus_type_string.
      (QCobject_path): Rename from QCdbus_type_object_path.
      (QCsignature): Rename from QCdbus_type_signature.
      (QCunix_fd): Rename from QCdbus_type_unix_fd.
      (QCarray): Rename from QCdbus_type_array.
      (QCvariant): Rename from QCdbus_type_variant.
      (QCstruct): Rename from QCdbus_type_struct.
      (QCdict_entry): Rename from QCdbus_type_dict_entry.
      (QCserial): Rename from QCdbus_registered_serial.
      (QCmethod): Rename from QCdbus_registered_method.
      (QCsignal): Rename from QCdbus_registered_signal.
      * src/emacs-module.c (Qinternal__module_call):
      Rename from Qinternal_module_call.
      * src/frame.c (Qwindow__pixel_to_total):
      Rename from Qwindow_pixel_to_total.
      * src/gnutls.c (QChostname): Rename from QCgnutls_bootprop_hostname.
      (QCpriority): Rename from QCgnutls_bootprop_priority.
      (QCtrustfiles): Rename from QCgnutls_bootprop_trustfiles.
      (QCkeylist): Rename from QCgnutls_bootprop_keylist.
      (QCcrlfiles): Rename from QCgnutls_bootprop_crlfiles.
      (QCmin_prime_bits): Rename from QCgnutls_bootprop_min_prime_bits.
      (QCloglevel): Rename from QCgnutls_bootprop_loglevel.
      (QCcomplete_negotiation): Rename from QCgnutls_complete_negotiation.
      (QCverify_flags): Rename from QCgnutls_bootprop_verify_flags.
      (QCverify_error): Rename from QCgnutls_bootprop_verify_error.
      * src/w32fns.c (Qfont_parameter): Rename from Qfont_param.
      (Qgnutls): Rename from Qgnutls_dll.
      (Qlibxml2): Rename from Qlibxml2_dll.
      (Qzlib): Rename from Qzlib_dll.
      * src/w32select.c (Qutf_16le_dos): Rename from QUNICODE.
      * src/window.c (Qwindow__resize_root_window):
      Rename from Qwindow_resize_root_window.
      (Qwindow__resize_root_window_vertically):
      Rename from Qwindow_resize_root_window_vertically.
      (Qwindow__sanitize_window_sizes):
      Rename from Qwindow_sanitize_window_sizes.
      (Qwindow__pixel_to_total): Rename from Qwindow_pixel_to_total.
      * src/xdisp.c (Qredisplay_internal_xC_functionx):
      Rename from Qredisplay_internal.
      * src/xfns.c (Qfont_parameter): Rename from Qfont_param.
      * src/xselect.c (Q_EMACS_TMP_): Rename from QEMACS_TMP.
      f41f573e
  2. 15 Mar, 2016 1 commit
    • Paul Eggert's avatar
      Port to clang 3.7.0 on x86-64 · 7950e1dd
      Paul Eggert authored
      * configure.ac: Use AS_IF so that gl_WARN_ADD’s prerequisites are
      not done conditionally.  This helps clang, which needs
      -Wunknown-warning-option later when configured with warnings.
      * src/editfns.c (invalid_time): Now _Noreturn, since clang isn’t
      smart enough to figure this out on its own if warnings are enabled.
      (lisp_time_struct): Redo for clarity, and to pacify clang.
      * src/xfns.c (x_real_pos_and_offsets) [USE_XCB]: Don’t use
      uninitialized locals.  This avoids undefined behavior and pacifies
      clang.
      7950e1dd
  3. 10 Mar, 2016 2 commits
    • Ken Raeburn's avatar
      Don't use XRANDR 1.3 extensions if the server doesn't support them. · 8b8a6ad3
      Ken Raeburn authored
      * src/xterm.h (struct x_display_info): Add fields to save XRANDR
      version number.
      * src/xfns.c (x_get_monitor_attributes): Save the version numbers
      after querying the X server.
      (x_get_monitor_attributes_xrandr): Don't use XRRGetOutputPrimary or
      XRRGetScreenResourcesCurrent if the server doesn't support at least
      RANDR version 1.3.  Conditionalize the code blocks on compiling
      against library version 1.3 or better, rather than feature tests for
      each function.
      * configure.ac: Stop testing for those two functions.
      8b8a6ad3
    • Paul Eggert's avatar
      Rework C source files to avoid ^( · 7352c6c6
      Paul Eggert authored
      Work around Bug#22884 by rewording comments and strings to avoid ‘(’
      at the start of a line unless it starts a function.  This change
      is a short-term hack; in the longer run we plan to fix cc-mode’s
      performance for C files that have ‘(’ at the start of a line in a
      comment or string.
      7352c6c6
  4. 08 Mar, 2016 2 commits
    • Paul Eggert's avatar
      Pacify --enable-gcc-warnings · e0400b72
      Paul Eggert authored
      * src/xfns.c (x_create_tip_frame): Omit unused local.
      (Fx_show_tip): Don’t jump over auto initialization.
      e0400b72
    • Martin Rudalics's avatar
      Optionally reuse tooltip frames instead of deleting/recreating them. · 80864c2a
      Martin Rudalics authored
      * src/frame.c (tooltip_reuse_hidden_frame): New option.
      * src/w32fns.c (x_create_tip_frame): Remove argument TEXT.  Fix
      handling of dividers.
      (x_hide_tip): New function.
      (Fx_show_tip): Try to reuse old tooltip frame when
      `tooltip-reuse-hidden-frame' is non-nil and frame parameters
      have not changed.  Insert STRING here instead of passing it to
      x_create_tip_frame.  Compute size of tooltip window with
      Fwindow_text_pixel_size.  Obey Vw32_tooltip_extra_pixels when
      padding tooltip window.
      (Fx_hide_tip): Call x_hide_tip.
      (Vw32_tooltip_extra_pixels): New variable.
      * src/xdisp.c (Fwindow_text_pixel_size): Don't return negative y
      value.  Fix doc-string.
      * src/xfns.c (x_create_tip_frame): Remove argument TEXT.  Call
      make_frame with mini_p argument false.
      (x_hide_tip): New function.
      (Fx_show_tip): Try to reuse old tooltip frame when
      `tooltip-reuse-hidden-frame' is non-nil and frame parameters
      have not changed.  Insert STRING here instead of passing it to
      x_create_tip_frame.  Compute size of tooltip window with
      Fwindow_text_pixel_size.
      (Fx_hide_tip): Call x_hide_tip.
      * lisp/cus-start.el (tooltip-reuse-hidden-frame): Add
      customization entry.
      80864c2a
  5. 23 Feb, 2016 1 commit
    • Martin Rudalics's avatar
      Fix `window-configuration-change-hook' and `window-size-change-functions' · 8e7712c7
      Martin Rudalics authored
      (1) Run `window-configuration-change-hook' if and only if at least
      one window was deleted or created or shows another buffer since
      last redisplay.
      
      (2) Run `window-size-change-functions' if and only if at least
      one window changed its size since last redisplay (in a few cases
      `window-size-change-functions' will also run when no window
      changed its size).
      
      (3) Provide two functions `window-pixel-height-before-size-change'
      and `window-pixel-width-before-size-change' that allow to easily
      detect which window changed size.
      
      * src/frame.h (struct frame): New boolean member
      window_configuration_changed.
      (FRAME_WINDOW_SIZES_CHANGED): Remove macro.
      (FRAME_WINDOW_CONFIGURATION_CHANGED): New macro.
      * src/frame.c (adjust_frame_size): Don't run
      `window-configuration-change-hook'.
      * src/window.h (struct window): New fields
      pixel_width_before_size_change and pixel_height_before_size_change.
      (WINDOW_INTERNAL_P): New macro.
      * src/window.c (Fwindow_pixel_width_before_size_change)
      (Fwindow_pixel_height_before_size_change): New functions.
      (Fdelete_other_windows_internal, Fwindow_resize_apply)
      (resize_frame_windows, Fsplit_window_internal)
      (Fdelete_window_internal, grow_mini_window)
      (shrink_mini_window, Fresize_mini_window_internal): Don't call
      FRAME_WINDOW_SIZES_CHANGED.
      (window_size_changed, window_set_before_size_change_sizes)
      (run_window_size_change_functions): New functions.
      (make_window): Initialize pixel_width_before_size_change and
      pixel_height_before_size_change.
      (Fdelete_window_internal): Don't call
      run_window_configuration_change_hook.
      (struct saved_window): Add pixel_height_before_size_change and
      pixel_width_before_size_change.
      (Fset_window_configuration): Try to identify window configuration
      changes correctly so run_window_configuration_change_hook and
      run_window_size_change_functions run only if configuration and size
      really changed.
      (save_window_save): Set the pixel_height_before_size_change and
      pixel_width_before_size_change fields.
      (Vwindow_size_change_functions): Move here definiton from xdisp.c.
      * src/xdisp.c (prepare_menu_bars, redisplay_internal): Call
      run_window_size_change_functions.
      (Vwindow_size_change_functions): Move definition to window.c.
      * src/xfns.c (x_set_menu_bar_lines): Don't call
      run_window_configuration_change_hook.
      * doc/lispref/windows.texi (Window Sizes): Document new
      functions `window-pixel-height-before-size-change' and
      `window-pixel-width-before-size-change'.
      (Window Configurations): Mention that this may trigger
      execution of `window-size-change-functions' although no window
      changed size.
      (Window Hooks): Update descriptions of `window-size-change-functions'
      and `window-configuration-change-hook'.
      8e7712c7
  6. 06 Feb, 2016 1 commit
  7. 23 Jan, 2016 1 commit
  8. 01 Jan, 2016 1 commit
  9. 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
  10. 29 Dec, 2015 1 commit
  11. 15 Dec, 2015 1 commit
  12. 13 Nov, 2015 4 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
    • YAMAMOTO Mitsuharu's avatar
      Remove intern calls and XXX comments from Fx_export_frames · 071b2e16
      YAMAMOTO Mitsuharu authored
      * src/xfns.c (Fx_export_frames): Use Qpdf, Qpng, Qpostscript, and
      Qsvg instead of intern calls.  Use "postscript" instead of "ps"
      for consistency with image types.  Remove XXX comments.
      (syms_of_xfns) <Qpdf>: DEFSYM it.
      
      Backport.
      071b2e16
    • 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
    • YAMAMOTO Mitsuharu's avatar
      Remove intern calls and XXX comments from Fx_export_frames · 805a39bc
      YAMAMOTO Mitsuharu authored
      * src/xfns.c (Fx_export_frames): Use Qpdf, Qpng, Qpostscript, and
      Qsvg instead of intern calls.  Use "postscript" instead of "ps"
      for consistency with image types.  Remove XXX comments.
      (syms_of_xfns) <Qpdf>: DEFSYM it.
      805a39bc
  13. 12 Nov, 2015 2 commits
    • Ken Raeburn's avatar
      Speed up x_real_pos_and_offsets using XCB · aa17de90
      Ken Raeburn authored
      * src/xfns.c (x_real_pos_and_offsets) [USE_XCB]: Add XCB flavors of
      all X calls, and pipeline requests when possible, collecting results
      later.  Eliminate use of x_catch_errors (and thus XSync) in XCB case.
      aa17de90
    • Ken Raeburn's avatar
      Reduce some data dependencies between X calls · e1c27dbd
      Ken Raeburn authored
      Gains nothing in the traditional-Xlib code, but more closely aligns
      with how the XCB version will work.
      
      * src/xfns.c (x_real_pos_and_offsets): When translating coordinates,
      send coordinates (0,0) to the X server and add in the real coordinates
      after getting the response.  Move XGetGeometry for outer window inside
      error-trapping block.  Use DPY variable more, since it's available.
      e1c27dbd
  14. 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
  15. 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
  16. 11 Oct, 2015 3 commits
    • Ken Raeburn's avatar
      Fix cursor setting for tip frame; re-enable cursor generation. · ec2d9902
      Ken Raeburn authored
      * src/xfns.c (x_create_tip_frame): Include the cursor in the window
      attributes sent when creating the new X window.  Don't skip setting
      the pointerColor parameter.
      ec2d9902
    • Ken Raeburn's avatar
      Rewrite x_set_mouse_color to sync less. · 08e27d29
      Ken Raeburn authored
      We can track serial numbers of X requests and correlate error events
      with the associated requests.  This way we can identify errors for
      specific calls without having to use XSync after every one.
      
      * src/xfns.c (enum mouse_cursor): New type.
      (struct mouse_cursor_types, struct mouse_cursor_data): New types.
      (mouse_cursor_types): New array listing the Lisp variables and default
      cursor appearances for each cursor type.
      (x_set_mouse_color_handler): New function; checks error event serial
      number against submitted requests.
      (x_set_mouse_color): Updated to use the new error handler callback,
      and to be more table-driven, to simplify repetitious code.
      08e27d29
    • 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
  17. 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
      Disable non-working pointerColor setting for X tooltip frame. · 1f37714a
      Ken Raeburn authored
      It generates a bunch of server traffic, but there's some bug wherein
      the new mouse cursor settings don't seem to get used.  In most
      situations the cursor isn't likely to be seen anyway, so it's not
      urgent to fix.
      
      * src/xfns.c (x_create_tip_frame): Don't set pointerColor.
      1f37714a
    • 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
      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
  18. 30 Sep, 2015 1 commit
    • Stefan Monnier's avatar
      Try to avoid redisplaying all frames when creating a new one · 8b1df960
      Stefan Monnier authored
      * src/xfns.c (x_set_menu_bar_lines, x_change_tool_bar_height):
      * src/xfaces.c (Finternal_make_lisp_face, Finternal_copy_lisp_face)
      (Finternal_set_lisp_face_attribute, update_face_from_frame_parameter):
      * src/frame.c (x_set_screen_gamma): Set the specific frame's
      `redisplay' bit rather than windows_or_buffers_changed.
      
      * src/window.c (apply_window_adjustment): Remove redundant setting of
      windows_or_buffers_changed.
      
      * src/xdisp.c (redisplay_internal): Set the specific frame's
      `redisplay' bit rather than update_mode_lines in response to
      cursor_type_changed.
      (syms_of_xdisp): Use hash-tables for redisplay_*_cause tables.
      (AINC): Adjust accordingly.
      8b1df960
  19. 16 Sep, 2015 2 commits
    • Paul Eggert's avatar
      Omit unnecessary \ before paren in C docstrings · 032ce1c7
      Paul Eggert authored
      Although \( is needed in docstrings in Elisp code, it is not needed in
      docstrings in C code, since C function definitiions do not start with
      a parenthesis.  The backslashes made the docstrings a bit harder to
      read and to format in columns.  Also, some C docstrings had ( in
      column 1 and this did not appear to be causing any problems.  So,
      simplify C docstrings by replacing \( with ( and \) with ).
      032ce1c7
    • Martin Rudalics's avatar
      Remove tool_bar_redisplayed_once and associated code. · 1636e8c7
      Martin Rudalics authored
      * src/frame.h (tool_bar_redisplayed_once): Remove slot.
      * src/frame.c (make_frame, x_set_font): Remove initialization of
      f->tool_bar_redisplayed_once.
      * src/w32fns.c (x_change_tool_bar_height):
      * src/xfns.c (x_change_tool_bar_height): Don't check for
      f->tool_bar_redisplayed_once.
      * src/xdisp.c (redisplay_internal): Remove handling of
      f->tool_bar_redisplayed_once.
      1636e8c7
  20. 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
  21. 18 Aug, 2015 2 commits
    • Paul Eggert's avatar
      Fix file name encodings in diagnostics · 63673686
      Paul Eggert authored
      Also, close some minor races when opening image files, by opening
      them once instead of multiple times.
      * src/gtkutil.c (xg_get_image_for_pixmap):
      * src/image.c (xpm_load, tiff_load, gif_load, imagemagick_load)
      (svg_load):
      * src/nsimage.m (allocInitFromFile:):
      * src/xfns.c (xg_set_icon):
      Encode file name, since x_find_image_file no longer does that.
      * src/image.c (x_find_image_fd): New function.
      (x_find_image_file): Use it.  Do not encode resulting file name,
      since callers sometimes need it decoded.
      (slurp_file): File arg is now a fd, not a file name.
      All callers changed.  This saves us having to open the file twice.
      (xbm_load, xpm_load, pbm_load, png_load_body, jpeg_load_body)
      (svg_load):
      Use x_find_image_fd and fdopen to save a file-open.
      Report file name that failed.
      * src/lread.c (openp): If PREDICATE is t, open the file in binary mode.
      63673686
    • Martin Rudalics's avatar
      Rewrite and add frame geometry related functions. · c29a51df
      Martin Rudalics authored
      * src/frame.c (Fframe_position): New function.
      (Fset_frame_position): Rename parameters and rewrite doc-string.
      (syms_of_frame): Remove Qframe_position, Qframe_outer_size,
      Qtitle_height and Qframe_inner_size.  Add Qouter_edges,
      Qouter_position, Qouter_size, Qnative_edges, Qinner_edges,
      Qtitle_bar_size.
      * src/nsfns.m (frame_geometry): New function.
      (Fx_frame_geometry): Call frame_geometry.
      (Fx_frame_edges): New function.
      * src/w32fns.c (C_CHILDREN_TITLEBAR, TITLEBAR_INFO)
      (GetTitleBarInfo_Proc): Define these so we can use the
      GetTitleBarInfo API.
      (Fw32_frame_menu_bar_size, Fw32_frame_rect): Remove.
      (Fx_frame_geometry): Rewrite.
      (Fx_frame_edges, Fx_mouse_absolute_pixel_position)
      (Fx_set_mouse_absolute_pixel_position): New functions.
      * src/xfns.c (frame_geometry): New function.
      (Fx_frame_geometry): Call frame_geometry.
      (Fx_frame_edges, Fx_mouse_absolute_pixel_position)
      (Fx_set_mouse_absolute_pixel_position): New functions.
      c29a51df
  22. 26 Jul, 2015 1 commit
  23. 07 Jul, 2015 1 commit
  24. 18 Jun, 2015 1 commit
  25. 16 Jun, 2015 1 commit
    • Martin Rudalics's avatar
      Fix handling of image cache refcounts. (Bug#20802) · 93ae9f46
      Martin Rudalics authored
      This backports Eli Zaretskii's solution of this problem for W32
      to X and NS.
      
      * src/nsfns.m (image_cache_refcount): Define unconditionally.
      (unwind_create_frame): If the image cache's reference count
      hasn't been updated yet, do that now.
      (Fx_create_frame): Set image_cache_refcount unconditionally.
      * src/xfns.c (image_cache_refcount): Define unconditionally.
      (unwind_create_frame): If the image cache's reference count
      hasn't been updated yet, do that now.
      (Fx_create_frame, x_create_tip_frame): Set image_cache_refcount
      unconditionally.
      * src/w32fns.c (image_cache_refcount): Make it a ptrdiff_t as on
      X and NS.
      93ae9f46
  26. 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
  27. 29 May, 2015 1 commit