1. 01 Jan, 2020 1 commit
  2. 17 Nov, 2019 1 commit
  3. 17 Sep, 2019 1 commit
    • Eli Zaretskii's avatar
      Improve font lookup on MS-Windows · 8054935c
      Eli Zaretskii authored
      * src/w32font.c (struct font_callback_data): New member
      'known_fonts'.
      (w32font_list_internal, w32font_match_internal): Set up
      match_data.known_fonts if the font spec includes :script that
      names one of the non-USB scripts.
      (add_font_entity_to_list): If font_matches_spec returns zero
      for a font, and we have some fonts in match_data->known_fonts,
      consider the font to be a match if it is named in known_fonts.
      (font_supported_scripts): Update the Unicode Subranges.  In
      particular, map bit 74 to 'burmese', as this is the name Emacs
      uses, not 'myanmar'.  Add a list of scripts that have no USBs
      defined for them.
      (syms_of_w32font) <Qburmese, Qcuneiform_numbers_and_punctuation>
      <Qaegean_number, Qw32_non_USB_fonts>: New symbols.
      
      * lisp/term/w32-win.el (w32-no-usb-subranges): New defconst.
      (w32--filter-USB-scripts, w32-find-non-USB-fonts): New functions.
      (w32-non-USB-fonts): New defvar.
      
      * lisp/international/fontset.el (setup-default-fontset): Add
      more scripts to automatic setup by representative characters.
      
      * doc/emacs/msdos.texi (Windows Fonts): Document
      'w32-find-non-USB-fonts' and 'w32-non-USB-fonts'.
      
      * etc/NEWS: Mention 'w32-find-non-USB-fonts' and
      'w32-non-USB-fonts'.
      8054935c
  4. 18 Jun, 2019 2 commits
    • Eli Zaretskii's avatar
      Fix the handling of font backend supersedence on MS-Windows · 922121e7
      Eli Zaretskii authored
      * src/w32font.c (syms_of_w32font): Don't make the Uniscribe
      font backend "superceded" here, ...
      * src/w32uniscribe.c (syms_of_w32uniscribe_for_pdumper):
      ... make it "superceded" here, only if the HarfBuzz DLL was
      successfully loaded.  This is because Emacs compiled with
      HarfBuzz support might run on a system without the DLL.
      * src/w32fns.c (Fx_create_frame, w32_create_tip_frame):
      Register the HarfBuzz font backend only if it is available.
      922121e7
    • 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
  5. 31 May, 2019 2 commits
    • Eli Zaretskii's avatar
      Unbreak display of characters on MS-Windows · 2ffec6b4
      Eli Zaretskii authored
      * src/w32font.c (w32font_draw): Convert the glyph_string's
      char2b array to 16-bit WCHAR data that ExtTextOutW needs.
      
      (cherry picked from commit 38564f8a)
      2ffec6b4
    • Eli Zaretskii's avatar
      Add HarfBuzz font backend for MS-Windows · fba3687d
      Eli Zaretskii authored
      * src/w32uniscribe.c [HAVE_HARFBUZZ]: Include math.h and
      hb.h.
      (bswap_32): Define for GCC 4.3.0 and later; else include
      <byteswap.h> from Gnulib.
      (struct uniscribe_font_info): Extend for HarfBuzz; 'cache' is
      now a 'void *' (all users changed).
      [HAVE_HARFBUZZ]: Define typedefs for HarfBuzz functions to be
      loaded dynamically from the HarfBuzz DLL.  Define macros to
      call those functions via function pointers.
      (uniscribe_open) [HAVE_HARFBUZZ]: Use the HarfBuzz font driver
      if the type of the font entity is 'harfbuzz'.
      (uniscribe_close) [HAVE_HARFBUZZ]: For fonts using the
      HarfBuzz backend, call hb_font_destroy to free memory used for
      the cached hb_font data.
      (uniscribe_shape): Fix assignment of character codepoints to
      glyphs from a single cluster.
      (w32hb_list, w32hb_match, free_cb, w32hb_get_font_table)
      (w32hb_get_font, w32hb_encode_char, w32hb_begin_font)
      (w32uni_combining, w32uni_general, w32uni_mirroring)
      (get_hb_unicode_funcs, w32hb_shape)
      (w32hb_combining_capability, load_harfbuzz_funcs)
      [HAVE_HARFBUZZ]: New functions.
      (syms_of_w32uniscribe_for_pdumper) [HAVE_HARFBUZZ]: Load the
      HarfBuzz DLL and register the HarfBuzz backend with its
      functions.
      * src/w32font.c (syms_of_w32font) <Qharfbuzz>: New DEFSYM.
      * src/w32fns.c (Fx_create_frame, w32_create_tip_frame)
      [HAVE_HARFBUZZ]: Register the harfbuzz font backend.
      * src/lisp.h (get_unicode_property): Declare prototype.
      * src/font.h (harfbuzz_font_driver) [HAVE_NTGUI]: Declare.
      * src/chartab.c (get_unicode_property): New function, body
      taken from get-unicode-property-internal.
      (Fget_unicode_property_internal): Call get_unicode_property
      after validating input.
      
      * doc/lispref/frames.texi (Font and Color Parameters):
      * doc/emacs/msdos.texi (Windows Fonts): Document support for
      HarfBuzz text shaping on MS-Windows.
      
      * configure.ac (HAVE_HARFBUZZ): Move out of the X-specific
      part, and consider HarfBuzz also for HAVE_W32 systems.
      Require HarfBuzz v1.2.3 for w32.
      fba3687d
  6. 23 May, 2019 1 commit
  7. 20 May, 2019 1 commit
    • Alexander Gramiak's avatar
      Replace XChar2b with unsigned in all font backends · a4fe9c70
      Alexander Gramiak authored
      The xfont backend using XChar2b in its API doesn't mean that we should
      use it everywhere else.
      
      * src/dispextern.h (glyph_string):
      * src/ftcrfont.c (ftcrfont_draw):
      * src/ftxfont.c (ftxfont_draw):
      * src/w32term.c (w32_draw_glyphless_glyph_string_foreground):
      * src/xdisp.c (init_glyph_string, get_char_face_and_encoding)
      (get_glyph_face_and_encoding, get_char_glyph_code)
      (fill_gstring_glyph_string, fill_stretch_glyph_string)
      (normal_char_ascent_descent, gui_get_glyph_overhangs)
      (compute_overhangs_and_x, gui_produce_glyphs):
      * src/xfont.c (xfont_get_pcm, xfont_chars_supported, xfont_open)
      (xfont_encode_char, xfont_text_extents, xfont_draw)
      * src/xftfont.c (xftfont_draw):
      * src/xterm.c (x_compute_glyph_string_overhangs)
      (x_draw_glyphless_glyph_string_foreground): Use unsigned over XChar2b.
      
      * src/nsgui.h:
      * src/w32gui.h:
      * src/xterm.h: Remove XChar2b, STORE_XCHAR2B, XCHAR2B_BYTE1, and
      XCHAR2B_BYTE2 typedefs and macros.
      
      * src/font.h (font_driver):
      (ftfont_text_extents)
      * src/ftcrfont.c (ftcrfont_text_extents):
      * src/ftfont.c (ftfont_text_extents):
      * src/macfont.m (macfont_text_extents):
      * src/nsfont.m (nsfont_text_extents):
      * src/w32font.h (w32_font_text_extents):
      * src/font.c (xfont_text_extents):
      * src/xftfont.c (xftfont_text_extents): Make code parameter const.
      a4fe9c70
  8. 26 Apr, 2019 1 commit
    • Alexander Gramiak's avatar
      Rename generic x_* identifiers · a411517f
      Alexander Gramiak authored
      * src/image.c: Rename x_* procedures to image_*.
      
      * src/frame.c: Rename x_* procedures to gui_*. Rename
      xrdb_get_resource to gui_display_get_resource. Rename x_get_arg to
      gui_display_get arg.
      
      * src/frame.h: Rename can_x_set_window_size to can_set_window_size.
      
      * src/xfaces.c: Rename realize_x_face to realize_gui_face. Rename
      x_supports_face_attributes_p to gui_supports_face_attributes_p.
      
      * src/keyboard.c:
      * src/lisp.h:
      * src/nsterm.m:
      * src/w32term.c:
      * src/xterm.c: Rename x_get_keysym_name to get_keysym_name.
      
      * src/nsfns.c:
      * src/nsterm.m: Rename x_* procedures to ns_*.
      
      * src/w32fns.c:
      * src/w32term.c: Rename x_* procedures to w32_*.
      
      * src/termhooks.h (query_colors, get_focus_frame, focus_frame_hook)
      (frame_visible_invisible_hook, iconify_frame_hook)
      (set_window_size_hook, set_frame_offset_hook, set_frame_alpha_hook)
      (set_new_font_hook, set_bitmap_icon_hook, implicit_set_name_hook)
      (activate_menubar_hook, change_tool_bar_height_hook)
      (set_scroll_bar_default_width_hook)
      (set_scroll_bar_default_height_hook, get_string_resource_hook): New
      terminal hooks to replace backend-specific x_* procedures.
      
      * src/dispextern.h (clear_under_internal_border): New RIF procedure.
      
      * src/alloc.c:
      * src/frame.c:
      * src/xdisp.c: Use FRAME_OUTPUT_DATA instead of FRAME_X_OUTPUT.
      
      * src/frame.c:
      * src/w32term.c:
      * src/w32fns.c: Use FRAME_NATIVE_WINDOW instead of FRAME_X_WINDOW.
      a411517f
  9. 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
  10. 01 Jan, 2019 1 commit
  11. 20 Aug, 2018 1 commit
    • Andy Moreton's avatar
      Define get_proc_addr in Cygwin-w32 build · 36de7bd7
      Andy Moreton authored
      * src/w32common.h (get_proc_addr, DEF_DLL_FN, LOAD_DLL_FN): Move
      definitions here from src/w32.h.
      * src/decompress.c [WINDOWSNT]:
      * src/gnutls.c [WINDOWSNT]:
      * src/image.c [WINDOWSNT]:
      * src/json.c [WINDOWSNT]:
      * src/lcms.c [WINDOWSNT]:
      * src/w32font.c [WINDOWSNT]:
      * src/w32uniscribe.c:
      * src/xml.c [WINDOWSNT]: Include w32common.h.
      36de7bd7
  12. 17 Aug, 2018 1 commit
    • Andy Moreton's avatar
      Pacify -Wcast-function-type warnings in GCC 8.1 · cc5325b0
      Andy Moreton authored
      * src/image.c: Move attributes into DEF_DLL_FN call.
      * src/dynlib.c (dynlib_addr): Use get_proc_addr.
      * src/w32.h: (get_proc_addr): New function.
      (LOAD_DLL_FN): Use it.
      (DEF_DLL_FN): Allow function attributes after argument
      list.  Add function pointer type used by LOAD_DLL_FN.
      * src/w32.c (open_process_token, get_token_information)
      (lookup_account_sid, get_sid_sub_authority)
      (get_sid_sub_authority_count, get_security_info)
      (get_file_security, set_file_security)
      (set_named_security_info)
      (get_security_descriptor_owner, get_security_descriptor_group)
      (get_security_descriptor_dacl, is_valid_sid, equal_sid)
      (get_length_sid, copy_sid, get_native_system_info)
      (get_system_times, create_symbolic_link)
      (is_valid_security_descriptor, convert_sd_to_sddl)
      (convert_sddl_to_sd, get_adapters_info, reg_open_key_ex_w)
      (reg_query_value_ex_w, expand_environment_strings_w)
      (init_environment, create_toolhelp32_snapshot)
      (process32_first, process32_next, open_thread_token)
      (impersonate_self, revert_to_self, get_process_memory_info)
      (get_process_working_set_size, global_memory_status)
      (global_memory_status_ex, init_winsock)
      (maybe_load_unicows_dll, globals_of_w32): Use get_proc_addr.
      * src/w32fns.c (setup_w32_kbdhook, Ffile_system_info)
      (get_dll_version, w32_reset_stack_overflow_guard)
      (w32_backtrace, globals_of_w32fns): Use get_proc_addr.
      * src/w32font.c (get_outline_metrics_w, get_text_metrics_w)
      (get_glyph_outline_w, get_char_width_32_w): Use get_proc_addr.
      * src/w32heap.c (init_heap): Use get_proc_addr.
      * src/w32menu.c (globals_of_w32menu): Use get_proc_addr.
      * src/w32proc.c (init_timers, sys_kill, w32_compare_strings):
      Use get_proc_addr.
      * src/w32uniscribe.c (syms_of_w32uniscribe): Use get_proc_addr.
      cc5325b0
  13. 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
  14. 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
  15. 15 Jun, 2018 1 commit
    • Paul Eggert's avatar
      New type Lisp_Misc_Ptr · f8ad6b31
      Paul Eggert authored
      This is a streamlined version of Lisp_Save_Value, which contains just
      a pointer, as that is all Lisp_Save_Values are used for any more.
      With the previous changes, these objects are not primarily used as
      save values, so just call them "Misc" rather than "Save".
      * src/alloc.c (make_misc_ptr): New function.
      (mark_object): Mark Lisp_Misc_Ptr too.
      * src/lisp.h (Lisp_Misc_Ptr): New constant.
      (struct Lisp_Misc_Ptr): New type.
      (make_mint_ptr, mint_ptrp, xmint_pointer):
      Use Lisp_Misc_Ptr, not Lisp_Save_Value.
      (union Lisp_Misc): Add Lisp_Misc_Ptr.
      * src/print.c (print_object): Print Lisp_Misc_Ptr.
      f8ad6b31
  16. 01 Jan, 2018 1 commit
  17. 30 Sep, 2017 1 commit
  18. 08 Sep, 2017 1 commit
  19. 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
  20. 02 May, 2017 1 commit
    • Eli Zaretskii's avatar
      Avoid compilation warnings · 5f75304f
      Eli Zaretskii authored
      * src/w32fns.c (Fx_file_dialog, w32_parse_and_hook_hot_key):
      * src/w32term.c (x_draw_glyph_string):
      * src/w32fns.c (compute_tip_xy):
      * src/w32font.c (w32font_text_extents):
      * src/w32menu.c (set_frame_menubar):
      * src/search.c (Freplace_match): Avoid compiler warnings in
      optimized builds.
      5f75304f
  21. 12 Apr, 2017 1 commit
    • Martin Rudalics's avatar
      Add new frame parameters and associated functions · 3fdd3bb5
      Martin Rudalics authored
      Add new frame parameters `undecorated', `override-redirect',
      `parent-frame', `skip-taskbar', `no-focus-on-map',
      `no-accept-focus', `z-group', `delete-before', `no-other-frame',
      `mouse-wheel-frame', `min-width', `min-height'.  Add new
      functions `frame-restack' and `frame-list-z-order'.
      
      * lisp/cus-start.el (focus-follows-mouse): Adapt customization
      type.
      * lisp/frame.el (handle-delete-frame): Handle child and
      `delete-before' frames.
      (other-frame): Stop looking for other frame after one round.
      (frame-list-z-order, frame-restack): New functions.
      (delete-other-frames): Handle child frames.
      * lisp/frameset.el (frameset-persistent-filter-alist)
      (frameset--record-relationships): Handle `delete-before',
      `parent-frame' and `mouse-wheel-frame' parameters.  Rename
      latter from `frameset--record-minibuffer-relationships'.
      (frameset--restore-frame): Handle ‘parent-frame’ parameter
      specially.
      (frameset-restore): Handle `delete-before', `parent-frame' and
      `mouse-wheel-frame' parameters.
      * lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
      parameter.
      * lisp/window.el (window--min-size-ignore-p): Fix doc-string.
      (mouse-autoselect-window-select, handle-select-window): Major
      rewrite.  Try to not ignore errors.  Handle auto-selection of
      child frames and different values of `focus-follows-mouse'.
      * src/frame.c (frame_windows_min_size): Handle new `min-width'
      and `min-height' frame parameters.
      (make_frame): Initialize new frame structure members.
      (do_switch_frame): Don't reset internal_last_event_frame for
      descendant frames.
      (Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
      functions.
      (candidate_frame): Don't return `no-other-frame' frame.
      (other_frames): New function replacing other_visible_frames.
      (delete_frame): Rewrite.  Handle child and `delete-before' frames.
      (Fmake_frame_invisible): Call other_frames.
      (store_frame_param): Check `delete-before' and `parent-frame'
      parameters for circular dependencies.
      (frame_parms, syms_of_frame): Add entries for and define new
      frame parameters.
      (focus_follows_mouse): New meaningful value `auto-raise'.
      * src/frame.h (z_group): New enumeration type.
      (frame): New slots parent_frame, undecorated, override_redirect,
      skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
      (fset_parent_frame): New inlined function.
      (FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
      (FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
      (FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
      (FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
      (FRAME_Z_GROUP_BELOW): New macros.
      (frame_ancestor_p): Add declaration.
      * src/gtkutil.c (xg_create_frame_widgets): Handle
      `undecorated' and `override-redirect' frame parameters.
      (x_wm_set_size_hint): None for child frames.
      (xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
      (xg_set_no_focus_on_map, xg_set_no_accept_focus)
      (xg_set_override_redirect): New functions.
      (xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
      Don't let scrollbars obscure child frames.
      * src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
      (xg_set_skip_taskbar, xg_set_no_focus_on_map)
      (xg_set_no_accept_focus, xg_set_override_redirect): Add extern
      declarations.
      * src/nsfns.m (ns_frame_parm_handlers): Add entries for new
      frame parameters.
      (Fx_create_frame): Install `min-width' and `min-height' frame
      parameters.
      * src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
      * src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
      (x_real_positions): Handle child frames.
      (x_set_menu_bar_lines): Don't for child frames.
      (x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
      (x_set_no_focus_on_map, x_set_no_accept_focus)
      (x_set_z_group): New functions.
      (w32_createvscrollbar, w32_createhscrollbar): Don't draw
      scroll bars over child frames.
      (w32_createwindow): Handle new frame parameters and child frames.
      (w32_wnd_proc): Let mouse clicks into a child frame activate
      the frame.  Try to handle the `no-accept-focus' parameter.  Do
      SetFocus when our window is brought to top or becomes the
      foreground window.
      (w32_window): Don't initialize menu bar for child frames.
      (Fx_create_frame): Handle new frame parameters.
      (x_create_tip_frame): Set explicit_parent slot.
      (w32_dialog_in_progress): New function.
      (Fx_file_dialog): Handle `z-group-above' frames.
      (w32_frame_list_z_order, Fw32_frame_list_z_order)
      (w32_frame_restack, Fw32_frame_restack): New functions.
      (w32_frame_parm_handlers): Add entries for new frame
      parameters.
      * src/w32font.c (Fx_select_font): Handle `z-group-above'
      frames during font selection dialogue.
      * src/w32term.c (construct_mouse_wheel): Construct mouse wheel
      event from F's w32 window.
      (w32_mouse_position): Handle child frames.
      (w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
      Don't draw scroll bars over child frames.
      (w32_read_socket): Always erase background of child frames.
      When generating SELECT_WINDOW_EVENTs handle new value of
      `focus-follows-mouse' and handle `no-accept-focus' parameter.
      Handle `mouse-wheel-frame' parameter.
      (x_calc_absolute_position, x_set_offset, x_set_window_size):
      Handle child frames.
      (x_make_frame_visible): Handle child frames specially.  Handle
      `no-focus-on-map' parameter.
      * src/w32term.h (w32_dialog_in_progress): Add external
      declaration.
      * src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
      for child frames.
      * src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
      (PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
      non-Motif, non-GTK case.
      (x_real_pos_and_offsets): Handle child frames.
      (x_set_undecorated, x_set_parent_frame)
      (x_set_no_focus_on_map, x_set_no_accept_focus)
      (x_set_override_redirect): New functions.
      (x_set_menu_bar_lines): Not for child frames.
      (x_window): Handle `undecorated' and `override_redirect' cases.
      (Fx_create_frame): Handle new frame parameters.
      (frame_geometry): Handle child frames and outer border.
      (x_frame_list_z_order, Fx_frame_list_z_order)
      (x_frame_restack, Fx_frame_restack): New functions.
      (Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
      (x_frame_parm_handlers): Add entries for new frame parameters.
      * src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
      frames.
      * src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
      for child frames.
      (XTmouse_position): Handle child frames.
      (x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
      bars obscure child frames.
      (handle_one_xevent): Handle child frame positions.  If necessary
      set `skip-taskbar' and reassign proper `z-group' when we are
      mapped.  When generating SELECT_WINDOW_EVENTs handle new value
      of `focus-follows-mouse'.  Handle `mouse-wheel-frame' parameter.
      Let mouse clicks into a child frame activate the frame.
      (x_calc_absolute_position, x_set_offset): Handle child frames
      specially.
      (x_set_skip_taskbar, x_set_z_group): New functions.
      (x_make_frame_visible): Handle child frames.
      (ATOM_REFS_INIT): Add entries for
      Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
      Xatom_net_wm_state_below.
      * src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
      Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
      (x_set_skip_taskbar, x_set_z_group): Add extern declarations.
      3fdd3bb5
  22. 23 Feb, 2017 1 commit
    • Eli Zaretskii's avatar
      Avoid quitting inside a critical section on MS-Windows · 5114b3a2
      Eli Zaretskii authored
      * src/w32uniscribe.c (uniscribe_list_family):
      * src/w32font.c (w32font_list_family, w32font_text_extents)
      (w32font_list_internal, w32font_match_internal)
      (list_all_matching_fonts): Prevent quitting while these functions
      cons lists of fonts, to avoid leaving the critical section taken
      by the main thread, which will then cause any other thread
      attempting to enter the critical section to hang.  (Bug#25279)
      5114b3a2
  23. 01 Jan, 2017 1 commit
  24. 01 Dec, 2016 1 commit
  25. 21 Jun, 2016 1 commit
    • Ken Brown's avatar
      Fix compiler warnings in Cygwin-w32 build · 560c4ab1
      Ken Brown authored
      * src/conf_post.h (DebPrint) [!EMACSDEBUG]: Add empty do-while
      loop to avoid compiler warnings about empty body of 'if'
      statement.
      
      * src/image.c [HAVE_NTGUI] (DefaultDepthOfScreen): Disable unused
      macro.
      (x_create_bitmap_from_data): Declare 'frame'.
      (x_create_bitmap_from_file): Don't declare unused variable
      'dpyinfo'.
      
      * src/lisp.h (AUTO_STRING_WITH_LEN): Avoid initialization to
      prevent "jump-misses-init" compiler warnings.
      
      * src/w32fns.c (check_w32_winkey_state): Define and use only if
      WINDOWSNT.
      (Fx_show_tip): Declare 'f'.
      (Fx_file_dialog): Declare 'filter_a' only if not NTGUI_UNICODE.
      (w32_strerror): Use format specifier %d for sprintf argument of
      type int.
      (emacs_abort): Cast sprintf argument of type DWORD to unsigned
      int, and use format specifier %x, for compatibility with Cygwin.
      (unicode_append_menu) [NTGUI_UNICODE]:
      * src/w32menu.c [NTGUI_UNICODE] (get_menu_item_info)
      (set_menu_item_info, unicode_append_menu)
      (unicode_message_box):
      * src/menu.c [NTGUI_UNICODE] (unicode_append_menu): Define as
      functions rather than macros to avoid "address will always
      evaluate as true" compiler warnings.
      
      * src/w32font.c (w32_to_x_charset): Use format specifier %d for
      sprintf argument of type int.
      
      * src/w32term.c (x_draw_glyphless_glyph_string_foreground): Cast
      sprintf argument of type int to unsigned int to match %X format
      specifier.
      (w32_scroll_bar_handle_click):
      (w32_horizontal_scroll_bar_handle_click): Declare 'f'.
      
      * src/w32term.h (FRAME_DISPLAY_INFO): Explicitly discard unused
      argument.
      560c4ab1
  26. 21 May, 2016 1 commit
    • Eli Zaretskii's avatar
      Fix compiler warnings in the MinGW build · cb5af792
      Eli Zaretskii authored
      * configure.ac [mingw32]: Don't add -Wpointer-sign, and add
      -Wno-pointer-sign, to keep the noise level down.
      
      * nt/mingw-cfg.site (gl_cv_warn_c__Wredundant_decls): Disable
      -Wredundant-decls, as that produces a lot of noise due to
      redeclaration of time-related functions by gnulib.
      * nt/runemacs.c (set_user_model_id): Fix argument type of
      'SetCurrentProcessExplicitAppUserModelID'.
      
      * src/image.c (x_create_bitmap_from_file) [HAVE_NTGUI]: Don't
      declare 'dpyinfo', as it is unused.
      (xpm_load): Fix warnings about pointer signedness.
      * src/w32proc.c (IsValidLocale, init_winsock): Remove redundant
      prototypes.
      (sys_spawnve): Avoid warnings about discarding 'const' qualifier.
      (sys_select): Provide prototype.
      (g_b_init_compare_string_w): Move declaration to file scope.
      * src/w32heap.c (dumped_data_commit): Now static.
      (FREEABLE_P): Avoid warnings about pointer comparison with integer.
      (mmap_realloc): Cast to 'char *' for arithmetics on void pointers.
      * src/w32console.c (ctrl_c_handler, sys_tputs, sys_tgetstr)
      (evalcost, cmputc, cmcheckmagic, cmcostinit, cmgoto, Wcm_clear):
      Provide prototypes.
      * src/w32.c (globals_of_w32, conv_sockaddr_to_lisp): Remove
      redundant prototypes.
      (w32_get_internal_run_time, map_w32_filename): Provide prototype.
      (init_environment, sys_ctime): Avoid warnings about discarding
      'const' qualifier.
      Include utimens.h.
      (sys_ctime, sys_chdir, sys_creat, sys_fopen, sys_mkdir)
      (sys_open, sys_rename, sys_rmdir, is_slow_fs, term_winsock)
      (sys_close, sys_dup2, sys_read, sys_write, sys_localtime): Provide
      prototypes.
      (sys_rename_replace): Use %d to avoid compiler warnings.
      (_wsa_errlist): Make the message text 'const char *', to avoid
      compilation warnings.
      (dynlib_reset_last_error): Move prototype to file scope.
      (w32_get_resource): First argument is now 'const char *'.
      * src/w32uniscribe.c (syms_of_w32uniscribe): Provide prototype.
      (otf_features): Second argument is no 'const char *'.
      * src/w32term.c (free_frame_menubar, x_wm_set_size_hint)
      (x_set_window_size): Remove redundant prototypes.
      (XChangeGC, XGetGCValues, w32_draw_underwave)
      (w32_draw_rectangle, w32_shift_glyphs_for_insert, x_mouse_leave)
      (x_calc_absolute_position, x_destroy_window): Now static.
      (menubar_selection_callback): Move prototype to file scope.
      * src/w32font.c (g_b_init_get_glyph_outline_w): Remove redundant
      declaration.
      (w32_to_x_charset): Fix warnings about discarding 'const' qualifier.
      (w32font_full_name): Fix warnings about implicit conversion of
      'float' to 'double'.
      * src/w32reg.c (w32_get_rdb_resource): Fix warnings about
      discarding 'const' qualifier.
      * src/w32menu.c (syms_of_w32menu, globals_of_w32menu)
      (set_frame_menubar): Remove redundant prototypes.
      (menubar_selection_callback, w32_menu_display_help): Provide
      prototypes.
      (simple_dialog_show): Avoid warnings about discarding 'const'
      qualifier.
      * src/w32fns.c (syms_of_w32fns, globals_of_w32fns)
      (free_frame_menubar, w32_strerror, x_set_menu_bar_lines)
      (x_set_tool_bar_lines, x_set_internal_border_width): Remove
      redundant prototypes.
      (current_popup_menu): Remove redundant declaration.
      (colormap_t): Member 'name' is now 'const char *'.
      (add_system_logical_colors_to_map): Fix signed/unsigned warnings.
      (x_decode_color, x_set_border_pixel)
      (x_clear_under_internal_border, x_set_name, hook_w32_key)
      (reset_w32_kbdhook_state, deliver_wm_chars, w32_backtrace): Now
      static.
      (w32_load_cursor, w32_key_to_modifier, map_keypad_keys)
      (w32_msg_worker, w32_last_error): Provide prototypes.
      (funhook, lookup_vk_code): Avoid warnings about missing
      parentheses.
      (x_default_font_parameter, Fw32_notification_notify): Avoid
      warnings about discarding 'const' qualifier.
      (Fx_create_frame): Avoid warnings about empty body of 'else'.
      (x_screen_planes): Ifdef away unused function.
      (Fx_show_tip): Remove unused variables.
      (Fw32_battery_status): Avoid warnings about implicit promotion
      from float to double.
      (Fw32_notification_notify): Initialize 'timeout'.
      * src/profiler.c (profiler_cpu_running) [HAVE_ITIMERSPEC]: Only
      define the TIMER_SETTIME_RUNNING value if it will be used.
      * src/w32notify.c (send_notifications): Ifdef away an empty if
      clause.  Remove unused variable.
      (watch_end, watch_completion): Provide prototypes.
      * src/sound.c (sound_warning) [WINDOWSNT]: Don't define: unused.
      * src/callproc.c (child_setup, getenv_internal_1) [WINDOWSNT]: Fix
      warning with pointer signedness.
      * src/gnutls.c (gnutls_x509_crt_get_signature)
      (gnutls_alert_send_appropriate) [WINDOWSNT]: Don't define, and
      don't load them from the GnuTLS library, as they are no longer
      used.
      * src/process.c (DATAGRAM_CHAN_P) [!DATAGRAM_SOCKETS]: Don't
      define, as it's unused.
      * src/unexw32.c (open_input_file, open_output_file)
      (close_file_data): Remove redundant prototypes.
      (_start): provide prototype.
      (mainCRTStartup): Move prototype to file level.
      (find_section): Use type-cast to shut up compiler warnings.
      (offset_to_section, relocate_offset): Now static.
      (find_section): First argument is now a 'const char *'.
      (offset_to_section): Ifdef away, as it's unused.
      * src/w32heap.h (find_section): Adjust prototype.
      * src/dynlib.c (dynlib_reset_last_error): Provide prototype.
      * src/dired.c (directory_files_internal_w32_unwind): Avoid
      warnings about missing prototypes.
      (is_slow_fs) [WINDOWSNT]: Provide prototype at file level.
      (directory_files_internal) [WINDOWSNT]: Fix warnings about pointer
      signedness.
      * src/fileio.c (Ffile_writable_p, Ffile_regular_p) [WINDOWSNT]:
      Fix warnings about pointer signedness.
      * src/filelock.c (WTMP_FILE) [WINDOWSNT]: Don't define, it's
      unused.
      * src/sysdep.c (_getpid): Remove redundant prototype.
      (sys_subshell) [DOS_NT]: Don't define 'status', it's unused.
      [!MSDOS]: Don't define 'st', it's unused.
      (init_sys_modes) [DOS_NT]: Don't define 'terminal', it's unused.
      (str_collate) [WINDOWSNT]: Avoid warnings about pointer signedness.
      * src/keyboard.c (tty_read_avail_input) [WINDOWSNT]: Don't define
      n_to_read, as it is not used.
      (MAX_ENCODED_BYTES) [WINDOWSNT]: Don't define, as it's unused.
      * src/w32font.h (syms_of_w32font): Remove redundant prototype.
      * src/xfaces.c (x_display_info) [HAVE_NTGUI]: Remove unused macro.
      * src/term.c (init_tty) [DOS_NT]: Ifdef away variables that are
      not used by DOS_NT builds, to avoid compiler warnings.
      * src/menu.c (current_popup_menu) [HAVE_NTGUI]: Remove redundant
      declaration.
      * src/dispnew.c (init_display) [WINDOWSNT]: Use type-cast to shut
      up compiler warnings.
      * src/w32term.h (x_set_window_size, x_get_focus_frame)
      (x_make_frame_visible, x_make_frame_invisible, x_iconify_frame)
      (x_set_frame_alpha, x_activate_menubar, x_bitmap_icon)
      (x_free_frame_resources, x_real_positions)
      (display_x_get_resource): Remove redundant prototypes.
      
      * lib-src/ntlib.c (sys_ctime, sys_fopen, sys_chdir, mkostemp)
      (sys_rename, gettimeofday): Provide prototypes.
      * lib-src/ntlib.h (getuid, geteuid, mkostemp): Remove redundant
      declarations.
      * lib-src/emacsclient.c (w32_getenv): Argument is now 'const char *'.
      (xstrdup, w32_get_resource, w32_window_app, w32_execvp, ttyname)
      (close_winsock, initialize_sockets, w32_set_user_model_id)
      (w32_find_emacs_process, w32_give_focus) [WINDOWSNT]: Add
      prototypes.
      (w32_get_resource) [WINDOWSNT]: Fix a warning about signedness
      difference.
      (w32_set_user_model_id): Update prototype of
      SetCurrentProcessExplicitAppUserModelID to avoid compiler
      warnings.
      (start_daemon_and_retry_set_socket) [WINDOWSNT]: Use type-cast to
      shut up compiler warnings.
      * lib-src/etags.c (MAXPATHLEN) [WINDOWSNT]: Remove unused macro.
      cb5af792
  27. 24 Mar, 2016 1 commit
    • Eli Zaretskii's avatar
      Improve font selection by family on MS-Windows · 7eba90c1
      Eli Zaretskii authored
      * src/w32font.c (w32font_list_internal): Allow 'ascii-0' charset,
      in addition to 'iso10646-1', 'unicode-bmp', and 'unicode-sip'.
      This avoids rejecting many font families whose members are shown
      by 'font-family-list', in particular 'courier' requested by
      info.el.  Without this change, many values of ':family' attribute
      of a face have no effect on MS-Windows, because they are rejected
      due to bogus mismatch of the charset.
      7eba90c1
  28. 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
  29. 01 Jan, 2016 1 commit
  30. 22 Oct, 2015 1 commit
    • Eli Zaretskii's avatar
      Include file cleanup for w32 files in src directory · d4352f81
      Eli Zaretskii authored
      * src/w32xfns.c: Don't include keyboard.h, window.h, charset.h,
      fontset.h, blockinput.h.
      * src/w32uniscribe.c: Don't include dispextern.h, character.h,
      charset.h, fontset.h.
      * src/w32term.c: Don't include systty.h, systime.h, charset.h,
      character.h, ccl.h, dispextern.h, disptab.h, intervals.h,
      process.h, atimer.h, keymap.h, w32heap.h.  Include bitmap/gray.xbm
      in an ifdef-ed away block.
      Include fcntl.h for CYGWIN.
      (set_frame_param): Remove unused function.
      * src/w32select.c: Don't include charset.h and composite.h.
      (setup_config, Fw32_get_clipboard_data): Avoid compiler warnings
      due to pointer signedness mismatches.
      * src/w32reg.c (w32_get_string_resource): Avoid compiler warnings
      due to pointer signedness mismatches.
      * src/w32proc.c: Include unistd.h.  Don't include systime.h,
      process.h, dispextern.h.
      (sys_spawnve, Fw32_short_file_name, Fw32_long_file_name)
      (Fw32_application_type): Avoid compiler warnings due to pointer
      signedness mismatches.
      * src/w32menu.c: Don't include keymap.h, termhooks.h, window.h,
      character.h, charset.h, dispextern.h.
      (simple_dialog_show, add_menu_item): Avoid compiler warnings due
      to pointer signedness mismatches.
      * src/w32inevt.c: Don't include dispextern.h, window.h,
      termhooks.h, w32heap.h.
      * src/w32font.c: Don't include dispextern.h, character.h,
      charset.h, fontset.h, font.h.
      (intern_font_name, add_font_entity_to_list)
      (registry_to_w32_charset, w32_to_x_charset, fill_in_logfont)
      (list_all_matching_fonts): Avoid compiler warnings due to pointer
      signedness mismatches.
      * src/w32fns.c: Don't include character.h, intervals.h,
      dispextern.h, epaths.h, charset.h, ccl.h, fontset.h, systime.h,
      termhooks.h, w32heap.h, bitmap/gray.xbm, font.h, w32font.h.
      (w32_color_map_lookup, add_system_logical_colors_to_map)
      (x_decode_color, x_set_name, FPRINTF_WM_CHARS, Fxw_color_defined_p)
      (Fxw_color_values, x_display_info_for_name, Fset_message_beep)
      (x_create_tip_frame, Fx_file_dialog, Fsystem_move_file_to_trash)
      (w32_parse_hot_key, Ffile_system_info, w32_kbd_patch_key): Avoid
      compiler warnings, mainly due to pointer signedness mismatches.
      (unwind_create_frame_1): Remove unused function.
      * src/w32console.c: Don't include character.h, disptab.h, frame.h,
      window.h, termhooks.h, dispextern.h.
      (w32con_write_glyphs, w32con_write_glyphs_with_face): Fix pointer
      signedness mismatch.
      * src/w32.c: Include c-strcase.h and systty.h.  Don't include
      w32heap.h.
      d4352f81
  31. 28 May, 2015 1 commit
    • Eli Zaretskii's avatar
      Fix display of glyphless characters with problematic fonts · c76605fa
      Eli Zaretskii authored
      * src/w32term.c (x_draw_glyph_string_background): Force redraw of
      glyph string background also when the font in use claims
      preposterously large global height value.  Helps to remove
      artifacts left from previous displays when glyphless characters
      are displayed as hex code in a box.
      * src/xterm.c (x_draw_glyph_string_background): Force redraw of
      glyph string background also when the font in use claims
      preposterously large global height value.  Helps to remove
      artifacts left from previous displays when glyphless characters
      are displayed as hex code in a box.
      * src/w32font.c (w32font_draw): Fix background drawing for
      glyphless characters that display as acronyms or hex codes in a
      box.
      * src/xftfont.c (xftfont_draw): Fix background drawing for
      glyphless characters that display as acronyms or hex codes in a
      box.
      * src/xdisp.c (produce_glyphless_glyph): Compute reasonable values
      for it->ascent and it->descent when the font claims preposterously
      large global values.
      (FONT_TOO_HIGH): Move from here...
      * src/dispextern.h (FONT_TOO_HIGH): ...to here.
      c76605fa
  32. 26 May, 2015 1 commit
    • Eli Zaretskii's avatar
      Teach MS-Windows font back-end return per-glyph ascent/descent · 53bedd3a
      Eli Zaretskii authored
      * src/w32font.h (struct w32_metric_cache): Add ascent and descent
      values.
      
      * src/w32font.c (w32font_text_extents): Compute, cache, and
      accumulate per-glyph ascent and descent values, instead of copying
      global values from the font.  If the values are not available from
      the font data, i.e., non-TTF fonts, fall back on font-global values.
      (compute_metrics): Compute and return per-glyph ascent and descent
      values, if returned by GetGlyphOutlineW, falling back on
      font-global values.  (Bug#20628)
      
      * src/w32term.c (w32_draw_rectangle): Add 1 pixel to width and
      height of rectangle to be drawn, to be compatible with
      XDrawRectangle.  Fixes glyphless-char display as hex codes in a
      box, when per-glyph ascent/descent values are used.
      53bedd3a
  33. 12 Mar, 2015 1 commit
    • Eli Zaretskii's avatar
      Fix support of scripts in w32font.c (Bug#19993) · fc10058a
      Eli Zaretskii authored
       src/w32font.c (font_supported_scripts): Add subranges for Latin
       Supplement, Latin Extended-A/B, Vai, Supplemental Punctuation, Tai
       Le, Buginese, Yijing Hexagrams, Ancient Greek Numbers, Tai Xuan
       Jing, Counting Rods, Sundanese, Lepcha, Ol Chiki, Saurashtra,
       Kayah Li, Rejang, Ancient Symbols, Phistos Disc, Carian, Lycian,
       Lydian, Dominoe Tiles, and Mahjong Tiles.  Break the Mathematical
       Alphanumeric Symbols into several "scripts" like fontset.el does.
       (syms_of_w32font): DEFSYM all the new script symbols.
      
       lisp/international/fontset.el (script-representative-chars): Add a
       representative character for 'vai'.
      fc10058a
  34. 21 Feb, 2015 1 commit
  35. 29 Jan, 2015 1 commit
    • Eli Zaretskii's avatar
      Use bool for boolean in w32menu.c, w32font.c, w32uniscribe.c. · 0761ec16
      Eli Zaretskii authored
       src/w32uniscribe.c (uniscribe_list, uniscribe_match): Use bool where
       appropriate.
       src/w32font.c (struct font_callback_data, w32font_list_internal)
       (w32font_driver, w32font_match_internal): Use bool where appropriate.
       src/w32menu.c (x_activate_menubar, set_frame_menubar)
       (w32_dialog_show, initialize_frame_menubar, w32_menu_show)
       (is_simple_dialog): Use bool where appropriate.
      0761ec16
  36. 05 Jan, 2015 2 commits
    • Eli Zaretskii's avatar
      MS-Windows followup to previous commit · 5b5dab12
      Eli Zaretskii authored
       src/w32proc.c, src/w32.h, src/w32fns.c, src/w32font.c, src/w32menu.c:
       src/w32notify.c, src/w32proc.c, src/w32select.c, src/w32term.c:
       src/w32uniscribe.c: Remove declarations of Q* variables that
       represent symbols.
      5b5dab12
    • Paul Eggert's avatar
      Compute C decls for DEFSYMs automatically · 58f2d6ef
      Paul Eggert authored
      Fixes Bug#15880.
      This patch also makes Q constants (e.g., Qnil) constant addresses
      from the C point of view.
      * make-docfile.c: Revamp to generate table of symbols, too.
      Include <stdbool.h>.
      (xstrdup): New function.
      (main): Don't process the same file twice.
      (SYMBOL): New constant in enum global_type.
      (struct symbol): Turn 'value' member into a union, either v.value
      for int or v.svalue for string.  All uses changed.
      (add_global): New arg svalue, which overrides value, so that globals
      can have a string value.
      (close_emacs_global): New arg num_symbols; all uses changed.
      Output lispsym decl.
      (write_globals): Output symbol globals too.  Output more
      ATTRIBUTE_CONST, now that Qnil etc. are C constants.
      Output defsym_name table.
      (scan_c_file): Move most of guts into ...
      (scan_c_stream): ... new function.  Scan for DEFSYMs and
      record symbols found.  Don't read past EOF if file doesn't
      end in newline.
      * alloc.c, bidi.c, buffer.c, bytecode.c, callint.c, casefiddle:
      * casetab.c, category.c, ccl.c, charset.c, chartab.c, cmds.c, coding.c:
      * composite.c, data.c, dbusbind.c, decompress.c, dired.c, dispnew.c:
      * doc.c, editfns.c, emacs.c, eval.c, fileio.c, fns.c, font.c, fontset.c:
      * frame.c, fringe.c, ftfont.c, ftxfont.c, gfilenotify.c, gnutls.c:
      * image.c, inotify.c, insdel.c, keyboard.c, keymap.c, lread.c:
      * macfont.m, macros.c, minibuf.c, nsfns.m, nsfont.m, nsimage.m:
      * nsmenu.m, nsselect.m, nsterm.m, print.c, process.c, profiler.c:
      * search.c, sound.c, syntax.c, term.c, terminal.c, textprop.c, undo.c:
      * window.c, xdisp.c, xfaces.c, xfns.c, xftfont.c, xmenu.c, xml.c:
      * xselect.c, xsettings.c, xterm.c:
      Remove Q vars that represent symbols (e.g., Qnil, Qt, Qemacs).
      These names are now defined automatically by make-docfile.
      * alloc.c (init_symbol): New function.
      (Fmake_symbol): Use it.
      (c_symbol_p): New function.
      (valid_lisp_object_p, purecopy): Use it.
      * alloc.c (marked_pinned_symbols):
      Use make_lisp_symbol instead of make_lisp_ptr.
      (garbage_collect_1): Mark lispsym symbols.
      (CHECK_ALLOCATED_AND_LIVE_SYMBOL): New macro.
      (mark_object): Use it.
      (sweep_symbols): Sweep lispsym symbols.
      (symbol_uses_obj): New function.
      (which_symbols): Use it.  Work for lispsym symbols, too.
      (init_alloc_once): Initialize Vpurify_flag here; no need to wait,
      since Qt's address is already known now.
      (syms_of_alloc): Add lispsym count to symbols_consed.
      * buffer.c (init_buffer_once): Compare to Qnil, not to make_number (0),
      when testing whether storage is all bits zero.
      * dispextern (struct image_type):
      * font.c (font_property_table):
      * frame.c (struct frame_parm_table, frame_parms):
      * keyboard.c (scroll_bar_parts, struct event_head):
      * xdisp.c (struct props):
      Use XSYMBOL_INIT (Qfoo) and struct Lisp_Symbol * rather than &Qfoo and
      Lisp_Object *, since Qfoo is no longer an object whose address can be
      taken.  All uses changed.
      * eval.c (run_hook): New function.  Most uses of Frun_hooks changed to
      use it, so that they no longer need to take the address of a Lisp sym.
      (syms_of_eval): Don't use DEFSYM on Vrun_hooks, as it's a variable.
      * frame.c (syms_of_frame): Add defsyms for the frame_parms table.
      * keyboard.c (syms_of_keyboard): Don't DEFSYM Qmenu_bar here.
      DEFSYM Qdeactivate_mark before the corresponding var.
      * keymap.c (syms_of_keymap): Use DEFSYM for Qmenu_bar and Qmode_line
      instead of interning their symbols; this avoids duplicates.
      (LISP_INITIALLY, TAG_PTR)
      (DEFINE_LISP_SYMBOL_BEGIN, DEFINE_LISP_SYMBOL_END, XSYMBOL_INIT):
      New macros.
      (LISP_INITIALLY_ZERO): Use it.
      (enum symbol_interned, enum symbol_redirect, struct Lisp_Symbol)
      (EXFUN, DEFUN_ARGS_MANY, DEFUN_ARGS_UNEVALLED, DEFUN_ARGS_*):
      Move decls up, to avoid forward uses.  Include globals.h earlier, too.
      (make_lisp_symbol): New function.
      (XSETSYMBOL): Use it.
      (DEFSYM): Now just a placeholder for make-docfile.
      * lread.c (DEFINE_SYMBOLS): Define, for globals.h.
      (intern_sym): New function, with body taken from old intern_driver.
      (intern_driver): Use it.  Last arg is now Lisp integer, not ptrdiff_t.
      All uses changed.
      (define_symbol): New function.
      (init_obarray): Define the C symbols taken from lispsym.
      Use plain DEFSYM for Qt and Qnil.
      * syntax.c (init_syntax_once): No need to worry about
      Qchar_table_extra_slots.
      58f2d6ef
  37. 01 Jan, 2015 1 commit