1. 16 Oct, 2015 2 commits
    • Paul Eggert's avatar
      Make src headers idempotent and standalone · 55ba8c02
      Paul Eggert authored
      Redo src/*.h so that each include file is idempotent (that is, can
      be included multiple times with the latter inclusions having no
      effect) and standalone (that is, can be included by itself,
      with no include file other than config.h needed as a prerequisite).
      This is standard practice in GNU programs nowadays.
      * lwlib/lwlib-widget.h, src/buffer.h, src/category.h, src/character.h:
      * src/charset.h, src/coding.h, src/commands.h, src/disptab.h:
      * src/fontset.h, src/gnutls.h, src/indent.h, src/keymap.h, src/macros.h:
      * src/regex.h [emacs]:
      * src/syntax.h, src/systty.h, src/termhooks.h:
      Include lisp.h, for Lisp_Object.
      * src/buffer.h, src/category.h, src/cm.h, src/commands.h, src/disptab.h:
      * src/indent.h, src/intervals.h, src/keyboard.h, src/macros.h:
      * src/process.h, src/puresize.h, src/region-cache.h, src/syntax.h:
      * src/syssignal.h, src/sysstdio.h, src/systty.h, src/termchar.h:
      * src/termopts.h, src/tparam.h, src/unexec.h:
      Protect against multiple inclusion.
      * src/buffer.h: Include character.h, for STRING_CHAR.
      * src/emacsgtkfixed.h (struct frame):
      * src/fontset.h (struct face):
      * src/region-cache.h (struct buffer):
      * src/termhooks.h (struct glyph):
      * src/xsettings.h (struct x_display_info):
      Add possibly-forward decl.
      * src/syntax.h: Include buffer.h, for BVAR.
      * src/sysselect.h: Include lisp.h, for eassume.
      * src/termchar.h: Include <stdio.h>, for FILE.
      * src/widget.h: Include <X11/IntrinsicP.h>, for Widget.
      * src/xsettings.h: Include <X11/Xlib.h>, for XEvent.
      55ba8c02
    • Eli Zaretskii's avatar
      Improve documentation of COLLECTION in completion functions · d05410f3
      Eli Zaretskii authored
      * doc/lispref/minibuf.texi (Minibuffer Completion): Add a
      cross-reference to "Programmed Completion".
      
      * src/minibuf.c (Fcompleting_read): Improve the doc string.
      (Bug#21644)
      d05410f3
  2. 15 Oct, 2015 1 commit
  3. 14 Oct, 2015 3 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
    • Paul Eggert's avatar
      Take XPNTR private · 2cc412cd
      Paul Eggert authored
      * src/alloc.c (PURE_POINTER_P): Remove.
      All uses replaced with PURE_P.
      (XPNTR_OR_SYMBOL_OFFSET): New function.
      (XPNTR): Move here from lisp.h.
      Reimplement in terms of XPNTR_OR_SYMBOL_OFFSET.
      (mark_maybe_object, valid_lisp_object_p, survives_gc_p):
      Remove unnecessary cast.
      (purecopy): Use XPNTR_OR_SYMBOL_OFFSET instead of XPNTR,
      to avoid an unnecessary runtime test for symbols.
      * src/lisp.h (lisp_h_XPNTR, XPNTR): Remove, moving XPNTR to alloc.c.
      Only alloc.c needs XPNTR now.
      2cc412cd
    • 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
  4. 13 Oct, 2015 2 commits
    • Juanma Barranquero's avatar
    • 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
  5. 12 Oct, 2015 4 commits
  6. 11 Oct, 2015 6 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
      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
      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
    • Paul Eggert's avatar
      Use ‘echo’ safely with ‘\’ or leading ‘-’ · 29dfca23
      Paul Eggert authored
      POSIX says that ‘echo FOO’ produces implementation-defined output
      if FOO contains leading ‘-’, or ‘\’ anywhere, so don’t assume GNU
      behavior in that case.
      * Makefile.in (removenullpaths): Remove.
      (epaths-force): Rewrite to avoid the need for ‘echo’.
      (install-etc): Be clearer about escaping the shell metacharacters
      ‘\’ and ‘$’.
      * Makefile.in (install-arch-indep, install-etcdoc):
      * admin/charsets/mapconv, admin/merge-gnulib, admin/merge-pkg-config:
      * admin/quick-install-emacs, build-aux/gitlog-to-emacslog:
      * configure.ac, lib-src/rcs2log, make-dist:
      * src/Makefile.in (lisp.mk):
      Don’t assume ‘echo’ outputs ‘\’ and leading ‘-’ unscathed.
      For example, use ‘printf '%s\n' "$foo"’ rather than ‘echo "$foo"’
      if $foo can contain arbitrary characters.
      * lisp/Makefile.in (TAGS): Use ‘ls’, not ‘echo’, to avoid ‘\’ issues.
      * doc/lispref/two-volume.make (vol1.pdf):
      * test/etags/make-src/Makefile (web ftp publish):
      Use ‘printf’ rather than ‘echo -e’.
      29dfca23
  7. 10 Oct, 2015 6 commits
  8. 09 Oct, 2015 2 commits
  9. 08 Oct, 2015 7 commits
    • Paul Eggert's avatar
      * src/image.c (image_size_error): Simplify. · a00634c2
      Paul Eggert authored
      a00634c2
    • 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
      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
    • Stefan Monnier's avatar
  10. 07 Oct, 2015 2 commits
  11. 06 Oct, 2015 3 commits
    • Paul Eggert's avatar
      Fix bug in GC_CHECK_MARKED_OBJECTS check · 3b4d119c
      Paul Eggert authored
      * src/alloc.c (mark_object): Fix bug in checking code.
      When GC_CHECK_MARKED_OBJECTS is defined, the bug caused
      CHECK_ALLOCATED_AND_LIVE_SYMBOL to repeatedly do the
      CHECK_ALLOCATED and CHECK_LIVE tests for the first symbol in each
      bucket.  The bug did not affect behavior either in the normal case
      where GC_CHECK_MARKED_OBJECTS is not defined, or where Emacs does
      not have an internal error that a properly-written
      CHECK_ALLOCATED_AND_LIVE_SYMBOL would detect.
      3b4d119c
    • Eli Zaretskii's avatar
      Fix display of characters adjacent to ZWJ and ZWNJ · e2b1ad42
      Eli Zaretskii authored
      * src/bidi.c (bidi_resolve_neutral): Treat all Bn (a.k.a. "control")
      characters the same as directional formatting controls.
      (bidi_level_of_next_char): Include all Bn characters in rule L1,
      as mandated by the UBA.
      e2b1ad42
    • Andreas Schwab's avatar
      Don't use XFASTINT on a negative number · 0befeb0b
      Andreas Schwab authored
      * src/cmds.c (Fself_insert_command): Don't use XFASTINT on a negative
      number.  (Bug#21633)
      0befeb0b
  12. 05 Oct, 2015 2 commits