1. 18 Jun, 2019 1 commit
    • YAMAMOTO Mitsuharu's avatar
      Support font driver supersession · 64767008
      YAMAMOTO Mitsuharu authored
      * src/font.c (font_update_drivers): If argument NEW_DRIVERS is t, then don't
      use superseded drivers.
      (syms_of_font) <Qfont_driver_superseded_by>: New DEFSYM.
      
      * src/ftfont.c (syms_of_ftfont) [HAVE_HARFBUZZ]:
      * src/ftcrfont.c (syms_of_ftcrfont) [HAVE_HARFBUZZ]:
      * src/w32font.c (syms_of_w32font) [HAVE_HARFBUZZ]:
      * src/xftfont.c (syms_of_xftfont) [HAVE_HARFBUZZ]: Make Harfbuzz variants
      supersede non-Harfbuzz ones.
      
      * src/w32fns.c (Fx_create_frame, w32_create_tip_frame): Remove font backend
      determination code.
      64767008
  2. 08 Jun, 2019 1 commit
    • YAMAMOTO Mitsuharu's avatar
      Support X core font driver on cairo (Bug#28236) · faf10bd8
      YAMAMOTO Mitsuharu authored
      * configure.ac (HAVE_X_WINDOWS): Add xfont.o to FONT_OBJ if HAVE_CAIRO.
      
      * doc/lispref/frames.texi (Font and Color Parameters): Mention X core font
      driver with Cairo drawing.
      
      * src/font.c (syms_of_font) [HAVE_X_WINDOWS && USE_CAIRO]: Call syms_of_xfont.
      
      * src/xfns.c (x_create_tip_frame) [USE_CAIRO]: Register xfont_driver.
      
      * src/xterm.c (x_cr_gc_clip) [USE_CAIRO]: New function extracted from
      x_begin_cr_clip.
      (x_begin_cr_clip) [USE_CAIRO]: Use it.
      (xlib_surface_key, saved_drawable_key) [USE_CAIRO]: New variables.
      (x_cr_destroy_xlib_surface, x_try_cr_xlib_drawable)
      (x_end_cr_xlib_drawable) [USE_CAIRO]: New functions.
      (x_draw_composite_glyph_string_foreground)
      (x_draw_glyph_string_foreground) [USE_CAIRO]: Get Xlib surface when drawing
      text with X core fonts into bitmap surfaces.  Add fallback code for drawing
      into outline surfaces.
      faf10bd8
  3. 01 Jun, 2019 1 commit
  4. 24 Apr, 2019 1 commit
    • Eli Zaretskii's avatar
      Revert "Remove font.c code commented out for a decade" · 5ae407aa
      Eli Zaretskii authored
      This reverts commit 64d0cd98.
      
      Rationale: any font-related code and comments, even if unused
      for decades, serves as important source of useful information
      in an area of Emacs code that is notoriously under-documented.
      
      Please do NOT remove this stuff until we have an active
      expert in this are on board, who will then decide whether
      this can be retired.
      5ae407aa
  5. 23 Apr, 2019 1 commit
    • Paul Eggert's avatar
      Remove font.c code commented out for a decade · 64d0cd98
      Paul Eggert authored
      * src/font.c (LSTRING_HEADER_SIZE, LSTRING_GLYPH_SIZE, check_gstring)
      (check_otf_features, otf_list, otf_tag_symbol, otf_open)
      (font_otf_capability, generate_otf_features)
      (font_otf_DeviceTable, font_otf_ValueRecord)
      (font_otf_Anchor, Ffont_drive_otf, Ffont_otf_alternates)
      (Fdraw_string, syms_of_font): Remove "experimental and not
      tested much" code that has been "#if 0"-ed out for more than a
      decade and which was getting in the way of maintenance.
      64d0cd98
  6. 22 Mar, 2019 1 commit
    • Stefan Monnier's avatar
      Fix misuses of NULL when talking about the NUL character · 76fea1eb
      Stefan Monnier authored
      * lisp/subr.el (inhibit-null-byte-detection): Make it an obsolete alias.
      
      * src/coding.c (setup_coding_system): Use new name.
      (detect_coding): Rename null_byte_found => nul_byte_found.
      (detect_coding_system): Use new name.
      Rename null_byte_found => nul_byte_found.
      (Fdefine_coding_system_internal): Use new name.
      (syms_of_coding): Rename inhibit-null-byte-detection to
      inhibit-nul-byte-detection.
      * src/w16select.c (get_clipboard_data): null_char => nul_char.
      * src/json.c (check_string_without_embedded_nuls): Rename from
      check_string_without_embedded_nulls.
      (Fjson_parse_string): Adjust accordingly.
      * src/coding.h (enum define_coding_undecided_arg_index)
      (enum coding_attr_index): ...null_byte... => ...nul_byte....
      * lisp/info.el (info-insert-file-contents, Info-insert-dir):
      * lisp/international/mule.el (define-coding-system):
      * lisp/vc/vc-git.el (vc-git--call):
      * doc/lispref/nonascii.texi (Lisp and Coding Systems): Use the new name.
      76fea1eb
  7. 04 Mar, 2019 1 commit
    • Paul Eggert's avatar
      Simplify list creation in C code · 5c2563a5
      Paul Eggert authored
      The main new thing here is that C code can now say
      ‘list (a, b, c, d, e, f)’ instead of
      ‘listn (CONSTYPE_HEAP, 6, a, b, c, d, e, f)’,
      thus relieving callers of the responsibility of counting
      arguments (plus, the code feels more like Lisp).  The old
      list1 ... list5 functions remain, as they’re probably a bit
      faster for small lists.
      * src/alloc.c (cons_listn, pure_listn): New functions.
      (listn): Omit enum argument.
      All callers changed to use either new ‘list’ or ‘pure_list’ macros.
      * src/charset.c (Fdefine_charset_internal):
      * src/coding.c (detect_coding_system)
      (Fset_terminal_coding_system_internal):
      * src/frame.c (frame_size_history_add, adjust_frame_size):
      * src/gtkutil.c (xg_frame_set_char_size):
      * src/keyboard.c (command_loop_1):
      * src/nsfns.m (frame_geometry):
      * src/widget.c (set_frame_size):
      * src/xfaces.c (Fcolor_distance):
      * src/xfns.c (frame_geometry):
      * src/xterm.c (x_set_window_size_1):
      * src/xwidget.c (Fxwidget_size_request):
      Prefer list1i, list2i, etc. to open-coding them.
      * src/charset.c (Fset_charset_priority):
      * src/nsterm.m (append2):
      * src/window.c (window_list):
      * src/xfaces.c (Fx_list_fonts):
      Use nconc2 instead of open-coding it.
      * src/eval.c (eval_sub, backtrace_frame_apply):
      * src/kqueue.c (kqueue_generate_event):
      * src/nsterm.m (performDragOperation:):
      * src/pdumper.c (Fpdumper_stats):
      * src/w32.c (init_environment):
      Prefer list1, list2, etc. to open-coding them.
      * src/font.c (font_list_entities):
      Parenthesize to avoid expanding new ‘list’ macro.
      * src/gtkutil.c (GETSETUP): Rename from MAKE_FLOAT_PAGE_SETUP
      to get lines to fit.  Move outside the ‘list’ call, since it’s
      now a macro.
      * src/keymap.c (Fmake_keymap): Simplify.
      * src/lisp.h (list, pure_list): New macros.
      (list1i): New function.
      5c2563a5
  8. 15 Jan, 2019 1 commit
    • Daniel Colascione's avatar
      Add portable dumper · d12e5d00
      Daniel Colascione authored
      Add a new portable dumper as an alternative to unexec.  Use it by default.
      
      * src/dmpstruct.awk: New file.
      * src/doc.c (get_doc_string): use will_dump_p().
      * src/editfns.c (styled_format): silence compiler warning
      with UNINIT.
      * src/emacs-module.c (syms_of_module): staticpro ltv_mark.
      * src/emacs.c (gflags): new variable.
      (init_cmdargs): unwrap
      (string_starts_with_p, find_argument, dump_error_to_string)
      (load_pdump): new functions.
      (main): detect pdumper and --temacs invocation; actually load
      portable dump when detected; set gflags as appropriate; changes to
      init functions throughout to avoid passing explicit
      'initialized' argument.
      * src/eval.c (inhibit_lisp_code): remove unused variable.
      (init_eval_once_for_pdumper): new function.
      (init_eval_once): call it.
      * src/filelock.c: CANNOT_DUMP -> will_dump_p()
      * src/fingerprint-dummy.c: new file
      * src/fingerprint.h: new file
      * src/fns.c: CANNOT_DUMP -> will_dump_p(), etc.
      (weak_hash_tables): remove
      (hashfn_equal, hashfn_eql): un-staticify
      (make_hash_table): set new 'next_weak' hash table field; drop
      global weak_hash_tables logic.
      (copy_hash_table): drop global weak_hash_tables logic.
      (hash_table_rehash): new function.
      (hash_lookup, hash_put, hash_remove_from_table, hash_clear):
      rehash if needed.
      (sweep_weak_table): un-staticify; explain logic; bool-ify.
      (sweep_weak_hash_tables): remove function.
      * src/font.c (syms_of_font): remember pdumper stuff.
      * src/fontset.c (syms_of_fontset): remember pdumper stuff.
      * src/frame.c (make_initial_frame): don't reset Vframe_list.
      (init_frame_once_for_pdumper, init_frame_once): new functions.
      (syms_of_frame): remove redundant staticpro.
      * src/fringe.c (init_fringe_once_for_pdumper): new functin.
      (init_fringe_once): call it.
      * src/ftcrfont.c (syms_of_ftcrfont_for_pdumper): new function.
      (syms_of_ftcrfont): call it.
      * src/ftfont.c (syms_of_ftfont_for_pdumper): new function.
      (syms_of_ftfont): call it.
      * src/ftxont.c (syms_of_ftxfont_for_pdumper): new function.
      (syms_of_ftxfont): call it.
      * src/gmalloc.c: adjust for pdumper througout
      (DUMPED): remove weird custom dumped indicator.
      * src/gnutls.c (syms_of_gnutls): pdumper note for
      gnutls_global_initialized.
      * src/image.c (syms_of_image): add pdumper comment,
      initializer note.
      * src/insdel.c (prepare_to_modify_buffer_1): account
      for buffer contents possibly being in dump image.
      * src/keyboard.c (syms_of_keyboard_for_pdumper): new function.
      (syms_of_keyboard): staticpro more; call pdumper syms function.
      * src/lisp.h: add comments throughout
      (gflags): declare.
      (will_dump_p, will_bootstrap_p, will_dump_with_pdumper_p)
      (dumped_with_pdumper_p, will_dump_with_unexec_p)
      (dumped_with_unexec_p, definitely_will_not_unexec_p): new
      functions.
      (POWER_OF_2, ROUNDUP): move macros.
      (PSEUDOVECTOR_TYPE, PSEUDOVECTOR_TYPEP): take vectorlike header
      pointer instead of vector; constify.
      (Lisp_Hash_Table): add comment about need to rehash on access; add
      comment for next_weak.
      (HASH_KEY, HASH_VALUE, HASH_HASH, HASH_TABLE_SIZE): const-ify.
      (hash_table_rehash): declare.
      (hash_rehash_needed_p, hash_rehash_if_needed): new functions.
      (finalizers, doomed_finalizers): declare extern.
      (SUBR_SECTION_ATTRIBUTE): new macro.
      (staticvec, staticidx): un-static-ify.
      (sweep_weak_hash_tables): remove declaration.
      (sweep_weak_table): declare.
      (hashfn_eql, hashfn_equal): declare.
      (number_finalizers_run): new variable.
      (Vdead): externify when ENABLE_CHECKING.
      (gc_root_type): new enumeration.
      (gc_root_visitor): new struct.
      (visit_static_gc_roots): declare.
      (vectorlike_nbytes): declare.
      (vector_nbytes): define as trivial inline function wrapper for
      vectorlike_nbytes.
      (init_obarray_once): change signature.
      (primary_thread): extern-ify.
      (init_buffer): change signature.
      (init_frame_once): declare.
      * src/lread.c (readevalloop): adjust for new dumped predicates.
      (init_obarray_once): new function.
      (ndefsubr): new variable.
      (defsubr): increment it.
      (load_path_check): adjust for pdumper.
      (load_path_default): use pdumper functions; adjust for
      dump search.
      * src/macfont.m (macfont_init_font_change_handler): avoid
      shadowing global.
      (syms_of_macfont_for_pdumper): new function.
      (syms_of_macfont): call it.
      * src/menu.c (syms_of_menu): staticpro more stuff.
      * src/minibuf.c (Ftry_completion): rehash if needed.
      (init_minibuf_once_for_pdumper): new function.
      (init_minibuf_once): call it.
      * src/nsfont.m (syms_of_nsfns): staticpro more.
      * src/nsfont.m (syms_of_nsfont_for_pdumper): new function.
      (syms_of_nsfont): call it.
      * src/nsterm.m (syms_of_nsfont): remember pdumper stuff.
      * src/pdumper.c: new file.
      * src/pdumper.h: new file.
      * src/process.c (init_process_emacs): use new pdumper functions
      instead of CANNOT_DUMP.
      * src/profiler.c (syms_of_profiler_for_pdumper): new function.
      (syms_of_profiler_for_pdumper): call it.
      * src/search.c (syms_of_search_for_pdumper): new function.
      (syms_of_search_for_pdumper): call it.
      * src/sheap.c (bss_sbrk_did_unexec): remove.
      * src/sheap.h (bss_sbrk_did_unexec): remove.
      * src/syntax.c (syms_of_syntax): don't redundantly staticpro
      re_match_object.
      * src/sysdep.c: use will_dump_with_unexec_p() instead of bss
      hack thing.
      * src/syssignals.h (init_sigsegv): declare.
      * src/systime.h (init_timefns): remove bool from signature.
      * src/textprop.c (syms_of_textprop): move staticpro.
      * src/thread.c (main_thread_p): constify.
      * src/thread.h (main_thread_p): constify.
      * src/timefns.c (init_timefns): remove bool from signature.
      (syms_of_timefns_for_pdumper): new function.
      (syms_of_timefns): call it.
      * src/w32.c: rearrange code.
      * src/w32.h (w32_relocate): declare.
      * src/w32fns.c (syms_of_w32fns): add pdumper note.
      * src/w32font.c (syms_of_w32font_for_pdumper): new function.
      (syms_of_w32font): call it.
      * src/w32heap.c (using_dynamic_heap): new variable.
      (init_heap): use it.
      * src/w32menu.c (syms_of_w32menu): add pdumper note.
      * src/w32proc.c
      (ctrl_c_handler, mainCRTStartup, _start, open_input_file)
      (rva_to_section, close_file_data): move here.
      * src/w32uniscribe.c (syms_of_w32uniscribe_for_pdumper):
      new function.
      (syms_of_w32uniscribe): call it.
      * src/window.c (init_window_once_for_pdumper): new function.
      (init_window_once): call it; staticpro more stuff.
      * src/xfont.c (syms_of_xfont_for_pdumper): new function.
      (syms_of_xfont): call it.
      * src/xftfont.c (syms_of_xftfont_for_pdumper): new function.
      (syms_of_xftfont): call it.
      * src/xmenu.c (syms_of_xmenu_for_pdumper): new function.
      (syms_of_xmenu): call it.
      * src/xselect.c (syms_of_xselect_for_pdumper): new function.
      (syms_of_xselect): call it.
      * src/xsettings.c (syms_of_xsettings): add more pdumper notes.
      * src/term.c (syms_of_xterm): add pdumper note.
      
      * src/dispnew.c (init_faces_initial): new function.
      (init_display_interactive): rename from init_display; use
      will_dump_p instead of !initialized.  Initialize faces early for
      pdumper if needed.
      (init_display): new function.
      (syms_of_display_for_pdumper): new function.
      (syms_of_display): call it.
      
      * src/dbusbind.c (syms_of_dbusbind): Add TODO for bus reset
      on pdumper load.
      
      * src/data.c (Fdefalias): Use will_dump_p
      instead of Vpurify_flag.
      (Fmake_variable_buffer_local): silence compiler warning with -Og
      by making valcontents UNINIT.
      (arith_driver): silence compiler warning with UNINIT.
      
      * src/conf_post.h (ATTRIBUTE_SECTION): new macro.
      
      * src/composite.c (composition_gstring_put_cache): rehash hash
      table if needed.
      
      * src/coding.c (init_coding_once, syms_of_coding): remember
      pdumper stuff.
      
      * src/charset.h (charset_table_size, charset_table_user): declare.
      
      * src/charset.c (charset_table_used, charset_table_size): un-static.
      (init_charset_oncem, syms_of_charset): remember pdumper stuff.
      
      * src/category.c (category_table_version): remove obsolete
      variable.
      
      * src/callint.c (syms_of_callint): staticpro 'preserved_fns'
      (init_callproc): use will_dump_p instead of !CANNOT_DUMP.
      
      * src/bytecode.c (exec_byte_code): rehash table tables if needed
      
      * src/buffer.c (alloc_buffer_text, free_buffer_text): account for
      pdumper
      (init_buffer_once): add TODO; remember stuff for pdumper.
      (init_buffer): don't take initialized argument; adjust
      for pdumper.
      
      * src/atimer.c (init_atimer): initialize subr only if
      !initialized.
      
      * src/alloc.c: (vector_marked_p, set_vector_marked)
      (vectorlike_marked_p, set_vectorlike_marked, cons_marked_p)
      (set_cons_marked, string_marked_p, set_string_marked)
      (symbol_marked_p, set_symbol_marked, interval_marked_p)
      (set_interval_marked): new accessor routines.  Use them
      instead of raw GC access throughout.
      (Vdead): make non-static when ENABLE_CHECKING.
      (vectorlike_nbytes): rename of 'vector_nbytes'; take a vectorlike
      header as input instead of a vector.
      (number_finalizers_run): new internal C variable.
      (mark_maybe_object): check for pdumper objects.
      (valid_pointer_p): don't be gratuitously inefficient under rr(1).
      (make_pure_c_string): add support for size_byte = -2 mode
      indicating that string data points into Emacs image rodata.
      (visit_vectorlike_root): visits GC roots embedded in
      vectorlike objects.
      (visit_buffer_root): visits GC roots embedded in
      our totally-not-a-buffer buffer global objects.
      (visit_static_gc_roots): visit GC roots in the Emacs data section.
      (mark_object_root_visitor): root callback used for conventional GC
      marking
      (weak_hash_tables): new internal variable for tracking found weak
      hash tables during GC.
      (mark_and_sweep_weak_table_contents): new weak hash table marking.
      (garbage_collect_1): use new GC root visitor machinery.
      (mark_vectorlike): accept a vectorlike_header instead of a
      Lisp_Vector.
      (mark_frame, mark_window, mark_hash_table): new functions.
      (mark_object): initialize 'm'; check for pdumper objects and use
      new mark-bit accessors throughout.  Remove some object-specific
      marking code and move to helper functions above.
      (survives_gc_p): check for pdumper objects.
      (gc-sweep): clear pdumper mark bits.
      (init_alloc_once_for_pdumper): new helper function for early init
      called both during normal init and pdumper load.
      (init_alloc_once): pdumper integration.
      
      * src/Makefile.in: Rewrite dumping for pdumper; add pdumper.o;
      invoke temacs with --temacs command line option; build dmpstruct.h
      from dmpstruct.awk; stop relying on CANNOT_DUMP; clean up pdumper
      intermediate files during build.
      
      * nextstep/Makefile.in: build emacs.pdmp into NS packages
      
      * lisp/startup.el: account for new '--temacs' and '--dump-file'
      command line option.
      
      * lisp/loadup.el: rewrite early init to account for pdumper; use
      injected 'dump-mode' variable (set via the new '--temacs' option)
      instead of parsing command line.
      
      * lisp/cus-start.el: Check 'dump-mode' instead of 'purify-flag',
      since the new 'dump-mode'
      
      * lib-src/make-fingerprint.c: new program
      
      * lib-src/Makefile.in: built make-fingerprint utility program
      
      * configure.ac: Add --with-pdumper toggle to control pdumper
      support; add --with-unexec toggle to control unexec support.
      Add --with-dumping option to control which dumping strategy we use
      by default.  Adjust for pdumper throughout.  Check for
      posix_madvise.
      
      * Makefile.in: Add @DUMPING@ substitution; add pdumper mode.
      
      * .gitignore: Add make-fingerprint, temacs.in, fingerprint.c,
      dmpstruct.h, and pdumper dump files.
      d12e5d00
  9. 09 Jan, 2019 1 commit
    • Paul Eggert's avatar
      Use shortcuts for Flength · a8465033
      Paul Eggert authored
      When calculating the length of a Lisp object whose type is
      known, use a specialized length operation on it to save a bit
      of runtime overhead.
      * src/callint.c (Fcall_interactively):
      * src/minibuf.c (read_minibuf_unwind):
      Use ASIZE rather than Flength on values that must be vectors.
      * src/charset.c (Fsort_charsets):
      * src/coding.c (detect_coding_sjis):
      (Fdefine_coding_system_internal):
      * src/data.c (wrong_choice):
      * src/eval.c (Flet, eval_sub, Fapply, apply_lambda):
      * src/fns.c (sort_list):
      * src/font.c (font_vconcat_entity_vectors)
      (font_find_for_lface):
      * src/frame.c (Fmodify_frame_parameters):
      * src/fringe.c (get_logical_fringe_bitmap):
      * src/ftfont.c (ftfont_get_open_type_spec):
      * src/gtkutil.c (xg_print_frames_dialog):
      * src/lread.c (read1, read_vector):
      * src/keymap.c (Fkey_description):
      * src/kqueue.c (Fkqueue_add_watch):
      * src/macfont.m (macfont_get_open_type_spec):
      * src/menu.c (parse_single_submenu, x_popup_menu_1):
      * src/minibuf.c (Finternal_complete_buffer):
      * src/nsfont.m (ns_findfonts, nsfont_list_family):
      * src/process.c (Fmake_process):
      * src/search.c (Fset_match_data):
      * src/xfaces.c (Fx_family_fonts):
      Use list_length rather than Flength on values that must be lists.
      * src/fns.c (list_length): New function.
      (Flength): Use it.
      * src/nsfont.m (ns_findfonts):
      Use !NILP (x) rather than XFIXNUM (Flength (x)) != 0.
      * src/xdisp.c (store_mode_line_string):
      Use SCHARS rather than Flength on values that must be strings.
      a8465033
  10. 01 Jan, 2019 1 commit
  11. 29 Dec, 2018 1 commit
    • Eli Zaretskii's avatar
      Provide text directionality and language to HarfBuzz shaper · 48776b70
      Eli Zaretskii authored
      * lisp/language/tv-util.el (tai-viet-composition-function):
      * lisp/language/ethio-util.el (ethio-composition-function):
      * lisp/language/japanese.el (compose-gstring-for-variation-glyph):
      * lisp/language/thai-util.el (thai-composition-function):
      * lisp/language/misc-lang.el (arabic-shape-gstring):
      * lisp/language/lao-util.el (lao-composition-function):
      * lisp/language/hebrew.el (hebrew-shape-gstring):
      * lisp/composite.el (compose-gstring-for-graphic)
      (compose-gstring-for-dotted-circle, auto-compose-chars)
      (compose-gstring-for-terminal): Accept 2nd argument DIRECTION; all
      callers changed.
      
      * src/composite.c (composition_reseat_it): Call
      auto-composition-function with one more argument DIRECTION.
      (syms_of_composite) <auto-composition-function>: Update the doc
      string.
      * src/ftfont.c (ftfont_shape_by_hb): Compute language and
      direction, and set buffer properties accordingly.
      * src/composite.c (autocmp_chars):
      * src/w32uniscribe.c (uniscribe_shape):
      * src/xftfont.c (xftfont_shape):
      * src/ftfont.c (ftfont_shape, ftfont_shape_by_hb):
      * src/font.c (Ffont_shape_gstring): Accept an additional argument
      DIRECTION.
      * src/macfont.m (lgstring_direction): New enum.
      (mac_font_shape_1, mac_screen_font_shape, mac_font_shape):
      Accept an additional argument specifying text direction.  All
      callers changed.
      * src/font.c (syms_of_font): New symbols QL2R and QR2L.
      * src/font.h (shape): Accept new argument DIRECTION.  All
      implementations changed.  (Bug#33729)
      (ftfont_shape): Update prototype.
      48776b70
  12. 09 Dec, 2018 1 commit
    • Paul Eggert's avatar
      Add make_vector and make_nil_vector · d79bb756
      Paul Eggert authored
      This makes the callers a bit easier to read, and doubtless
      improves efficiency very slightly.  It also simplifies
      possible future changes to allow bignum indexes to buffers.
      * src/alloc.c (allocate_vectorlike):
      Prefer ptrdiff_t to size_t when either will do.
      (make_vector): New function.
      (Fmake_vector): Use it.
      * src/buffer.c (syms_of_buffer):
      * src/bytecode.c (syms_of_bytecode):
      * src/category.c (Fmake_category_table, init_category_once):
      * src/ccl.c (syms_of_ccl):
      * src/character.c (syms_of_character):
      * src/charset.c (Fdefine_charset_internal)
      (Ffind_charset_region, Ffind_charset_string):
      * src/chartab.c (copy_char_table):
      * src/coding.c (Fdefine_coding_system_internal, syms_of_coding):
      * src/composite.c (get_composition_id, Fcomposition_get_gstring):
      * src/composite.h (LGLYPH_NEW):
      * src/fns.c (concat, Flocale_info, make_hash_table):
      * src/font.c (font_otf_ValueRecord, font_otf_anchor)
      (build_style_table, syms_of_font):
      * src/fontset.c (RFONT_DEF_NEW, fontset_find_font)
      (dump_fontset, syms_of_fontset):
      * src/image.c (xpm_make_color_table_v):
      * src/keyboard.c (modify_event_symbol, menu_bar_items)
      (parse_menu_item, parse_tool_bar_item, init_tool_bar_items)
      (syms_of_keyboard):
      * src/keymap.c (Fdefine_key, describe_map, describe_vector):
      * src/lread.c (read_vector):
      * src/macfont.m (macfont_shape):
      * src/menu.c (init_menu_items):
      * src/nsfns.m (ns_make_monitor_attribute_list):
      * src/process.c (conv_sockaddr_to_lisp, network_interface_info):
      * src/profiler.c (make_log):
      * src/window.c (Fcurrent_window_configuration):
      * src/xdisp.c (with_echo_area_buffer_unwind_data)
      (format_mode_line_unwind_data):
      * src/xfaces.c (Finternal_make_lisp_face)
      (Fface_attributes_as_vector):
      * src/xfns.c (x_make_monitor_attribute_list)
      (Fx_display_monitor_attributes_list):
      * src/xfont.c (syms_of_xfont):
      * src/xselect.c (x_handle_dnd_message):
      * src/xwidget.c (save_script_callback):
      Prefer make_nil_vector (N) to Fmake_vector (make_fixnum (N), Qnil).
      * src/callint.c (Fcall_interactively):
      * src/charset.c (load_charset_map):
      * src/chartab.c (Fmake_char_table, uniprop_encode_value_numeric):
      * src/composite.c (get_composition_id)
      * src/dispnew.c (Fframe_or_buffer_changed_p)
      (syms_of_display):
      * src/fns.c (make_hash_table, maybe_resize_hash_table):
      * src/font.c (font_style_to_value):
      * src/fontset.c (FONTSET_ADD, fontset_add):
      * src/json.c (json_to_lisp):
      * src/keymap.c (syms_of_keymap):
      * src/lread.c (init_obarray):
      * src/profiler.c (make_log, Fprofiler_cpu_log):
      * src/term.c (term_get_fkeys_1):
      Prefer make_vector (N, V) to Fmake_vector (make_fixnum (N), V).
      * src/font.c (build_style_table):
      * src/macfont.m (macfont_shape):
      * src/process.c (conv_sockaddr_to_lisp, network_interface_info):
      Prefer make_uninit_vector if the vector will be initialized soon.
      * src/lisp.h (make_nil_vector): New function.
      d79bb756
  13. 08 Sep, 2018 1 commit
    • Eli Zaretskii's avatar
      Fix documentation for conversion to bignums · e4896856
      Eli Zaretskii authored
      * src/xselect.c (selection_data_to_lisp_data):
      * src/w32fns.c (Fw32_read_registry):
      * src/process.c (Fprocess_id):
      * src/font.c (Ffont_variation_glyphs, Finternal_char_font):
      * src/fns.c (Fsafe_length):
      * src/editfns.c (Fuser_uid, Fuser_real_uid, Fgroup_gid)
      (Fgroup_real_gid, Femacs_pid):
      * src/dired.c (Ffile_attributes):
      * src/charset.c (Fencode_char): Update commentary and doc
      strings for recent changes that produce bignums where
      previously cons cells of integers were produced.
      e4896856
  14. 05 Sep, 2018 1 commit
    • Paul Eggert's avatar
      Simplify bignum->intmax conversion · ecb985c1
      Paul Eggert authored
      * src/lisp.h (integer_to_intmax, integer_to_uintmax): New functions.
      * src/data.c (cons_to_unsigned, cons_to_signed)
      (arith_driver):
      * src/dbusbind.c (xd_extract_signed, xd_extract_unsigned):
      * src/dispnew.c (sit_for):
      * src/editfns.c (styled_format):
      * src/emacs-module.c (module_extract_integer):
      * src/fileio.c (file_offset):
      * src/font.c (font_unparse_xlfd, Fopen_font):
      * src/xdisp.c (calc_line_height_property):
      * src/process.c (handle_child_signal):
      ecb985c1
  15. 30 Aug, 2018 1 commit
  16. 28 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Improve bignum support for system types · d77d01d2
      Paul Eggert authored
      Use bignums when Emacs converts to and from system types like
      off_t for file sizes whose values can exceed fixnum range.
      Formerly, Emacs sometimes generted floats and sometimes ad-hoc
      conses of integers.  Emacs still accepts floats and conses for
      these system types, in case some stray Lisp code is generating
      them, though this usage is obsolescent.
      * doc/lispref/files.texi (File Attributes):
      * doc/lispref/hash.texi (Defining Hash):
      * doc/lispref/nonascii.texi (Character Sets):
      * doc/lispref/os.texi (User Identification):
      * doc/lispref/processes.texi (System Processes):
      * etc/NEWS:
      Document changes.
      * src/bignum.c (mpz_set_uintmax, make_biguint)
      (mpz_set_uintmax_slow, bignum_to_intmax, bignum_to_uintmax):
      New functions.
      (mpz_set_intmax_slow): Implement via mpz_limbs_write,
      to avoid the need for an extra pass through a negative number.
      * src/charset.c (Fencode_char):
      * src/composite.h (LGLYPH_SET_CODE):
      * src/dired.c (file_attributes):
      * src/dosfns.c, src/w32.c (list_system_processes)
      (system_process_attributes):
      * src/editfns.c (init_editfns, Fuser_uid, Fuser_real_uid)
      (Fgroup_gid, Fgroup_real_gid, Femacs_pid):
      * src/emacs-module.c (check_vec_index):
      * src/fns.c (Fsafe_length):
      * src/process.c (record_deleted_pid, Fprocess_id):
      * src/sysdep.c (list_system_processes, system_process_attributes):
      * src/xselect.c (x_own_selection, selection_data_to_lisp_data):
      * src/xterm.c (set_wm_state):
      * src/inotify.c (inotifyevent_to_event, add_watch)
      (inotify_callback):
      If an integer is out of fixnum range, use a bignum
      instead of converting it to a float or a cons of integers.
      * src/coding.c (Fdefine_coding_system_internal):
      * src/frame.c (frame_windows_min_size)
      (x_set_frame_parameters):
      * src/fringe.c (Fdefine_fringe_bitmap):
      * src/nsterm.m (mouseDown:):
      * src/syntax.c (find_defun_start):
      * src/w32fns.c (x_set_undecorated, w32_createwindow)
      (w32_wnd_proc, Fx_create_frame, Fx_show_tip)
      (w32_console_toggle_lock_key):
      * src/w32inevt.c (key_event):
      * src/w32proc.c (Fw32_get_locale_info):
      Do not mishandle floats by treating their addresses as their
      values.
      * src/data.c (store_symval_forwarding):
      * src/gnutls.c (Fgnutls_error_fatalp, Fgnutls_error_string):
      * src/keyboard.c (command_loop_1, make_lispy_event):
      * src/lread.c (read_filtered_event, read1)
      (substitute_object_recurse):
      * src/window.c (Fcoordinates_in_window_p, Fwindow_at)
      (window_resize_apply, Fset_window_vscroll):
      * src/xdisp.c (handle_single_display_spec, try_scrolling)
      (redisplay_window, calc_pixel_width_or_height)
      (calc_line_height_property, on_hot_spot_p):
      * src/xfaces.c (check_lface_attrs):
      * src/xselect.c (x_get_local_selection, cons_to_x_long)
      (lisp_data_to_selection_data, clean_local_selection_data)
      (x_check_property_data, x_fill_property_data):
      (x_send_client_event):
      Do not reject bignums.
      * src/data.c (INTBIG_TO_LISP, intbig_to_lisp)
      (uintbig_to_lisp):
      Remove.  All uses removed.
      * src/data.c (cons_to_unsigned, cons_to_signed):
      * src/dbusbind.c (xd_signature, xd_extract_signed)
      (xd_extract_unsigned):
      * src/dispnew.c (sit_for):
      * src/dosfns.c, src/w32.c (system_process_attributes):
      * src/editfns.c (Fuser_full_name):
      * src/fileio.c (file_offset):
      * src/fileio.c (write_region):
      * src/font.c (font_unparse_xlfd, font_open_for_lface, Fopen_font):
      * src/frame.c (x_set_screen_gamma):
      * src/frame.h (NUMVAL, FRAME_PIXEL_X_FROM_CANON_X)
      (FRAME_PIXEL_Y_FROM_CANON_Y):
      * src/image.c (parse_image_spec, x_edge_detection)
      (compute_image_size):
      * src/json.c (json_to_lisp):
      * src/lcms.c (PARSE_LAB_LIST_FIELD, Flcms_cie_de2000)
      (PARSE_XYZ_LIST_FIELD, PARSE_JCH_LIST_FIELD)
      (PARSE_JAB_LIST_FIELD, PARSE_VIEW_CONDITION_FLOAT)
      (Flcms_temp_to_white_point):
      * src/nsimage.m (ns_load_image, setSizeFromSpec):
      * src/process.c (Fsignal_process, handle_child_signal):
      * src/sysdep.c (system_process_attributes):
      * src/xdisp.c (calc_line_height_property):
      Handle bignums.
      * src/data.c (Fnumber_to_string): Use proper predicate name in
      signal if the argument is not a number.
      * src/lisp.h (make_uint): New function.
      (INT_TO_INTEGER): New macro.
      (FIXED_OR_FLOATP, CHECK_FIXNUM_OR_FLOAT)
      (CHECK_FIXNUM_OR_FLOAT_COERCE_MARKER, INTEGER_TO_CONS)
      (make_fixnum_or_float): Remove; no longer used.
      * src/nsfns.m, src/w32fns.c, src/xfns.c (Fx_create_frame):
      Reject floating-point min-width or min-height.
      * src/process.c (handle_child_signal): Do not worry
      about floating-point pids, as they are no longer generated.
      d77d01d2
  17. 13 Aug, 2018 1 commit
    • Paul Eggert's avatar
      Pacify gcc -Og -Wuninitialized · a1e0868f
      Paul Eggert authored
      This addresses the -Og uninitialized variable warnings I ran
      into on Fedora 28, which uses 8.1.1 20180712 (Red Hat 8.1.1-5).
      It also changes some explicit initializations to UNINIT
      when the variable does not actually need to be initialized.
      * src/process.c (connect_network_socket):
      * src/sysdep.c (system_process_attributes):
      * src/xfns.c (x_real_pos_and_offsets):
      * src/xterm.c (get_current_wm_state) [USE_XCB]:
      Add UNINIT.
      * src/editfns.c (tzlookup):
      * src/fns.c (Fnconc):
      * src/font.c (font_parse_fcname):
      * src/frame.c (x_set_frame_parameters):
      Prefer UNINIT to explicit initialization.
      a1e0868f
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
  25. 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
  26. 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
  27. 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
  28. 01 Jan, 2018 1 commit
  29. 15 Dec, 2017 1 commit
  30. 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
  31. 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
  32. 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
  33. 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
  34. 26 Apr, 2017 1 commit
  35. 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
  36. 01 Jan, 2017 1 commit
  37. 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
  38. 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
  39. 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
  40. 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