1. 12 Aug, 2018 1 commit
    • Eli Zaretskii's avatar
      ; Avoid compilation warnings under -Og · d9806a55
      Eli Zaretskii authored
      * src/w32.c (w32_read_registry):
      * src/font.c (font_parse_fcname):
      * src/fns.c (Fnconc):
      * src/editfns.c (tzlookup):
      * src/frame.c (x_set_frame_parameters): Avoid compiler warnings
      about maybe-uninitialized variables.
      d9806a55
  2. 08 Aug, 2018 1 commit
    • Tom Tromey's avatar
      More macro renamings for bignum · d1ec3a0a
      Tom Tromey authored
      * src/alloc.c, src/bidi.c, src/buffer.c, src/buffer.h, src/bytecode.c,
      src/callint.c, src/callproc.c, src/casefiddle.c, src/casetab.c,
      src/category.c, src/ccl.c, src/character.c, src/character.h,
      src/charset.c, src/charset.h, src/chartab.c, src/cmds.c, src/coding.c,
      src/composite.c, src/composite.h, src/data.c, src/dbusbind.c,
      src/decompress.c, src/dired.c, src/dispextern.h, src/dispnew.c,
      src/disptab.h, src/doc.c, src/dosfns.c, src/editfns.c,
      src/emacs-module.c, src/emacs.c, src/eval.c, src/fileio.c,
      src/floatfns.c, src/fns.c, src/font.c, src/font.h, src/fontset.c,
      src/frame.c, src/frame.h, src/fringe.c, src/ftcrfont.c, src/ftfont.c,
      src/gfilenotify.c, src/gnutls.c, src/gtkutil.c, src/image.c,
      src/indent.c, src/insdel.c, src/intervals.c, src/json.c,
      src/keyboard.c, src/keymap.c, src/kqueue.c, src/lcms.c, src/lisp.h,
      src/lread.c, src/macros.c, src/marker.c, src/menu.c, src/minibuf.c,
      src/msdos.c, src/print.c, src/process.c, src/profiler.c, src/search.c,
      src/sound.c, src/syntax.c, src/syntax.h, src/sysdep.c, src/term.c,
      src/termhooks.h, src/textprop.c, src/undo.c, src/w32.c,
      src/w32console.c, src/w32fns.c, src/w32font.c, src/w32inevt.c,
      src/w32proc.c, src/w32select.c, src/w32term.c, src/w32term.h,
      src/w32uniscribe.c, src/window.c, src/xdisp.c, src/xfaces.c,
      src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c, src/xml.c,
      src/xrdb.c, src/xselect.c, src/xsettings.c, src/xterm.c, src/xwidget.c
      Rename XINT->XFIXNUM, XFASTINT->XFIXNAT, XUINT->XUFIXNUM.
      d1ec3a0a
  3. 13 Jul, 2018 1 commit
    • Tom Tromey's avatar
      Rename integerp->fixnum, etc, in preparation for bignums · 42fe787b
      Tom Tromey authored
      * src/json.c, src/keyboard.c, src/keyboard.h, src/keymap.c,
      src/kqueue.c, src/lcms.c, src/lisp.h, src/lread.c, src/macros.c,
      src/marker.c, src/menu.c, src/minibuf.c, src/msdos.c, src/print.c,
      src/process.c, src/profiler.c, src/search.c, src/sound.c,
      src/syntax.c, src/sysdep.c, src/term.c, src/terminal.c,
      src/textprop.c, src/undo.c, src/w16select.c, src/w32.c,
      src/w32console.c, src/w32cygwinx.c, src/w32fns.c, src/w32font.c,
      src/w32inevt.c, src/w32proc.c, src/w32select.c, src/w32term.c,
      src/w32uniscribe.c, src/widget.c, src/window.c, src/xdisp.c,
      src/xfaces.c, src/xfns.c, src/xfont.c, src/xftfont.c, src/xmenu.c,
      src/xrdb.c, src/xselect.c, src/xterm.c, src/xwidget.c: Rename
      INTEGERP->FIXNUM, make_number->make_fixnum, CHECK_NUMBER->CHECK_FIXNUM,
      make_natnum->make_fixed_natum, NUMBERP->FIXED_OR_FLOATP,
      NATNUMP->FIXNATP, CHECK_NATNUM->CHECK_FIXNAT.
      42fe787b
  4. 15 Jun, 2018 1 commit
    • Paul Eggert's avatar
      New mint_ptr representation for C pointers · 30d393f9
      Paul Eggert authored
      * src/lisp.h (make_mint_ptr, mint_ptrp, xmint_pointer): New functions.
      * src/dbusbind.c (xd_lisp_dbus_to_dbus, Fdbus__init_bus):
      * src/emacs-module.c (module_free_global_ref, Fmodule_load)
      (module_assert_runtime, module_assert_env, value_to_lisp)
      (lisp_to_value, initialize_environment)
      (finalize_environment, finalize_runtime_unwind)
      (mark_modules):
      * src/font.c (otf_open, font_put_frame_data)
      (font_get_frame_data):
      * src/macfont.m (macfont_invalidate_family_cache)
      (macfont_get_family_cache_if_present)
      (macfont_set_family_cache):
      * src/nsterm.h (XNS_SCROLL_BAR):
      * src/nsterm.m (ns_set_vertical_scroll_bar)
      (ns_set_horizontal_scroll_bar):
      * src/w32fns.c (w32_monitor_enum)
      (w32_display_monitor_attributes_list):
      * src/xterm.c (x_cr_destroy, x_cr_export_frames):
      * src/xwidget.c (webkit_javascript_finished_cb)
      (save_script_callback, Fxwidget_webkit_execute_script)
      (kill_buffer_xwidgets):
      Use mint pointers instead of merely save pointers.
      30d393f9
  5. 10 Jun, 2018 1 commit
    • Paul Eggert's avatar
      Use native alignment to access Lisp object data · 0303fab3
      Paul Eggert authored
      Instead of using __builtin_assume_aligned (P, GCALIGNMENT) to
      tell GCC that P has alignment 8, use (T *) P where T is the
      type of the pointed-to object, to tell GCC that P has native
      alignment.  This is simpler, matches the intent better, and
      should help simplify future improvements.  Some of these
      changes are to pacify gcc -Wnull-dereference, since GCC is
      smarter about pointers now that Emacs no longer uses
      __builtin_assume_aligned; these minor changes should improve
      code efficiency slightly.  On Fedora 28 x86-64 with default
      optimization this patch shrinks the size of the Emacs text
      segment by 0.36%.
      * src/conf_post.h (__has_builtin, __builtin_assume_aligned):
      Remove; no longer used.
      * src/dbusbind.c (XD_OBJECT_TO_DBUS_TYPE):
      Pacify -Wnull-dereference by using XCAR instead of CAR_SAFE
      and XCDR instead of CDR_SAFE when this is safe.
      * src/fileio.c (Fexpand_file_name):
      * src/font.c (clear_font_cache):
      Pacify -Wnull-dereference by removing unnecessary NILP test.
      * src/keyboard.c (xevent_start): New function.
      (read_char, read_key_sequence): Pacify -Wnull-dereference by
      using xevent_start instead of EVENT_START.
      * src/lisp.h (lisp_h_XUNTAG): Remove; XUNTAG is always a macro
      now, since it can no longer be implemented as a function.
      (XUNTAG): New third argument CTYPE.  All uses changed.
      Cast result to CTYPE * instead of using __builtin_assume_aligned.
      Simplify by using LISP_WORD_TAG.
      (LISP_WORD_TAG): New macro.
      (TAG_PTR): Use it.
      * src/menu.c (x_popup_menu_1):
      Pacify -Wnull-dereference by using XCAR instead of Fcar and
      XCDR instead of Fcdr where this is safe.
      0303fab3
  6. 08 Jun, 2018 1 commit
    • Daniel Colascione's avatar
      Add support for per-window face remapping · 9d447fa1
      Daniel Colascione authored
      Extend face specifications to support the notion of filtering to a
      specific context and add a filter that limits a face specification to
      windows having a certain parameter.
      
      * src/xfaces.c:
      (evaluate_face_filter,filter_face_ref): New functions.
      (merge_face_ref): Ignore filtered face specifications.
      (Fx_list_fonts,get_lface_attributes,merge_face_vectors)
      (merge_named_face,merge_face_ref,merge_face_ref)
      (Finternal_merge_in_global_face,Fface_font,lookup_named_face)
      (lookup_basic_face,Fface_attributes_as_vector)
      (x_supports_face_attributes_p)
      (Fdisplay_supports_face_attributes_p,realize_named_face)
      (compute_char_face,face_at_buffer_position)
      (face_at_buffer_position,face_at_buffer_position)
      (face_at_buffer_position)
      (face_for_overlay_string,face_at_string_position,merge_faces):
      Pass window to face machinery.
      (syms_of_xfaces): Add :window and :filtered
      
      * src/xdisp.c (init_iterator, handle_face_prop)
      (handle_single_display_spec, merge_escape_glyph_face)
      (merge_glyphless_glyph_face, get_next_display_element)
      (next_element_from_display_vector, append_space_for_newline)
      (extend_face_to_end_of_line,highlight_trailing_whitespace)
      (maybe_produce_line_number)
      (display_line, calc_line_height_property): Pass window to
      face machinery.
      
      * src/term.c (tty_menu_activate): Adjust to new face core
      function signature.
      
      * src/msdos.c (XMenuActivate): Adjust to new face core
      function signature.
      
      * src/fringe.c (draw_fringe_bitmap_1, Fset_fringe_bitmap_face):
      Pass window to face machinery.
      
      * src/font.c (font_range, Finternal_char_font): Pass window to
      face machinery.
      
      * src/dispnew.c (spec_glyph_lookup_face): Pass window to
      face machinery.
      
      * src/dispextern.h:
      (lookup_named_face,lookup_basic_face)
      (lookup_derived_face,merge_faces):
      Add struct window arguments to prototypes.
      9d447fa1
  7. 05 Jun, 2018 1 commit
    • Robert Pluim's avatar
      Ignore color fonts when using Xft · f21fa142
      Robert Pluim authored
      * src/font.c (syms_of_font): New configuration variable
      xft-ignore-color-fonts, default t.
      * src/ftfont.c (ftfont_spec_pattern): Tell fontconfig to ignore
      color fonts if xft-ignore-color-fonts is t.  (Bug#30874, Bug#30045)
      * etc/NEWS: Document xft-ignore-color-fonts.
      f21fa142
  8. 02 Jun, 2018 1 commit
    • Eli Zaretskii's avatar
      Avoid infloops in font_open_entity · e96245a5
      Eli Zaretskii authored
      * src/font.c (font_open_entity): Fail after 15 iterations through
      the loop that looks for a font whose average_width and height are
      both positive.  This avoids infinite loops for fonts that, e.g.,
      report average_width of zero for any possible size we try.
      (Bug#31316)
      
      (cherry picked from commit e2879c1f)
      e96245a5
  9. 05 May, 2018 1 commit
    • Eli Zaretskii's avatar
      Avoid infloops in font_open_entity · e2879c1f
      Eli Zaretskii authored
      * src/font.c (font_open_entity): Fail after 15 iterations through
      the loop that looks for a font whose average_width and height are
      both positive.  This avoids infinite loops for fonts that, e.g.,
      report average_width of zero for any possible size we try.
      (Bug#31316)
      e2879c1f
  10. 03 Apr, 2018 1 commit
    • Robert Pluim's avatar
      Ignore color fonts when using Xft · 408bf21a
      Robert Pluim authored
      * src/font.c (syms_of_font): New configuration variable
      xft-ignore-color-fonts, default t.
      * src/ftfont.c (ftfont_spec_pattern): Tell fontconfig to ignore
      color fonts if xft-ignore-color-fonts is t.  (Bug#30874, Bug#30045)
      * etc/NEWS: Document xft-ignore-color-fonts.
      408bf21a
  11. 01 Jan, 2018 1 commit
  12. 15 Dec, 2017 1 commit
  13. 30 Nov, 2017 1 commit
    • Eli Zaretskii's avatar
      Avoid assertions in find-composition · bdbcdbac
      Eli Zaretskii authored
      * src/font.c (font_range): If called with STRING non-nil and FACE
      a NULL pointer, compute face by calling face_at_string_position.
      (Bug#29506)
      
      * lisp/composite.el (find-composition): Doc fix.
      bdbcdbac
  14. 26 Nov, 2017 1 commit
    • Eli Zaretskii's avatar
      Improve documentation of "constant" symbols · 16358d4f
      Eli Zaretskii authored
      * src/font.c (syms_of_font) <font-weight-table, font-slant-table>
      <font-width-table>:
      * src/data.c (syms_of_data) <most-positive-fixnum>
      <most-negative-fixnum>:
      * src/buffer.c (syms_of_buffer) <enable-multibyte-characters>:
      Mention in the doc strings that these variables are read-only.
      
      * doc/lispref/variables.texi (Creating Buffer-Local): Document
      that making a constant variable buffer-local signals an error.
      * doc/lispref/variables.texi (Constant Variables):
      * doc/lispref/errors.texi (Standard Errors): More accurate and
      up-to-date documentation of which symbols cannot be assigned
      values.
      16358d4f
  15. 13 Sep, 2017 1 commit
    • Paul Eggert's avatar
      Prefer HTTPS to FTP and HTTP in documentation · bc511a64
      Paul Eggert authored
      Most of this change is to boilerplate commentary such as license URLs.
      This change was prompted by ftp://ftp.gnu.org's going-away party,
      planned for November.  Change these FTP URLs to https://ftp.gnu.org
      instead.  Make similar changes for URLs to other organizations moving
      away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
      fsf.org when this works, as this will further help defend against
      man-in-the-middle attacks (for this part I omitted the MS-DOS and
      MS-Windows sources and the test tarballs to keep the workload down).
      HTTPS is not fully working to lists.gnu.org so I left those URLs alone
      for now.
      bc511a64
  16. 11 Jul, 2017 1 commit
    • NicolasPetton's avatar
      Add an optional testfn parameter to assoc · 0bece6c6
      NicolasPetton authored
      * src/fns.c (assoc): New optional testfn parameter used for comparison
      when provided.
      * test/src/fns-tests.el (test-assoc-testfn): Add tests for the new
      'testfn' parameter.
      * src/buffer.c:
      * src/coding.c:
      * src/dbusbind.c:
      * src/font.c:
      * src/fontset.c:
      * src/gfilenotify.c:
      * src/image.c:
      * src/keymap.c:
      * src/process.c:
      * src/w32fns.c:
      * src/w32font.c:
      * src/w32notify.c:
      * src/w32term.c:
      * src/xdisp.c:
      * src/xfont.c: Add a third argument to Fassoc calls.
      * etc/NEWS:
      * doc/lispref/lists.texi: Document the new 'testfn' parameter.
      0bece6c6
  17. 26 Apr, 2017 1 commit
  18. 16 Apr, 2017 1 commit
    • Eli Zaretskii's avatar
      Fix redisplay performance problems with some fonts · 58430f29
      Eli Zaretskii authored
      * src/font.c (font_list_entities): Revert part of the changes
      introduced on Apr 2, 2014 to fix bug#17125.  It turns out having
      zero_vector in the font-cache is an important indication that
      cannot be removed.  (Bug#21028)
      58430f29
  19. 01 Jan, 2017 1 commit
  20. 03 Dec, 2016 1 commit
    • Noam Postavsky's avatar
      Add lisp watchpoints · 22721316
      Noam Postavsky authored
      This allows calling a function whenever a symbol-value is changed.
      
      * src/lisp.h (lisp_h_SYMBOL_TRAPPED_WRITE_P):
      (SYMBOL_TRAPPED_WRITE_P): New function/macro.
      (lisp_h_SYMBOL_CONSTANT_P): Check for SYMBOL_NOWRITE specifically.
      (enum symbol_trapped_write): New enumeration.
      (struct Lisp_Symbol): Rename field constant to trapped_write.
      (make_symbol_constant): New function.
      
      * src/data.c (Fadd_variable_watcher, Fremove_variable_watcher):
      (set_symbol_trapped_write, restore_symbol_trapped_write):
      (harmonize_variable_watchers, notify_variable_watchers): New functions.
      
      * src/data.c (Fset_default): Call `notify_variable_watchers' for trapped
      symbols.
      (set_internal): Change bool argument BIND to 3-value enum and call
      `notify_variable_watchers' for trapped symbols.
      
      * src/data.c (syms_of_data):
      * src/data.c (syms_of_data):
      * src/font.c (syms_of_font):
      * src/lread.c (intern_sym, init_obarray):
      * src/buffer.c (syms_of_buffer): Use make_symbol_constant.
      
      * src/alloc.c (init_symbol):
      * src/bytecode.c (exec_byte_code): Use SYMBOL_TRAPPED_WRITE_P.
      * src/data.c (Fmake_variable_buffer_local, Fmake_local_variable):
      (Fmake_variable_frame_local):
      * src/eval.c (Fdefvaralias, specbind): Refer to Lisp_Symbol's
      trapped_write instead of constant.
      (Ffuncall): Move subr calling code into separate function.
      (funcall_subr): New function.
      22721316
  21. 02 Dec, 2016 1 commit
    • Paul Eggert's avatar
      Make struct font_drivers read-only · ebb96114
      Paul Eggert authored
      This simplifies the code a bit, and makes the structs more
      shareable and less likely to become corrupt.
      * src/alloc.c (cleanup_vector):
      * src/font.c (valid_font_driver, font_prepare_cache)
      (font_finish_cache, font_get_cache, font_clear_cache)
      (register_font_driver, font_update_drivers):
      * src/font.h (struct font, struct font_driver_list)
      (valid_font_driver):
      struct font_drivers are now const.
      * src/font.c, src/ftcrfont.c, src/ftfont.c, src/nsfont.m, src/xfont.c:
      Omit no-longer-necessary decls.
      * src/ftcrfont.c (syms_of_ftcrfont):
      * src/ftxfont.c (syms_of_ftxfont):
      * src/xftfont.c (syms_of_xftfont):
      Omit no-longer-necessary initialization code.
      * src/ftcrfont.c (ftcrfont_driver):
      * src/ftfont.c (ftfont_driver):
      * src/ftxfont.c (ftxfont_driver):
      * src/macfont.m (macfont_driver):
      * src/nsfont.m (nsfont_driver):
      * src/xfont.c (xfont_driver):
      * src/xftfont.c (xftfont_driver):
      Use C99-style initializer for ease of maintenance, and make it const.
      * src/ftcrfont.c, src/ftxfont.c, src/xftfont.c:
      Refer to functions like ftfont_text_extents directly.
      * src/ftfont.c (ftfont_get_cache, ftfont_list, ftfont_list_family)
      (ftfont_has_char, ftfont_encode_char, ftfont_text_extents)
      (ftfont_get_bitmap, ftfont_anchor_point, ftfont_otf_capability)
      (ftfont_variation_glyphs, ftfont_filter_properties)
      (ftfont_combining_capability):
      * src/xfont.c (xfont_get_cache):
      Now extern, so that other modules’ struct font_drivers can use
      them directly.
      * src/macfont.m (macfont_descriptor_entity):
      * src/nsfont.m (nsfont_open):
      Use constant directly; this is clearer.
      ebb96114
  22. 29 Oct, 2016 1 commit
    • Daniel Colascione's avatar
      Add double-buffering support to reduce flicker · c2907158
      Daniel Colascione authored
      * src/dispextern.h (struct glyph_string): Remove window member
      (block_buffer_flips, unblock_buffer_flips)
      (buffer_flipping_blocked_p): Declare.
      
      * src/xterm.h (struct x_display_info): New member supports_xdbe.
      (struct x_output): New members draw_desc and need_buffer_flip.
      (FRAME_X_DRAWABLE, FRAME_X_RAW_DRAWABLE)
      (FRAME_X_DOUBLE_BUFFERED_P)
      (FRAME_X_NEED_BUFFER_FLIP): New macros.
      (set_up_x_back_buffer, tear_down_x_back_buffer)
      (initial_set_up_x_back_buffer): Declare.
      
      * src/xterm.c: Include Xdbe.h.
      (x_begin_cr_clip, x_fill_rectangle, x_draw_rectangle)
      (x_draw_vertical_window_border, x_update_end)
      (x_setup_relief_color, x_draw_relief_rect)
      (x_draw_fringe_bitmap, x_shift_glyphs_for_insert)
      (x_scroll_run, x_draw_hollow_cursor, x_draw_bar_cursor): Use
      FRAME_X_DRAWABLE instead of FRAME_X_WINDOW; rename local
      variables appropriately; substitute calls to XClearArea with
      x_clear_area, which DTRT for double buffering.
      (x_clear_window, x_clear_area): In double-buffering mode, use
      rect-drawing X functions instead of XClearWindow and
      XClearArea, which always operate on the front buffer.
      (show_back_buffer): New function.
      (XTframe_up_to_date): Call show_back_buffer when done.
      (x_clear_frame, x_clear_frame_area): Remove obsolete calls to
      gtk_widget_queue_draw to refresh scroll bars; scroll bars are
      now independent X windows.
      (handle_one_xevent): Call font_drop_xrender_surfaces when
      XftDraw might need regenerating; perform buffer flip when
      responding to Expose events; issue front-buffer clearing
      commands as stopgap while we wait for redisplay.
      Call flush_dirty_back_buffers.
      (x_make_frame_visible): Un-bitrot comment; move XSETFRAME
      earlier in function.
      (x_free_frame_resources): Call tear_down_x_back_buffer when
      destroying frame.
      (x_term_init): Attempt to initialize double buffer extension.
      (x_flip_and_flush): New function.
      (x_redisplay_interface): Point to x_flip_and_flush instead of
      x_flip directly.
      (flush_dirty_back_buffers): New function.
      (x_create_terminal): Register buffer_flipping_unblocked_hook.
      
      * src/xftfont.c (xftfont_drop_xrender_surfaces): Use
      FRAME_X_DRAWABLE instead of FRAME_X_WINDOW.
      (xftfont_draw): Call x_mark_frame_dirty.
      (xftfont_drop_xrender_surfaces): New function.
      (syms_of_xftfont): Register it.
      
      * src/xfont.c (xfont_draw): Use FRAME_X_DRAWABLE instead of
      FRAME_X_WINDOW.
      
      * src/xfns.c: Include Xdbe.h.
      (x_set_inhibit_double_buffering, set_up_x_back_buffer)
      (Fx_double_buffered_p): New functions.
      (x_window): Call initial_set_up_x_back_buffer.
      (x_make_gc): Use FRAME_X_DRAWABLE instead of FRAME_X_WINDOW.
      (Fx_create_frame): Configure `inhibit-double-buffering'
      frame parameter.
      (x_create_tip_frame): Call initial_set_up_x_back_buffer.
      (x_frame_parm_handlers): Register
      x_set_inhibit_double_buffering.
      (syms_of_xfns): Register Sx_double_buffered_p.
      (x_mark_frame_dirty): Define.
      
      * src/xfaces.c (x_create_gc): Use FRAME_X_DRAWABLE instead of
      FRAME_X_WINDOW.
      
      * src/xdisp.c (remember_mouse_glyph, init_glyph_string): Use
      FRAME_X_DRAWABLE instead of FRAME_X_WINDOW.
      (redisplay_internal): Restart redisplay if a frame is garbaged
      during updating; explain why. Block buffer flips
      during redisplay.
      (redisplay_preserve_echo_area): Block buffer flip during call
      to redisplay_internal.
      (buffer_flip_blocked_depth): New variable.
      (block_buffer_flips, unblock_buffer_flips)
      (buffer_flipping_blocked_p): New functions.
      (init_glyph_string): Stop setting window member of struct
      glyph_string.
      
      * src/w32fns.c (w32_frame_parm_handlers): Add placeholder for
      x_set_inhibit_double_buffering.
      
      * src/termhooks.h (struct terminal): Add
      buffer_flipping_unblocked_hook.
      
      * src/nsfns.m (ns_frame_parm_handlers): Add placeholder for
      x_set_inhibit_double_buffering.
      
      * src/image.c (x_create_bitmap_from_data)
      (x_create_bitmap_from_file, x_create_x_image_and_pixmap)
      (Create_Pixmap_From_Bitmap_Data)
      (x_create_bitmap_from_xpm_data, xpm_load, gs_load): Use
      FRAME_X_DRAWABLE instead of FRAME_X_WINDOW; rename local
      variables appropriately.
      
      * src/gtkutil.c: Include Xdbe.h.
      (xg_get_widget_from_map): Forward declare.
      (xg_clear_under_internal_border): Remove obsolete calls to
      refresh scroll bars.
      (xg_create_frame_widgets): Call initial_set_up_x_back_buffer.
      (xg_free_frame_widgets): Call tear_down_x_back_buffer; reset
      FRAME_X_DRAWABLE as well as FRAME_X_WINDOW and for the
      same reason.
      (xg_set_background_color): Set scroll bar background colors.
      (xg_finish_scroll_bar_creation): New function with common
      logic of xg_create_scroll_bar, xg_create_horizontal_scroll_bar. Force
      scroll bars to be real X11 windows.
      (xg_create_scroll_bar, xg_create_horizontal_scroll_bar): Call
      xg_finish_scroll_bar_creation.
      (xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
      Remove obsolete calls to refresh scroll bars; fix comments.
      
      * src/ftxfont.c (ftxfont_get_gcs, ftxfont_draw_bitmap,
      (ftxfont_draw_background): Use FRAME_X_DRAWABLE instead of
      FRAME_X_WINDOW.
      
      * src/frame.c (frame_parms): Add table entry for new
      `inhibit-double-buffering' frame parameter
      (syms_of_frame): Register Qinhibit_double_buffering.
      
      * src/font.h (struct font_driver): Add new `flush_frame_caches' hook.
      (font_drop_xrender_surfaces): Declare.
      
      * src/font.c (font_drop_xrender_surfaces): New function.
      
      * src/Makefile.in (XDBE_LIBS, XDBE_CFLAGS): Substitute.
      
      * etc/NEWS: Mention use of double buffering
      
      * doc/lispref/frames.texi (Management Parameters): Document
      `inhibit-double-buffering' frame parameters.
      (Visibility of Frames): Document `x-double-buffered-p'.
      
      * configure.ac: Check for the X double buffer extension
      c2907158
  23. 08 Oct, 2016 1 commit
    • Eli Zaretskii's avatar
      Allow to disable compaction of font caches · 44e402ea
      Eli Zaretskii authored
      * src/font.c (syms_of_font) <inhibit-compacting-font-caches>: New
      boolean variable.
      * src/alloc.c (compact_font_caches): Use it to bypass the call to
      compact_font_cache_entry.  (Bug#24634)  (Bug#24565)
      
      * etc/NEWS: Mention the new variable.
      44e402ea
  24. 30 Sep, 2016 1 commit
    • Paul Eggert's avatar
      Limit <config.h>’s includes · f4eb8900
      Paul Eggert authored
      This follows up on recent problems with the fact that config.h
      includes stdlib.h etc.; some files need to include stdlib.h later.
      config.h generally should limit itself to includes that are
      universally safe; outside of MS-Windows, only stdbool.h makes
      the cut among the files currently included.  So, move the
      other includes to just the files that need them (Bug#24506).
      * configure.ac (config_opsysfile): Remove, as this generic hook
      is no longer needed.
      * lib-src/etags.c, src/unexmacosx.c, src/w32.c, src/w32notify.c:
      * src/w32proc.c (_GNU_SOURCE):
      Remove, as it’s OK for config.h to do this now.
      * src/conf_post.h: Include <ms-w32.h>, instead of the generic
      config_opsysfile, for simplicity as this old way of configuring is
      now done only for the MS-Windows port.  Do not include <ms-w32.h>
      if DEFER_MS_W32_H, for the benefit of the few files that want its
      effects later.  Do not include <alloca.h>, <string.h>, or
      <stdlib.h>.  Other files modified to include these headers as
      needed, or to not include headers that are no longer needed.
      * src/lisp.h: Include <alloca.h> and <string.h> here, since
      some of the inline functions need them.
      * src/regex.c: Include <alloca.h> if not emacs.  (If emacs,
      we can rely on SAFE_ALLOCA.)  There is no longer any need to
      worry about HAVE_ALLOCA_H.
      * src/unexmacosx.c: Rely on config.h not including stdlib.h.
      * src/w32.c, src/w32notify.c, src/w32proc.c (DEFER_MS_W32_H):
      Define before including <config.h> first, and include <ms-w32.h>
      after the troublesome headers.
      f4eb8900
  25. 24 Sep, 2016 1 commit
    • Paul Eggert's avatar
      Improve integer overflow handling a bit · b3e1b382
      Paul Eggert authored
      * src/charset.c (read_hex): Use INT_LEFT_SHIFT_OVERFLOW for clarity.
      The machine code is the same on my platform.
      * src/doprnt.c (doprnt):
      * src/emacs-module.c (module_funcall):
      * src/font.c (font_intern_prop):
      * src/keyboard.c (Frecursion_depth):
      * src/lread.c (read1):
      Use WRAPV macros instead of checking overflow by hand.
      * src/editfns.c (hi_time, time_arith, decode_time_components):
      * src/emacs-module.c (Fmodule_load):
      Simplify by using FIXNUM_OVERFLOW_P.
      * src/emacs-module.c: Include intprops.h.
      * src/xdisp.c (percent99): New function.
      (decode_mode_spec): Use it to simplify overflow avoidance and
      formatting of %p and %P.
      b3e1b382
  26. 21 Jun, 2016 1 commit
    • Ken Brown's avatar
      Fix compiler warnings in no-window-system-build · d4c1535c
      Ken Brown authored
      * src/composite.c (autocmp_chars): Declare and set 'f' only if
      HAVE_WINDOW_SYSTEM.
      
      * src/dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P)
      (FACE_FOR_CHAR): Explicitly discard unused arguments.
      
      * src/font.c (font_open_entity): Declare 'min_width' where it is
      first set, and only if HAVE_WINDOW_SYSTEM.
      
      * src/frame.c [!HAVE_WINDOW_SYSTEM] (decode_window_system_frame):
      Define _Noreturn version to avoid "suggest attribute noreturn"
      compiler warning.
      (check_window_system): Declare as _Noreturn.
      (Ficonify_frame):
      (Fset_frame_position): Don’t declare and set 'f'.
      
      * src/frame.h [!HAVE_WINDOW_SYSTEM] (decode_window_system_frame)
      (check_window_system):  Add _Noreturn prototypes.
      (FRAME_FRINGE_COLS, FRAME_TOTAL_FRINGE_WIDTH)
      (FRAME_LEFT_FRINGE_WIDTH, FRAME_RIGHT_FRINGE_WIDTH)
      (FRAME_INTERNAL_BORDER_WIDTH, FRAME_RIGHT_DIVIDER_WIDTH)
      (FRAME_BOTTOM_DIVIDER_WIDTH): Explicitly discard unused argument.
      
      * src/xdisp.c (handle_single_display_spec): Declare
      'fringe_bitmap' only if HAVE_WINDOW_SYSTEM.
      (append_space_for_newline): Declare 'g' where it is first set.
      (Fmove_point_visually): Declare and set 'target_is_eol_p' only if
      HAVE_WINDOW_SYSTEM.
      (show_mouse_face): Declare and set 'f' and 'phys_cursor_on_p' only
      if HAVE_WINDOW_SYSTEM.
      (note_mode_line_or_margin_highlight):
      (note_mouse_highlight): Declare and set 'cursor' and 'pointer'
      only if HAVE_WINDOW_SYSTEM.
      
      * src/xfaces.c (realize_default_face): Declare and set 'face' only
      if HAVE_X_WINDOWS.  Remove redundant #ifdef.
      d4c1535c
  27. 08 Jun, 2016 1 commit
  28. 04 Apr, 2016 1 commit
    • Paul Eggert's avatar
      New C macro AUTO_STRING_WITH_LEN · 17cb263a
      Paul Eggert authored
      Put a bit less pressure on the garbage collector by defining a
      macro that is like AUTO_STRING but also allows null bytes in strings,
      and by extending AUTO_STRING to work with any unibyte string.
      * src/alloc.c (verify_ascii): Remove; all uses removed.
      AUTO_STRING can now be used on non-ASCII unibyte strings.
      * src/lisp.h (AUTO_STRING): Now allows non-ASCII unibyte strings.
      (AUTO_STRING_WITH_LEN): New macro.
      * src/coding.c (from_unicode_buffer):
      * src/editfns.c (format_time_string):
      * src/emacs-module.c (module_make_string, module_format_fun_env):
      * src/fileio.c (Fexpand_file_name):
      * src/font.c (font_parse_family_registry):
      * src/ftfont.c (ftfont_get_charset):
      * src/keymap.c (silly_event_symbol_error):
      * src/menu.c (single_menu_item):
      * src/sysdep.c (system_process_attributes):
      Use AUTO_STRING_WITH_LEN if possible.
      * src/emacs-module.c (module_make_function):
      * src/fileio.c (report_file_errno, report_file_notify_error):
      * src/fns.c (Flocale_info):
      * src/sysdep.c (system_process_attributes):
      Use AUTO_STRING if possible.  This is doable more often now
      that AUTO_STRING works on any unibyte string.
      17cb263a
  29. 27 Mar, 2016 1 commit
  30. 10 Mar, 2016 1 commit
    • 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
  31. 26 Jan, 2016 1 commit
    • K. Handa's avatar
      support rendering of wider range of combinging characters by ftfont backend · 4a3db0f7
      K. Handa authored
      * lisp/language/hebrew.el (hebrew-shape-gstring): If the font backend
      supports rendering of combining characters, call
      font-shape-gstring.
      
      * src/font.c (Ffont_get): Handle `combining-capability' property.
      (syms_of_font): New symbol ":combining-capability'.
      
      * src/font.h (struct font_driver): New member combining_capability.
      
      * src/ftfont.c: Include "category.h".
      (ftfont_driver): Initialize combining_capability to
      ftfont_combining_capability.
      (ftfont_shape_by_flt): If OTF is null, try to find a suitable
      FLT in advance.
      (ftfont_combining_capability): New function.
      
      (cherry picked from commit 536f48e9)
      4a3db0f7
  32. 02 Jan, 2016 1 commit
    • K. Handa's avatar
      support rendering of wider range of combinging characters by ftfont backend · 536f48e9
      K. Handa authored
      * lisp/language/hebrew.el (hebrew-shape-gstring): If the font backend
      supports rendering of combining characters, call
      font-shape-gstring.
      
      * src/font.c (Ffont_get): Handle `combining-capability' property.
      (syms_of_font): New symbol ":combining-capability'.
      
      * src/font.h (struct font_driver): New member combining_capability.
      
      * src/ftfont.c: Include "category.h".
      (ftfont_driver): Initialize combining_capability to
      ftfont_combining_capability.
      (ftfont_shape_by_flt): If OTF is null, try to find a suitable
      FLT in advance.
      (ftfont_combining_capability): New function.
      536f48e9
  33. 01 Jan, 2016 1 commit
  34. 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
  35. 20 Oct, 2015 1 commit
  36. 02 Oct, 2015 1 commit
    • Paul Eggert's avatar
      Fix problems found by clang 3.5.0 · 355ccbcf
      Paul Eggert authored
      * src/cmds.c (Fdelete_char): Don’t assume XINT returns int.
      * src/font.c (font_parse_family_registry):
      Use &"str"[X] instead of "str"+X, to pacify clang -Wstring-plus-int.
      355ccbcf
  37. 16 Sep, 2015 1 commit
    • 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
  38. 09 Sep, 2015 1 commit
  39. 30 Jun, 2015 1 commit
  40. 29 Jun, 2015 1 commit